git: include new git ports driver

This commit is contained in:
Thomas Penteker 2015-04-21 22:46:21 +02:00
parent c01b6d56f5
commit bd86ca2544
4 changed files with 49 additions and 1 deletions

View File

@ -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

View File

@ -1,2 +1,3 @@
3a41bf84bbc6d20bc537d99b972b815f git
43e01f9d96ba8c11611e0eef0d9f9f28 git-2.2.1.tar.xz
d9851260c085d4161a73c9441484a95e git-manpages-2.2.1.tar.xz

View File

@ -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
}

37
git/git Normal file
View File

@ -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"