diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | make_patchnum.sh | 10 | ||||
-rw-r--r-- | perl.c | 17 |
3 files changed, 19 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore index 81f4486921..c2aab4988c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,9 @@ *.patch # ignore local .config files .config -# ignore generated .patchnum file +# these are generated by make_patchnum.sh from git or from a .patchfile .patchnum +.sha1 # files produced by './configure.gnu' on a Linux machine diff --git a/make_patchnum.sh b/make_patchnum.sh index 5a6163702d..b26217ffa8 100644 --- a/make_patchnum.sh +++ b/make_patchnum.sh @@ -1,18 +1,22 @@ #!/bin/sh Existing=`cat .patchnum 2>/dev/null` +Existing_Sha1=`cat .sha1 2>/dev/null` if [ -e ".patch" ]; then Current=`awk '{print $4}' .patch` + Sha1=`awk '{print $3}' .patch` elif [ -d ".git" ]; then # we should do something better here Current=`git describe` + Sha1=`git rev-parse HEAD` Changed=`git diff-index --name-only HEAD` [ -n "$Changed" ] && Current="$Current-with-uncommitted-changes" fi -if [ "$Existing" != "$Current" ]; then - echo "Updating .patchnum" +if [ "$Existing" != "$Current" -o "$Existing_Sha1" != "$Sha1" ]; then + echo "Updating .patchnum and .sha1" echo -n $Current > .patchnum + echo -n $Sha1 > .sha1 else - echo "Reusing .patchnum" + echo "Reusing .patchnum and .sha1" fi @@ -1898,9 +1898,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) #else sv_catpvs(opts_prog,"\"\\nCharacteristics of this binary (from libperl): \\n"); #endif -#ifdef PERL_PATCHNUM - sv_catpvs(opts_prog, " Git Description: " STRINGIFY(PERL_PATCHNUM) "\\n"); -#endif + sv_catpvs(opts_prog," Source revision: " STRINGIFY(PERL_GIT_SHA1) "\\n"); sv_catpvs(opts_prog," Compile-time options: $_\\n\","); #if defined(LOCAL_PATCH_COUNT) @@ -1910,7 +1908,13 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) "\" Locally applied patches:\\n\","); for (i = 1; i <= LOCAL_PATCH_COUNT; i++) { if (PL_localpatches[i]) - Perl_sv_catpvf(aTHX_ opts_prog,"q%c\t%s\n%c,", +#ifdef X_PERL_PATCHNUM + if (strEQ(PL_localpatches[i],"DEVEL")) + Perl_sv_catpvf(aTHX_ opts_prog,"q%c\t%s\n%c,", + 0, STRINGIFY(PERL_PATCHNUM), 0); + else +#endif + Perl_sv_catpvf(aTHX_ opts_prog,"q%c\t%s\n%c,", 0, PL_localpatches[i], 0); } } @@ -3320,10 +3324,9 @@ Perl_moreswitches(pTHX_ const char *s) Perl_form(aTHX_ " OS Specific Release: %s\n", OSVERS)); #endif /* !DGUX */ -#ifdef PERL_PATCHNUM - PerlIO_printf(PerlIO_stdout(), "\nGit Description: %s", STRINGIFY(PERL_PATCHNUM)); +#if defined PERL_PATCHNUM + PerlIO_printf(PerlIO_stdout(),"\nCompiled from: %s",STRINGIFY(PERL_PATCHNUM)); #endif - #if defined(LOCAL_PATCH_COUNT) if (LOCAL_PATCH_COUNT > 0) PerlIO_printf(PerlIO_stdout(), |