Jeroen Demeyer on Thu, 22 Jul 2010 23:43:42 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

config/version: allow a saved custom $status


Dear pari-dev,

This is somewhat related to the discussion of "make release" in the
bison thread.

I propose that config/version looks for a file config/savedstatus to use
as $status (usually, $status is a string like "development svn-12541").
 This can be used for example by Sage package maintainers to supply an
arbitrary string as the version.

See my attached patch for a proposal (this patch can safely be included
in PARI without affecting PARI by itself).


Cheers,
Jeroen.
--- config/version	(revision 12541)
+++ config/version	(working copy)
@@ -14,7 +14,10 @@
 soname_num=$patch
 
 patchlevel_verbose=
-if test -d "$TOP/.svn"; then
+if test -f "$TOP/config/savedstatus"; then
+ status=`cat $TOP/config/savedstatus`
+ patchlevel_verbose="[ $status ]"
+else if test -d "$TOP/.svn"; then
  status="$status svn-"`svnversion $TOP`
  patchlevel_verbose="[ $status ]"
 else if test -d "$TOP/.git"; then
@@ -23,6 +26,7 @@
 else if test -d "$TOP/CVS"; then
  status="$status CHANGES-"`$head 1 "$TOP/CHANGES" | awk '{print $4}'`
  patchlevel_verbose="[ $status ]"
+      fi
     fi
   fi
 fi