gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 103818f: developer-build.sh: tarballs and PDFs


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 103818f: developer-build.sh: tarballs and PDFs in separate server directories
Date: Mon, 12 Nov 2018 12:00:11 -0500 (EST)

branch: master
commit 103818f2b94e7a4493dde825edcb0fb05f5412b1
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    developer-build.sh: tarballs and PDFs in separate server directories
    
    Until now, the `developer-build.sh' script would rename the tarball to
    `gnuastro-latest.tar.lz' and upload the tarball and PDF file to the top
    directory of the server. But for archival reasons, it is commonly necessary
    to keep the tarball versions on the server. So with this commit, the
    uploaded tarball will keep its version number and will be put in the `src'
    directory of the server and the script will run SSH after copying the files
    and make a symbolic link to the uploaded tarball that will always point to
    the most recent version.
---
 developer-build   | 46 +++++++++++++++++++++++++++++-----------------
 doc/gnuastro.texi | 14 ++++++++------
 2 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/developer-build b/developer-build
index 220ea47..3253c77 100755
--- a/developer-build
+++ b/developer-build
@@ -154,7 +154,7 @@ Options:
                           libraries.
                           Current status: $debug_status
 
- -v, --valgrind           Build with `--enable-check-with-valgrind'.
+ -v, --valgrind           Build with '--enable-check-with-valgrind'.
                           Current status: $valgrind_status
 
  -j, --jobs INT           Number of threads to use in 'make'.
@@ -316,15 +316,6 @@ fi
 
 
 
-# If reconfiguration was requested, do it.
-if [ $reconf = 1 ]; then
-    autoreconf -f
-fi
-
-
-
-
-
 # Keep the address of this source directory (where this script is being run
 # from) which we will need later.
 srcdir=$(pwd)
@@ -347,7 +338,7 @@ fi
 
 
 
-# Make the build directory in tmpfs (if it doesn't already exist).
+# Make the build directory (if it doesn't already exist).
 if [ ! -d $build_dir ]; then
     mkdir $build_dir
 fi
@@ -356,6 +347,15 @@ fi
 
 
 
+# If reconfiguration was requested, do it.
+if [ $reconf = 1 ]; then
+    autoreconf -f
+fi
+
+
+
+
+
 # Make a symbolic link to the tmpfs build directory for users to easily
 # access the built files and also follow the progress. We are first
 # deleting any existing symbolic link and remaking it since the possible
@@ -448,16 +448,28 @@ fi
 
 # Upload the tarball to the requested server.
 if [ x$upload = x1 ]; then
-
     # Get the base package name, and use it to make a generic tarball
     # name. Note that with the `--upload' option, `--dist' is also
     # activated, so the tarball is already built and ready by this
     # step.
-    base=$(ls *.tar.lz | sed -e's/-/ /' | awk '{print $1}')
-    mv *.tar.lz $base"-latest.tar.lz"
-
-    # Copy the files to the given URL (must include folders).
-    scp $base"-latest.tar.lz" $base.pdf $url
+    tarball=$(ls *.tar.lz)
+    base=$(echo $tarball | sed -e's/-/ /' | awk '{print $1}')
+
+    # File names:
+    pdf=$base.pdf
+    latest=$base"-latest.tar.lz"
+
+    # Copy the files to the subdirectories of the given URL (must include
+    # folders).
+    scp $tarball $url/src
+    scp $pdf     $url/pdf
+
+    # Make the symbolic links on the server.
+    server=$(echo "$url" | sed -e's/:/ /' | awk '{print $1}')
+    sdir=$(echo "$url" | sed -e's/:/ /' | awk '{print $2}')
+    ssh $server 'cd '"$sdir"' && rm -f '$latest' && ln -s src/'$tarball 
$latest ' && exit'
+    echo; echo "On $url:"
+    echo "   $latest -> src/$tarball"
 fi
 
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index fd132ac..cf02a02 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -6857,12 +6857,14 @@ or sending to colleagues who don't use Git for an easy 
build and manual.
 
 @item -u STR
 @item --upload STR
-Activate the @option{--dist} (@option{-D}) option, but also rename the
-tarball suffix to @file{-latest.tar.lz} (instead of the version
-number). Then use secure copy (@command{scp}, part of the SSH tools) to
-copy the tarball and PDF to the server and directory specified in the value
-to this option. For example @command{--upload my-server:dir}, will copy the
-two files to the @file{dir} directory of @code{my-server} server.
+Activate the @option{--dist} (@option{-D}) option, then use secure copy
+(@command{scp}, part of the SSH tools) to copy the tarball and PDF to the
address@hidden and @file{pdf} subdirectories of the specified server and its
+directory (value to this option). For example @command{--upload
+my-server:dir}, will copy the tarball in the @file{dir/src}, and the PDF
+manual in @file{dir/pdf} of @code{my-server} server. It will then make a
+symbolic link in the top server directory to the tarball that is called
address@hidden
 
 @item -p
 @itemx --publish



reply via email to

[Prev in Thread] Current Thread [Next in Thread]