diff --git a/mksnap.sh b/mksnap.sh index b5e9aeeecd80367b602120afefd1738200eecc81..8a0612c3da7d002d34398629f22580f74831c153 100755 --- a/mksnap.sh +++ b/mksnap.sh @@ -20,22 +20,48 @@ if test -z "${SSH_AGENT_PID}" -o -z "${SSH_AUTH_SOCK}"; then exit 1 fi -trap "chmod -$ u+rwX ${MYTMPDIR} ; rm -rf ${MYTMPDIR}" 0 +trap "chmod -R u+rwX ${MYTMPDIR} ; rm -rf ${MYTMPDIR}" 0 + mkdir -p "${MYTMPDIR}" cd "${MYTMPDIR}" svn co ${SVNREPOS}/${ALBERTADIST} albertadist cd albertadist +# own revision +HEADREV=`svn info|grep "Last Changed Rev" |awk '{ print $4; }'` +LASTREV=`{ ls -C1 --color=no ${SNAPSHOTDIR}/*.gz || true; }|tail -n 1|cut -d '-' -f 3|cut -d '.' -f 1` +if test -n "${LASTREV}"; then + # figure out if anything has changed. + for i in . alberta alberta_util demo add_ons doc; do + ( + cd $i + svn diff -r ${LASTREV} > ${MYTMPDIR}/svn.diff + if test -s ${MYTMPDIR}/svn.diff; then + CHANGED=true + fi + ) + if test "z${CHANGED}" = ztrue; then + break; + fi + done + if ! test "z${CHANGED}" = ztrue; then + # nothing changed, do not prepare a new snapshot + exit 0 + fi +fi # # attach the time-stamp to the package # -sed -i -e 's/AC_INIT([alberta2],[^,]\+,/AC_INIT([alberta2],['"${DATE}"'],/g' configure.ac +VERSTAMP="${DATE}-${HEADREV}" +sed -i -e 's/AC_INIT(\[alberta2\], [^,]\+,/AC_INIT([alberta2], ['"${VERSTAMP}"'],/g' configure.ac ./fromsvnreconf.sh -./configure +./configure --enable-maintainer-mode make distcheck -if test -f "alberta2-${DATE}.tar.bz2" -a -f "alberta2-${DATE}.tar.gz"; then +if test -f "alberta2-${VERSTAMP}.tar.bz2" -a \ + -f "alberta2-${VERSTAMP}.tar.gz"; then mkdir -p ${SNAPSHOTDIR} || true - cp alberta2-${DATE}.tar.bz2 geomview-${DATE}.tar.gz ${SNAPSHOTDIR} - rm -f `ls --color=no -C1 ${SNAPSHOTDIR}/*.gz|head -n -${NSNAPSHOTS}` + cp alberta2-${VERSTAMP}.tar.bz2 alberta2-${VERSTAMP}.tar.gz ${SNAPSHOTDIR} + rm -f `ls --color=no -C1 ${SNAPSHOTDIR}/*.tar.gz|head -n -${NSNAPSHOTS}` + rm -f `ls --color=no -C1 ${SNAPSHOTDIR}/*.tar.bz2|head -n -${NSNAPSHOTS}` chmod -R a+rX ${SNAPSHOTDIR} fi