Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=e27183488b93ca5de2e32877d5577ed0cb733f6e
commit e27183488b93ca5de2e32877d5577ed0cb733f6e
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date: Fri Dec 28 04:27:05 2007 +0100
scripts/*sync: write a .version file to the fdb if possible
this file is transferred to the clients and hooks can use it
diff --git a/scripts/gensync b/scripts/gensync
index e2386af..ac123de 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -264,9 +264,19 @@ for file in `find $rootdir -name $BUILDSCRIPT`; do
fi
done
+ver=""
+if ( cd $rootdir; git rev-parse --get-root &>/dev/null); then
+ ver=`cd $rootdir; git describe 2>/dev/null`
+fi
+extra=""
+if [ -n "$ver" ]; then
+ echo ${ver//-/.} > .version
+ extra=".version"
+fi
+
echo "gensync: compressing to $destfile..." >&2
cd $gstmpdir
-tar cjf $destfile *
+tar cjf $destfile $extra *
[ $? -gt 0 ] && die "error writing to $destfile"
rm -rf $gstmpdir
diff --git a/scripts/updatesync b/scripts/updatesync
index fa79bd5..36f7b4a 100755
--- a/scripts/updatesync
+++ b/scripts/updatesync
@@ -305,6 +305,15 @@ if [ "$action" = "upd" ]; then
i=$(($i+1))
done
fi
+ ver=""
+ rootdir=`dirname $option`
+ if ( cd $rootdir; git rev-parse --get-root &>/dev/null); then
+ ver=`cd $rootdir; git describe 2>/dev/null`
+ fi
+ if [ -n "$ver" ]; then
+ echo ${ver//-/.} > .version
+ tar rf $udb .version
+ fi
else
# DELETE
delete_entry $option
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git