Commits

Satish Balay committed e464329

version: switch over from using PETSC_VERSION_PATCH to PETSC_VERSION_SUBMINOR
i.e 3.4 release would have tarballs with names 3.4.0, 3.4.1 3.4.2 etc

Also stop using PETSC_VERSION_PATCH_DATE - but use:
PETSC_RELEASE_DATE: corresponding to release of 3.4, 3.5 etc
PETSC_VERSION_DATE: correspond to patch releases 3.4.0, 3.4.1 3.4.2 etc.

Also fix release/build scripts to work with the new naming scheme.

  • Participants
  • Parent commits 408b842

Comments (0)

Files changed (6)

File bin/maint/builddist

 # This script builds the PETSc tar file distribution
 #
 # Usage: builddist petscrepo branch
-# example usage: builddist /sandbox/petsc/petsc.clone
+# example usage: builddist /sandbox/petsc/petsc.clone maint
 # Notes: version info is automatically obtained from include/petscversion.h
 #
 #echo "------- Have you done ALL of the following?? -----------------------------"
 version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
 version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
 version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
-version_patch=`grep '^#define PETSC_VERSION_PATCH ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
+version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
 
 #generated a couple of more values
-version_patch_date=`date`
+version_date=`date +"%b, %d, %Y"`
 version_git=`git log -1 --pretty=format:%H`
 version_date_git=`git log -1 --pretty=format:%ci`
 if  [ ${version_release} = 0 ]; then
     version=-$branch
   fi
 elif [ ${version_release} = 1 ]; then
-  version=-${version_major}.${version_minor}-p${version_patch}
+  version=-${version_major}.${version_minor}.${version_subminor}
 else
   echo "Unknown PETSC_VERSION_RELEASE: ${version_release}"
   exit
 /bin/grep -v 'chmod' conf/rules.bak > conf/rules
 /bin/rm -f  conf/rules.bak
 
-#add in PETSC_VERSION_PATCH_DATE and PETSC_VERSION_GIT
-echo Using PETSC_VERSION_PATCH_DATE: ${version_patch_date}
+#add in PETSC_VERSION_DATE, PETSC_VERSION_GIT, PETSC_VERSION_DATE_GIT
+echo Using PETSC_VERSION_DATE: ${version_date}
 echo Using PETSC_VERSION_GIT: ${version_git}
+echo Using PETSC_VERSION_DATE_GIT: ${version_date_git}
 /bin/mv include/petscversion.h include/petscversion.h.bak
 cat include/petscversion.h.bak | \
-  sed -e "s/#define PETSC_VERSION_PATCH_DATE.*/#define PETSC_VERSION_PATCH_DATE \"${version_patch_date}\"/" | \
-  sed -e "s/#define PETSC_VERSION_GIT.*/#define PETSC_VERSION_GIT         \"${version_git}\"/" | \
+  sed -e "s/#define PETSC_VERSION_DATE.*/#define PETSC_VERSION_DATE       \"${version_date}\"/" | \
+  sed -e "s/#define PETSC_VERSION_GIT.*/#define PETSC_VERSION_GIT        \"${version_git}\"/" | \
   sed -e "s/#define PETSC_VERSION_DATE_GIT.*/#define PETSC_VERSION_DATE_GIT         \"${version_date_git}\"/" \
   > include/petscversion.h
 /bin/rm -f include/petscversion.h.bak

File bin/maint/createpatch

 #!/bin/sh
 
-# This script updates PATCHLEVEL in petscversion.h and download/index.html
+# This script updates VERSION_SUBMINOR in petscversion.h and download/index.html
 #
 # Usage: createpatch petscrepo
 # example usage: createpatch /sandbox/petsc/petsc-dist
 version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
 version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
 version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
-version_patch=`grep '^#define PETSC_VERSION_PATCH ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
+version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
 
 
 if  [ ${version_release} = 0 ]; then
 fi
 
 # crank up patchlevel
-new_version_patch=`expr $version_patch + 1`
-
-oldver=${version_major}.${version_minor}-p${version_patch}
-newver=${version_major}.${version_minor}-p${new_version_patch}
+new_version_subminor=`expr $version_subminor + 1`
+oldver=${version_major}.${version_minor}.${version_subminor}
+newver=${version_major}.${version_minor}.${new_version_subminor}
 
 echo #########################################################
-echo ## updating patchlevel from $version_patch to $new_version_patch  ##
+echo ## updating patchlevel from $version_subminor to $new_version_subminor  ##
 echo #########################################################
 
 
 # Update patchlevel in petscversion.h
 /bin/mv include/petscversion.h include/petscversion.h.bak
 cat include/petscversion.h.bak | \
-  sed -e "s/#define PETSC_VERSION_PATCH .*/#define PETSC_VERSION_PATCH      ${new_version_patch}/" > include/petscversion.h
+  sed -e "s/#define PETSC_VERSION_SUBMINOR .*/#define PETSC_VERSION_SUBMINOR   ${new_version_subminor}/" > include/petscversion.h
 /bin/rm -f include/petscversion.h.bak
 
 # Update patchlevel in download/index.html
-
-patchlevel=0
 /bin/mv src/docs/website/download/index.html src/docs/website/download/index.html.bak
 cat src/docs/website/download/index.html.bak | \
   sed -e "s/-${oldver}.tar.gz/-${newver}.tar.gz/g" > src/docs/website/download/index.html

File bin/maint/rebuildtar

 maintdir=`dirname $0`
 ${maintdir}/builddist ${PETSC_DIR} maint
 
+#determine tarball version
+version_major=`grep '^#define PETSC_VERSION_MAJOR ' ${PETSC_DIR}/include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
+version_minor=`grep '^#define PETSC_VERSION_MINOR ' ${PETSC_DIR}/include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
+version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' ${PETSC_DIR}/include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
+
+RELEASE=${version_major}.${version_minor}
+VERSION=${version_major}.${version_minor}.${version_subminor}
+
 #Now copy the generated tarfiles over to the website
-PATCH_VERSION=`grep '^#define PETSC_VERSION_PATCH ' ${PETSC_DIR}/include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`
-VERSION=${RELEASE}-p${PATCH_VERSION}
 scp ~/petsc-${VERSION}.tar.gz petsc@login.mcs.anl.gov:/mcs/ftp/pub/petsc/release-snapshots/
 scp ~/petsc-lite-${VERSION}.tar.gz petsc@login.mcs.anl.gov:/mcs/ftp/pub/petsc/release-snapshots/
 

File include/petscversion.h

 #define PETSC_VERSION_MAJOR      3
 #define PETSC_VERSION_MINOR      3
 #define PETSC_VERSION_SUBMINOR   0
-#define PETSC_VERSION_PATCH      7
-#define PETSC_VERSION_DATE       "Jun, 5, 2012"
-#define PETSC_VERSION_PATCH_DATE "unknown"
+#define PETSC_VERSION_PATCH      0
+#define PETSC_RELEASE_DATE       "Jun, 5, 2012"
+#define PETSC_VERSION_DATE       "unknown"
 
 #if !defined (PETSC_VERSION_GIT)
-#define PETSC_VERSION_GIT         "unknown"
+#define PETSC_VERSION_GIT        "unknown"
 #endif
 
 #if !defined(PETSC_VERSION_DATE_GIT)
-#define PETSC_VERSION_DATE_GIT    "unknown"
+#define PETSC_VERSION_DATE_GIT   "unknown"
 #endif
 
 #define PETSC_VERSION_(MAJOR,MINOR,SUBMINOR) \
         version_release=`grep '^#define PETSC_VERSION_RELEASE ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
         version_major=`grep '^#define PETSC_VERSION_MAJOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
         version_minor=`grep '^#define PETSC_VERSION_MINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
-        version_patch=`grep '^#define PETSC_VERSION_PATCH ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
+        version_subminor=`grep '^#define PETSC_VERSION_SUBMINOR ' include/petscversion.h |tr -s ' ' | cut -d ' ' -f 3`; \
         if  [ $${version_release} = 0 ]; then \
           petscversion=petsc-dev; \
           export petscversion; \
         elif [ $${version_release} = 1 ]; then \
-          petscversion=petsc-$${version_major}.$${version_minor}-p$${version_patch}; \
+          petscversion=petsc-$${version_major}.$${version_minor}.$${version_subminor}; \
           export petscversion; \
         else \
           echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \

File src/sys/objects/version.c

 {
   PetscErrorCode ierr;
 #if (PETSC_VERSION_RELEASE == 1)
-  ierr = PetscSNPrintf(version,len,"Petsc Release Version %d.%d.%d, Patch %d, %s ",PETSC_VERSION_MAJOR,PETSC_VERSION_MINOR, PETSC_VERSION_SUBMINOR,PETSC_VERSION_PATCH,PETSC_VERSION_PATCH_DATE);CHKERRQ(ierr);
+  ierr = PetscSNPrintf(version,len,"Petsc Release Version %d.%d.%d, %s ",PETSC_VERSION_MAJOR,PETSC_VERSION_MINOR, PETSC_VERSION_SUBMINOR,PETSC_VERSION_DATE);CHKERRQ(ierr);
 #else
   ierr = PetscSNPrintf(version,len,"Petsc Development GIT revision: %s  GIT Date: %s",PETSC_VERSION_GIT, PETSC_VERSION_DATE_GIT);CHKERRQ(ierr);
 #endif