ports/opt (3.1): git: include new git ports driver
commit bd86ca2544f8de84b455ad0e7e9b801abc51dc05 Author: Thomas Penteker <tek@serverop.de> Date: Tue Apr 21 22:46:21 2015 +0200 git: include new git ports driver diff --git a/git/.footprint b/git/.footprint index 7cfa137..49876ac 100644 --- a/git/.footprint +++ b/git/.footprint @@ -1,3 +1,7 @@ +drwxr-xr-x root/root etc/ +drwxr-xr-x root/root etc/ports/ +drwxr-xr-x root/root etc/ports/drivers/ +-rwxr-xr-x root/root etc/ports/drivers/git drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/bin/ -rwxr-xr-x root/root usr/bin/git diff --git a/git/.md5sum b/git/.md5sum index 612b82b..da615a7 100644 --- a/git/.md5sum +++ b/git/.md5sum @@ -1,2 +1,3 @@ +3a41bf84bbc6d20bc537d99b972b815f git 43e01f9d96ba8c11611e0eef0d9f9f28 git-2.2.1.tar.xz d9851260c085d4161a73c9441484a95e git-manpages-2.2.1.tar.xz diff --git a/git/Pkgfile b/git/Pkgfile index efa7f62..d45b7ce 100644 --- a/git/Pkgfile +++ b/git/Pkgfile @@ -8,7 +8,8 @@ name=git version=2.2.1 release=1 -source=(https://www.kernel.org/pub/software/scm/git/git-{,manpages-}$version.tar.xz) +source=(https://www.kernel.org/pub/software/scm/git/git-{,manpages-}$version.tar.xz + git) build() { cd $name-$version @@ -29,4 +30,9 @@ build() { find $PKG \( -name perllocal.pod -o -name .packlist \) -delete rm -rf $PKG/usr/share/{locale,gitk} + + # install the git ports driver + install -m 755 -d $PKG/etc/ports/drivers + install -m 755 $SRC/git $PKG/etc/ports/drivers/git + } diff --git a/git/git b/git/git new file mode 100644 index 0000000..c06863f --- /dev/null +++ b/git/git @@ -0,0 +1,37 @@ +#!/bin/sh +# +# /etc/ports/drivers/git: git driver script for ports(8) +# + +if [ $# -ne 1 ]; then + echo "usage: $0 <file>" >&2 + exit 1 +fi + +. $1 + +if [ -z "$URL" ]; then + echo "URL not set in '$1'" >&2 + exit 2 +fi +if [ -z "$NAME" ]; then + echo "NAME not set in '$1'" >&2 + exit 2 +fi + +echo "Fetching updates from $URL" +echo "Updating collection $NAME" + +cd "$PORTS_DIR/$NAME" 2> "/dev/null" + +if [ $? -lt 1 ]; then + git fetch -q + git diff --pretty=format: --name-status $BRANCH origin/$BRANCH | sed "s/M\t/ Edit /g; s/A\t/ Checkout /g; s/D\t/ Delete /g" | sort + git clean -q -f + git reset -q --hard origin/$BRANCH +else + echo " Initial git clone, this may take a while" + git clone -q "$URL" "$PORTS_DIR/$NAME" +fi + +echo "Finished successfully"
participants (1)
-
crux@crux.nu