X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=configpm;h=1825b0df9cc9d1b08a26be82c5f05e3f85656474;hb=7a71a5145432d34189dc8574df73a361bd48e4ee;hp=ced0ad7c2765e895c2789fc7d0257cf72846e282;hpb=8ed6d636bbf576aca711d971b9e9893460c96ecc;p=p5sagit%2Fp5-mst-13.2.git diff --git a/configpm b/configpm index ced0ad7..1825b0d 100755 --- a/configpm +++ b/configpm @@ -31,12 +31,9 @@ # on Config.pm should trigger even if only Config_heavy.pl has changed. sub usage { die < '', # --cross=PLATFORM - crosscompiling for PLATFORM 'glossary' => 1, # --no-glossary - no glossary file inclusion, # for compactness - 'heavy' => '', # pathname of the Config_heavy.pl file ); sub opts { @@ -90,29 +86,24 @@ sub opts { my %Opts = opts(); my ($Config_SH, $Config_PM, $Config_heavy, $Config_POD); -my $Glossary = $ARGV[1] || 'Porting/Glossary'; +my $Glossary = 'Porting/Glossary'; if ($Opts{cross}) { # creating cross-platform config file mkdir "xlib"; mkdir "xlib/$Opts{cross}"; - $Config_PM = $ARGV[0] || "xlib/$Opts{cross}/Config.pm"; + $Config_PM = "xlib/$Opts{cross}/Config.pm"; $Config_POD = "xlib/$Opts{cross}/Config.pod"; $Config_SH = "Cross/config-$Opts{cross}.sh"; } else { - $Config_PM = $ARGV[0] || 'lib/Config.pm'; + $Config_PM = "lib/Config.pm"; $Config_POD = "lib/Config.pod"; $Config_SH = "config.sh"; } -if ($Opts{heavy}) { - $Config_heavy = $Opts{heavy}; -} -else { - ($Config_heavy = $Config_PM) =~ s!\.pm$!_heavy.pl!; - die "Can't automatically determine name for Config_heavy.pl from '$Config_PM'" - if $Config_heavy eq $Config_PM; -} +($Config_heavy = $Config_PM) =~ s/\.pm$/_heavy.pl/; +die "Can't automatically determine name for Config_heavy.pl from '$Config_PM'" + if $Config_heavy eq $Config_PM; my $config_txt; my $heavy_txt; @@ -467,7 +458,19 @@ my $summary_expanded; sub myconfig { return $summary_expanded if $summary_expanded; ($summary_expanded = $summary) =~ s{\$(\w+)} - { my $c = $Config::Config{$1}; defined($c) ? $c : 'undef' }ge; + { + my $c; + if ($1 eq 'git_ancestor_line') { + if ($Config::Config{git_ancestor}) { + $c= "\n Ancestor: $Config::Config{git_ancestor}"; + } else { + $c= ""; + } + } else { + $c = $Config::Config{$1}; + } + defined($c) ? $c : 'undef' + }ge; $summary_expanded; } @@ -544,6 +547,15 @@ foreach my $prefix (qw(libs libswanted)) { $heavy_txt .= "EOVIRTUAL\n"; +$heavy_txt .= <<'ENDOFGIT'; +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; $config_txt .= <<'ENDOFEND'; @@ -841,6 +853,8 @@ some of the variables described below, or may have extraneous variables specific to that particular port. See the port specific documentation in such cases. +=cut + ENDOFTAIL if ($Opts{glossary}) { @@ -857,12 +871,16 @@ sub process { print CONFIG_POD <