* lrde-upload.sh:
- Prune old tarballs.
- Append the current date to the tarball name.
---
ChangeLog | 8 ++++++++
lrde-upload.sh | 21 +++++++++++++--------
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3f42f1d..756268e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2009-07-08 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Improve lrde-upload.sh script.
+
+ * lrde-upload.sh:
+ - Prune old tarballs.
+ - Append the current date to the tarball name.
+
+2009-07-08 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
* lrde-upload.sh: New script to upload tarballs after a successful
compilation.
diff --git a/lrde-upload.sh b/lrde-upload.sh
index 82f9749..b6730f3 100755
--- a/lrde-upload.sh
+++ b/lrde-upload.sh
@@ -7,11 +7,13 @@ set -e
set -x
-DEST=/lrde/dload/olena/snapshot/
+DEST=/lrde/dload/olena/snapshots/
DEST_DOC=$DEST/doc/milena/
# Retrieve the package version
-VERSION=`autoconf --trace='AC_INIT' | cut -d ':' -f 5`
+VERSION=`autoconf --trace='AC_INIT:$2'`
+CURRENT_DATE=`date +'%d_%m_%y'`
+REV=$VERSION-$CURRENT_DATE
# Always do "cp then mv" when uploading the file, so that someone
# cannot start a download why the destination file is incomplete.
@@ -19,15 +21,18 @@ VERSION=`autoconf --trace='AC_INIT' | cut -d ':' -f
5`
# Upload the tarball
mkdir -p $DEST
+# Delete tarballs older than 2 days..
+find $DEST -maxdepth 1 -type f -mtime +2 -exec rm -f {} \;
+
# tar.gz
-cp -f olena-$VERSION.tar.gz $DEST/olena-$rev.tar.gz.tmp
-mv -f $DEST/olena-$rev.tar.gz.tmp $DEST/olena-$rev.tar.gz
-chmod -R a+r $DEST/olena-$rev.tar.gz
+cp -f olena-$VERSION.tar.gz $DEST/olena-$REV.tar.gz.tmp
+mv -f $DEST/olena-$REV.tar.gz.tmp $DEST/olena-$REV.tar.gz
+chmod -R a+r $DEST/olena-$REV.tar.gz
# tar.bz2
-cp -f olena-$VERSION.tar.bz2 $DEST/olena-$rev.tar.bz2.tmp
-mv -f $DEST/olena-$rev.tar.bz2.tmp $DEST/olena-$rev.tar.bz2
-chmod -R a+r $DEST/olena-$rev.tar.bz2
+cp -f olena-$VERSION.tar.bz2 $DEST/olena-$REV.tar.bz2.tmp
+mv -f $DEST/olena-$REV.tar.bz2.tmp $DEST/olena-$REV.tar.bz2
+chmod -R a+r $DEST/olena-$REV.tar.bz2
# Upload a copy of the reference manual and other documentation.
--
1.5.6.5