diff options
-rw-r--r-- | MANIFEST | 2 | ||||
-rw-r--r-- | Makefile.SH | 2 | ||||
-rwxr-xr-x | configpm | 5 | ||||
-rw-r--r-- | make_patchnum.pl | 34 | ||||
-rw-r--r-- | stock_git_version.h | 6 |
5 files changed, 32 insertions, 17 deletions
@@ -3171,7 +3171,7 @@ makedir.SH Precursor to makedir Makefile.micro microperl Makefile Makefile.SH A script that generates Makefile make_patchnum.com DCL script to generate .patchnum file on VMS (should be replaced by make_patchnum.pl) -make_patchnum.pl Script to generate git_Version.h and lib/Config_git.pl files for all OS'es +make_patchnum.pl Script to generate git_version.h and lib/Config_git.pl files for all OS'es malloc.c A version of malloc you might not want malloc_ctl.h A version of malloc you might not want MANIFEST This list of files diff --git a/Makefile.SH b/Makefile.SH index 352e2bae58..6d6ed3141f 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -541,7 +541,7 @@ sperl.i: perl.c $(h) .PHONY: all translators utilities make_patchnum make_patchnum: - $(LDLIBPTH) $(RUN) ./miniperl -Ilib make_patchnum.pl || $(MAKE) miniperl + $(LDLIBPTH) $(RUN) ./miniperl -Ilib make_patchnum.pl || $(MAKE) miniperl git_version.h: stock_git_version.h cp stock_git_version.h git_version.h @@ -548,11 +548,12 @@ foreach my $prefix (qw(libs libswanted)) { $heavy_txt .= "EOVIRTUAL\n"; $heavy_txt .= <<'ENDOFGIT'; -eval { +eval { # do not have hairy conniptions if this isnt available require 'Config_git.pl'; $Config_SH_expanded .= $Config::Git_Data; -}; + 1; +} or warn "Warning: failed to load Config_git.pl, something strange about this perl...\n"; ENDOFGIT $heavy_txt .= $fetch_string; diff --git a/make_patchnum.pl b/make_patchnum.pl index 95b8db6137..ad2e0f2f40 100644 --- a/make_patchnum.pl +++ b/make_patchnum.pl @@ -13,18 +13,30 @@ make_patchnum.pl - make patchnum perl make_patchnum.pl +=head1 DESCRITPTION + This program creates the files holding the information about locally applied patches to the source code. The created -files are C<.patchnum>, C<unpushed.h> and C<lib/Config_git.pl>. +files are C<git_version.h> and C<lib/Config_git.pl>. + +=item C<lib/Config_git.pl> + +Contains status information from git in a form meant to be processed +by the tied hash logic of Config.pm. It is actually optional, +although -V will look strange without it. -C<.patchnum> contains ??? +C<git_version.h> contains similar information in a C header file +format, designed to be used by patchlevel.h. This file is obtained +from stock_git_version.h if miniperl is not available, and then +later on replaced by the version created by this script. -C<lib/Config_git.pl> contains the configuration of git for -this branch. +=head1 AUTHOR -C<unpushed.h> contains the local changes that haven't been -synchronized with the remote repository as configured with -C<< git configure branch.<current branch>.remote >> +Yves Orton, Kenichi Ishigaki, Max Maischein + +=head1 COPYRIGHT + +Same terms as Perl itself. =cut @@ -33,7 +45,7 @@ BEGIN { while (!-e "$root/perl.c" and length($root)<100) { if ($root eq '.') { $root=".."; - } else { + } else { $root.="/.."; } } @@ -76,12 +88,12 @@ sub write_files { my %content= map { /WARNING: '([^']+)'/ || die "Bad mojo!"; $1 => $_ } @_; my @files= sort keys %content; my $files= join " and ", map { "'$_'" } @files; - foreach my $file (@files) { + foreach my $file (@files) { if (read_file($file) ne $content{$file}) { print "Updating $files\n"; write_file($_,$content{$_}) for @files; return 1; - } + } } print "Reusing $files\n"; return 0; @@ -100,7 +112,7 @@ elsif (-d path_to('.git')) { ($branch) = map { /\* ([^(]\S*)/ ? $1 : () } backtick('git branch'); my ($remote,$merge); if (length $branch) { - $merge= backtick("git config branch.$branch.merge"); + $merge= backtick("git config branch.$branch.merge"); $merge =~ s!^refs/heads/!!; $remote= backtick("git config branch.$branch.remote"); } diff --git a/stock_git_version.h b/stock_git_version.h index e07962f908..cf937deb51 100644 --- a/stock_git_version.h +++ b/stock_git_version.h @@ -1,6 +1,8 @@ /*************************************************************************** -* WARNING: git_version.h is automatically generated by make_patchnum.sh -* DO NOT EDIT DIRECTLY - edit make_patchnum.sh instead +This is: stock_git_config.h - temporary git_config.h file. +This file is used at the very start of the build process when we dont have +a miniperl available to make the real thing. It is copied in place during +the build process, and then later on replaced. ****************************************************************************/ #define PERL_PATCHNUM UNKOWN #define PERL_GIT_UNCOMMITTED_CHANGES ,"UNKNOWN" |