diff options
author | Floris Bos <bos@je-eigen-domein.nl> | 2012-07-23 15:09:21 +0200 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2012-07-23 17:07:31 +0100 |
commit | ee3636370d901bca306cf85241491f23e0f5034a (patch) | |
tree | efce198a7b0cb9dfc75c48b8fb07064a2e546ed5 /contrib/rom-o-matic | |
parent | def7f57eb28e24c3d5806a892feb6dc16d3f4451 (diff) | |
download | ipxe-ee3636370d901bca306cf85241491f23e0f5034a.zip ipxe-ee3636370d901bca306cf85241491f23e0f5034a.tar.gz ipxe-ee3636370d901bca306cf85241491f23e0f5034a.tar.bz2 |
[contrib] Fix rom-o-matic git version number issues
Fixes issue in which git version number is not displayed on startup
when iPXE is built through rom-o-matic.
Remove special characters from filename generated by rom-o-matic (so
that you get "ipxe-1.0.0+c3b4-undionly.kkpxe" instead of
"ipxe-1.0.0+ (c3b4)-undionly.kkpxe")
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'contrib/rom-o-matic')
-rw-r--r-- | contrib/rom-o-matic/build.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/rom-o-matic/build.php b/contrib/rom-o-matic/build.php index b9bc595..b2b5bb4 100644 --- a/contrib/rom-o-matic/build.php +++ b/contrib/rom-o-matic/build.php @@ -179,7 +179,12 @@ if ( $embedded_script != "" ) { // Make the requested image. $status is set to 0 on success $make_target = "bin/${nic}.${fmt_extension}"; -$make_cmd = "make -C '$build_dir' '$make_target' $emb_script_cmd 2>&1"; +$gitversion = exec('git describe --always --abbrev=1 --match "" 2>/dev/null'); +if ($gitversion) { + $gitversion = "GITVERSION=$gitversion"; +} + +$make_cmd = "make -C '$build_dir' '$make_target' $gitversion $emb_script_cmd 2>&1"; exec ( $make_cmd, $maketxt, $status ); @@ -239,7 +244,7 @@ if ( $status == 0 ) { // Delete build directory as soon as it is not needed rm_build_dir (); - $output_filename = "ipxe-${version}-${nic}.${fmt_extension}"; + $output_filename = preg_replace('/[^a-z0-9\+\.\-]/i', '', "ipxe-${version}-${nic}.${fmt_extension}"); // Try to force IE to handle downloading right. Header ( "Cache-control: private"); |