diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2010-11-10 10:11:39 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2010-11-10 10:13:35 +0100 |
commit | d14b29ec1c3b50f7ff5c34c738e4a4d26240114c (patch) | |
tree | e6611069d135b18aff6352ef2d960ea8905ad3c3 | |
parent | 78c2d44e52aeaaf3de417faa579e39b86083da0a (diff) | |
download | eurephia-d14b29ec1c3b50f7ff5c34c738e4a4d26240114c.tar.gz eurephia-d14b29ec1c3b50f7ff5c34c738e4a4d26240114c.tar.xz eurephia-d14b29ec1c3b50f7ff5c34c738e4a4d26240114c.zip |
Fixed git tree status check once again
It turned out the previous git tree state check misinterpretted the
tree state on a clean git repository.
Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r-- | eurephiadm/commands/buildinfo.c | 8 | ||||
-rwxr-xr-x | eurephiadm/mk_buildinfo.sh | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/eurephiadm/commands/buildinfo.c b/eurephiadm/commands/buildinfo.c index ba30606..4b70516 100644 --- a/eurephiadm/commands/buildinfo.c +++ b/eurephiadm/commands/buildinfo.c @@ -86,10 +86,10 @@ int cmd_BuildInfo(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg, " branch: " BUILDBRANCH "\n" " HEAD ref: " BUILDGITREV "\n"); printf(" tree state: %s\n", - (GITSTATE == 0 ? "Clean" : "Modified")); - if( GITSTATE != 0 ) { - printf("\n Uncommitted changes to the git tree:\n" - MODIFIEDFILES); + (MODIFIEDCOUNT == 0 ? "Clean" : "Modified")); + if( MODIFIEDCOUNT != 0 ) { + printf("\n Uncommitted changes to the git tree (%i file%s):\n" + MODIFIEDFILES, MODIFIEDCOUNT, (MODIFIEDCOUNT != 1 ? "s" : "")); } #endif printf("\n"); diff --git a/eurephiadm/mk_buildinfo.sh b/eurephiadm/mk_buildinfo.sh index 0b6e36e..d4577df 100755 --- a/eurephiadm/mk_buildinfo.sh +++ b/eurephiadm/mk_buildinfo.sh @@ -36,8 +36,8 @@ if [[ $? = 0 ]]; then curdir=`pwd` srcroot="`dirname $gitdir`" cd $srcroot - modfiles="`git status -s | awk '/^[ ADM\?]([ ADM\?])/{ printf " %s\\\n", $0 }'`" - [[ -z ${modfiles} ]] && state=0 || state=1 + modfiles="`git status -s | awk 'BEGIN{modcount=0} /^[ ADM\?]([ ADM\?])/{ printf " %s\\\n", $0; modcount += 1 } END{exit modcount}'`" + modcount=$? cd $curdir else # Otherwise, it's from a source tarball @@ -58,7 +58,7 @@ if [[ -n "${gitrev}" ]]; then #define GITDIR "${gitdir}" #define BUILDBRANCH "${branch}" #define BUILDGITREV "${gitrev}" -#define GITSTATE "${state}" +#define MODIFIEDCOUNT ${modcount} #define MODIFIEDFILES "${modfiles}" EOF fi |