diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2006-01-04 17:38:38 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2006-01-04 17:38:38 (GMT) |
commit | 9e0620daf9af69043c3ec383251c55edf471e03c (patch) | |
tree | db2117db20696bad832182aa63bed325e69405c7 /bin | |
parent | 17b4201476fea72d5a2b2ef0354f1b22e64d36ca (diff) | |
download | hdf5-9e0620daf9af69043c3ec383251c55edf471e03c.zip hdf5-9e0620daf9af69043c3ec383251c55edf471e03c.tar.gz hdf5-9e0620daf9af69043c3ec383251c55edf471e03c.tar.bz2 |
[svn-r11862] Purpose:
Bug fix.
Description:
release created temporary files in .. directory. If the -d directory
is the same as the parent directory, it would fail when it tried to
copy the temporary files to the destination directory.
Solution:
Changed release to create a temporary directory and create all temporary
files in that temporary directory.
Platforms tested:
Handtested in heping.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/release | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/bin/release b/bin/release index d4c5a35..d361078 100755 --- a/bin/release +++ b/bin/release @@ -108,6 +108,7 @@ verbose=yes check=yes today=`date +%Y%m%d` pmode='no' +tmpdir="../#release_tmp.$$" # tmp work directory # Restore previous Version information RESTORE_VERSION() @@ -155,6 +156,15 @@ if [ "X$methods" = "X" ]; then methods="tar md5" fi +# Create the temporay work directory. +if mkdir $tmpdir; then + echo "temporary work directory for release. "\ + "Can be deleted after release completes." > $tmpdir/READEME +else + echo "Failed to mkdir tmpdir($tmpdir)" + exit 1 +fi + # setup restoration in case of abort. trap RESTORE_VERSION 0 @@ -176,7 +186,6 @@ if [ ! -d $DEST ]; then exit 1 fi - # Check the validity of the MANIFEST file. bin/chkmanifest || fail=yes if [ "X$fail" = "Xyes" ]; then @@ -188,13 +197,12 @@ if [ "X$fail" = "Xyes" ]; then fi # Create a manifest that contains only files for distribution. -MANIFEST=/tmp/H5_MANIFEST.$$ +MANIFEST=$tmpdir/H5_MANIFEST grep '^\.' MANIFEST | grep -v _DO_NOT_DISTRIBUTE_ >$MANIFEST # Prepare the source tree for a release. -test -h ../$HDF5_VERS && rm ../$HDF5_VERS -ln -s `pwd` ../$HDF5_VERS || exit 1 -mv Makefile ../Makefile.x 2>/dev/null #might fail +ln -s `pwd` $tmpdir/$HDF5_VERS || exit 1 +mv Makefile $tmpdir/Makefile.x 2>/dev/null #might fail cp -p Makefile.dist Makefile # Update README.txt and release_docs/RELEASE.txt with release information. @@ -212,7 +220,7 @@ cp release_docs/HISTORY.txt release_docs/RELEASE.txt doc/html/ADGuide/. # Create the tar file test "$verbose" && echo " Running tar..." 1>&2 ( \ - cd ..; \ + cd $tmpdir; \ tar cf $HDF5_VERS.tar $HDF5_VERS/Makefile \ `sed 's/^\.\//hdf5-'$VERS'\//' $MANIFEST` || exit 1 \ ) @@ -221,32 +229,35 @@ test "$verbose" && echo " Running tar..." 1>&2 for comp in $methods; do case $comp in tar) - cp -p ../$HDF5_VERS.tar $DEST/$HDF5_VERS.tar;; + cp -p $tmpdir/$HDF5_VERS.tar $DEST/$HDF5_VERS.tar + ;; compress) test "$verbose" && echo " Running compress..." 1>&2 - compress -c <../$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.Z;; + compress -c <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.Z + ;; gzip) test "$verbose" && echo " Running gzip..." 1>&2 - gzip -9 <../$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz;; + gzip -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.gz + ;; bzip2) test "$verbose" && echo " Running bzip2..." 1>&2 - bzip2 -9 <../$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2;; + bzip2 -9 <$tmpdir/$HDF5_VERS.tar >$DEST/$HDF5_VERS.tar.bz2 + ;; md5) test "$verbose" && echo " Creating checksum..." 1>&2 - ( cd .. && md5sum $HDF5_VERS.tar >$HDF5_VERS.tar.md5 ) - cp -p ../$HDF5_VERS.tar.md5 $DEST/$HDF5_VERS.tar.md5;; + (cd $tmpdir; md5sum $HDF5_VERS.tar ) > $DEST/$HDF5_VERS.tar.md5 + ;; esac done # Copy the RELEASE.txt to the release area. cp release_docs/RELEASE.txt $DEST/$HDF5_VERS-RELEASE.txt +# Restore previous Makefile if existed. +test -f $tmpdir/Makefile.x && mv $tmpdir/Makefile.x Makefile + # Remove temporary things -test -f ../Makefile.x && mv ../Makefile.x Makefile -rm -f $MANIFEST -rm -f ../$HDF5_VERS -rm -f ../$HDF5_VERS.tar -rm -f ../$HDF5_VERS.tar.md5 +rm -rf $tmpdir # Restore OLD version information, then no need for trap. if [ X$pmode = Xyes ]; then |