From: Ben Gras Date: Thu, 25 Nov 2010 15:25:17 +0000 (+0000) Subject: mkboot: include git id in image name if available. X-Git-Tag: v3.2.0~729 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.host.html?a=commitdiff_plain;h=d1cfc508110f114e775bbd0c6b46b6b415bc452f;p=minix.git mkboot: include git id in image name if available. --- diff --git a/tools/mkboot b/tools/mkboot index b877fbbf5..95824f2b6 100755 --- a/tools/mkboot +++ b/tools/mkboot @@ -64,33 +64,33 @@ hdboot) sh tell_config OS_RELEASE . OS_VERSION >/tmp/mkb.$$ version=`sed 's/[" ]//g;/^$/d' /dev/null + then gitrev="-`git describe --always`" + fi + revision=`cat revision 2>/dev/null` if [ -z "$revision" ] then rrevision="" + gitrev="" else rrevision=r$revision fi oldrev=$revision - target="${version}r${revision}" - if [ -z "$revision" ] then revision=0 rrevision="" - elif [ -f $rootdir/boot/image/$target ] - then - if [ $rootdir/boot/image/$target -newer image ] - then - echo "$root:/boot/image/$target is up to date" - test $realroot != $root && umount $root - exit 0 - fi + else revision=`expr $revision + 1` rrevision=r$revision fi - target="${version}${rrevision}" + + target="${version}${rrevision}${gitrev}" set -- `ls -t $rootdir/boot/image`