From: Craig A. Berry Date: Thu, 1 Jan 2009 16:41:35 +0000 (-0600) Subject: First cut at handling git patch numbers on VMS. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c3905ef054a16857454499c7acfa64d8373c309;p=p5sagit%2Fp5-mst-13.2.git First cut at handling git patch numbers on VMS. Partially based on suggestions from John Malmberg at <495C279C.7020106@gmail.com>. --- diff --git a/MANIFEST b/MANIFEST index 955dead..6cdbe99 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3167,6 +3167,7 @@ makedepend.SH Precursor to makedepend 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 make_patchnum.sh Script to generate .patchnum file malloc.c A version of malloc you might not want malloc_ctl.h A version of malloc you might not want diff --git a/configure.com b/configure.com index d1dab4d..c8e3e5e 100644 --- a/configure.com +++ b/configure.com @@ -1408,9 +1408,10 @@ $ SET NOON $ OPEN/READ PATCH [-].patch $ READ PATCH line $ CLOSE PATCH -$ tmp = F$EDIT(line,"COLLAPSE") +$ tmp = F$EDIT(line,"TRIM,COMPRESS") +$ IF F$ELEMENT(3, " ", tmp) .NES. "" THEN tmp = F$ELEMENT(3, " ", tmp) $ SET ON -$ IF tmp .GT. perl_patchlevel then perl_patchlevel = tmp +$ IF tmp .NES. "" THEN perl_patchlevel = tmp $ ENDIF $! $ version_patchlevel_string = "version ''patchlevel' subversion ''subversion'" diff --git a/make_patchnum.com b/make_patchnum.com new file mode 100644 index 0000000..3c0e1ef --- /dev/null +++ b/make_patchnum.com @@ -0,0 +1,48 @@ +$! MAKE_PATCHNUM.COM +$! +$ open/read pf .patch +$ read pf line_in +$ close pf +$ line_in = f$edit(line_in, "TRIM,COMPRESS") +$ branch = f$element(0, " ", line_in) +$ snapshot_created = f$element(1, " ", line_in) +$ commit_id = f$element(2, " ", line_in) +$ describe = f$element(3, " ", line_in) +$! +$ changed="" +$ extra_info="git_snapshot_date='" + snapshot_created + "'" +$ commit_title="Snapshot of:" +$! +$ write sys$output "Updating .patchnum and lib/Config_git.pl" +$! +$ create .patchnum +$ open/append pn .patchnum +$ write pn "describe: ''describe'" +$ close pn +$! +$ create unpushed.h +$ open/append unp unpushed.h +$ write unp "/**********************************************************************" +$ write unp "* WARNING: unpushed.h is automatically generated by make_patchnum.com *" +$ write unp "* DO NOT EDIT DIRECTLY - edit make_patchnum.com instead *" +$ write unp "**********************************************************************/" +$ write unp "#define PERL_GIT_UNPUSHED_COMMITS /*no-op*/" +$ write unp "/*leave-this-comment*/" +$ close unp +$! +$ create [.lib]Config_git.pl +$ open/append cfg [.lib]Config_git.pl +$ write cfg "##################################################################" +$ write cfg "# WARNING: lib/Config_git.pl is generated by make_patchnum.com #" +$ write cfg "# DO NOT EDIT DIRECTLY - edit make_patchnum.com instead #" +$ write cfg "##################################################################" +$ write cfg "$Config::Git_Data=<<'ENDOFGIT';" +$ write cfg "git_commit_id='" + commit_id + "'" +$ write cfg "git_describe='" + describe + "'" +$ write cfg "git_branch='" + branch + "'" +$ write cfg "git_uncommitted_changes='" + changed + "'" +$ write cfg "git_commit_id_title='" + commit_title + "'" +$ write cfg "''extra_info'" +$ write cfg "ENDOFGIT" +$ close cfg +$ exit diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index 773225f..5ffabb5 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -359,18 +359,23 @@ utils4 = [.utils]enc2xs.com [.utils]piconv.com [.utils]cpan.com [.utils]prove.co utils5 = [.utils]corelist.com [.utils]config_data.com [.utils]cpanp.com [.utils]cpan2dist.com [.utils]cpanp-run-perl.com .ifdef NOX2P -all : base extras archcorefiles preplibrary perlpods +all : make_patchnum.ts base extras archcorefiles preplibrary perlpods @ QUALIFIERS := $(MMSQUALIFIERS) @ QUALIFIERS = QUALIFIERS - """" - """" @ write sys$output " " @ write sys$output " Everything is up to date. '$(MMS)''QUALIFIERS' test' to run test suite." .else -all : base extras x2p archcorefiles preplibrary perlpods +all : make_patchnum.ts base extras x2p archcorefiles preplibrary perlpods @ QUALIFIERS := $(MMSQUALIFIERS) @ QUALIFIERS = QUALIFIERS - """" - """" @ write sys$output " " @ write sys$output " Everything is up to date. '$(MMS)''QUALIFIERS' test' to run test suite." .endif + +make_patchnum.ts : + @ @make_patchnum.com + @ Copy/NoConfirm _NLA0: $(MMS$TARGET) + base : miniperl perl @ $(NOOP) extras : dynext libmods utils podxform extra.pods @@ -1839,6 +1844,9 @@ clean : tidy cleantest cleanup_unpacked_files - If F$Search("[.pod]*.com").nes."" Then Delete/NoConfirm/Log [.pod]*.com;* - If F$Search("[.pod]perldelta.pod").nes."" Then Delete/NoConfirm/Log [.pod]perldelta.pod;* - @extra_pods CLEAN + - If F$Search(".patchnum").nes."" Then Delete/NoConfirm/Log .patchnum;* + - If F$Search("[.lib]Config_git.pl").nes."" Then Delete/NoConfirm/Log [.lib]Config_git.pl;* + - If F$Search("unpushed.h").nes."" Then Delete/NoConfirm/Log unpushed.h;* realclean : clean - @make_ext "$(MINIPERL_EXE)" "$(MMS)" realclean