Commits

Satish Balay  committed 9c5cad7

nightlybuilds - update git commands - and use 'petsc.clone' as reponame

  • Participants
  • Parent commits 91656f7

Comments (0)

Files changed (5)

File bin/maint/builddist

 # This script builds the PETSc tar file distribution
 #
 # Usage: builddist petscrepo branch
-# example usage: builddist /sandbox/petsc/petsc.git
+# example usage: builddist /sandbox/petsc/petsc.clone
 # Notes: version info is automatically obtained from include/petscversion.h
 #
 #echo "------- Have you done ALL of the following?? -----------------------------"
 PETSC_DIR=`cd $petscrepo;pwd -P`; export PETSC_DIR
 
 # Clean and Update the git repository and check for branch
-cd $PETSC_DIR; git reset --hard; git clean -q -f -d
-git checkout $branch;
+cd $PETSC_DIR
+git checkout -f $branch
 if [ "$?" != "0" ]; then
   echo 'Error: branch: $branch does not exist in $PETSC_DIR'
   exit
 fi
+git clean -q -f -d
 git pull -q
 
 pdir=`basename $PETSC_DIR`
 
 #generated a couple of more values
 version_patch_date=`date`
-version_git=`git log -1 --pretty=format:%H`
-version_date_git=`git log -1 --pretty=format:%aD`
+version_git=`git rev-parse HEAD`
+version_date_git=`git log -1 --pretty=format:%ci`
 if  [ ${version_release} = 0 ]; then
   if [ "$branch" = "master" ]; then
     version=-dev

File bin/maint/confignightly/default

   set DASHN=-n
   set GIT=yes
   set URL=https://bitbucket.org/petsc/petsc
-  set RNAME=petsc.git
+  set RNAME=petsc.clone
   set TNAME=`echo ${TEST} | cut -d ':' -f 1`
   set BRANCH=`echo ${TEST} | cut -s -d ':' -f 2`
   if ("$BRANCH" == "") then

File bin/maint/startnightly

       endif
     endif
     echo "Cleaning and updating clone at $USR@$MACH $LOC"
-    $SSH $USR@$MACH $DASHN "cd $LOC ; git reset --hard; git checkout ${BRANCH}; git pull -q "
+    $SSH $USR@$MACH $DASHN "cd $LOC ; git checkout -f ${BRANCH}; git pull -q "
   else
     rsync -e ssh -az --delete  $pdir/ ${USR}@${MACH}:${LOC}
   endif

File config/PETSc/utilities/petscdir.py

       self.isClone = 1
       if os.path.exists(os.path.join(self.dir, '.git')):
         if hasattr(self.sourceControl,'git'):
-          self.addDefine('VERSION_GIT','"'+os.popen("cd "+self.dir+" && "+self.sourceControl.git+" log -1 --pretty=format:%H").read()+'"')
-          self.addDefine('VERSION_DATE_GIT','"'+os.popen("cd "+self.dir+" && "+self.sourceControl.git+" log -1 --pretty=format:%aD").read()+'"')
+          self.addDefine('VERSION_GIT','"'+os.popen("cd "+self.dir+" && "+self.sourceControl.git+" rev-parse --verify HEAD").read()+'"')
+          self.addDefine('VERSION_DATE_GIT','"'+os.popen("cd "+self.dir+" && "+self.sourceControl.git+" log -1 --pretty=format:%ci").read()+'"')
         else:
           self.logPrintBox('\n*****WARNING: PETSC_DIR appears to be a Git clone - but git is not found in PATH********\n')
       elif os.path.exists(os.path.join(self.dir, '.hg')):
           echo "Unknown PETSC_VERSION_RELEASE: $${version_release}"; \
           exit; \
         fi; \
-        datestr=`git log -1 --pretty=format:%ai | cut -d ' ' -f 1`; \
+        datestr=`git log -1 --pretty=format:%ci | cut -d ' ' -f 1`; \
         export datestr; \
         find * -type d -wholename src/docs/website -prune -o -type d -wholename src/benchmarks/results -prune -o \
           -type d -wholename 'arch-*' -prune -o -type d -wholename src/tops -prune -o -type d -wholename externalpackages -prune -o \