gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 45f7252: High-level options for the developer-


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 45f7252: High-level options for the developer-build script
Date: Tue, 5 Jun 2018 10:54:22 -0400 (EDT)

branch: master
commit 45f725234e63cbfb4d05bed135fd1ff00bfdcc27
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    High-level options for the developer-build script
    
    Some extra options for steps that are usually necessary were added to the
    `developer-build' script: `--autoreconf' and `--dist'. Also, two high-level
    options (`--publish' and `--install-archive') were defined so we don't have
    to list all the separate steps on every call. Finally, with the new
    `--dist' option, the old `--tar_pdf_upload' option is now just called
    `--upload'.
---
 developer-build   | 111 ++++++++++++++++++++++++++++++++++++++++++++++--------
 doc/gnuastro.texi |  52 +++++++++++++++++++++----
 2 files changed, 139 insertions(+), 24 deletions(-)

diff --git a/developer-build b/developer-build
index 0b917d9..4594194 100755
--- a/developer-build
+++ b/developer-build
@@ -37,11 +37,13 @@ set -e
 
 # Default values for variables.
 jobs=8
+dist=0
 debug=0
 clean=0
 check=0
+reconf=0
+upload=0
 install=0
-tar_pdf_upload=0
 top_build_dir=/dev/shm
 if [ -f .version ]; then
     version=$(cat .version)
@@ -57,6 +59,13 @@ fi
 me=$0                           # Executable file name.
 help_print() {
 
+    # See if autoreconf is enabled or not.
+    if [ $reconf = "0" ]; then
+        reconf_status="DISABLED"
+    else
+        reconf_status="ENABLED"
+    fi
+
     # See if debug is enabled or not.
     if [ $debug = "0" ]; then
         debug_status="DISABLED"
@@ -85,11 +94,18 @@ help_print() {
         install_status="ENABLED"
     fi
 
-    # See if tar_pdf_upload is enabled or not.
-    if [ $tar_pdf_upload = "0" ]; then
-        tpu_status="DISABLED"
+    # See dist is enabled or not.
+    if [ $dist = "0" ]; then
+        dist_status="DISABLED"
+    else
+        dist_status="ENABLED"
+    fi
+
+    # See if upload is enabled or not.
+    if [ $upload = "0" ]; then
+        upload_status="DISABLED"
     else
-        tpu_status="ENABLED"
+        upload_status="ENABLED"
     fi
 
     # Print the output.
@@ -117,6 +133,10 @@ Options:
                           build directory name.
                           Current value: $version
 
+ -a, --autoreconf         Run 'autoreconf -f' (to set the version and
+                          update the build system) before anything else.
+                          Current status: $reconf_status
+
  -c, --clean              Delete (with 'rm') all its contents of the build
                           directory before starting new configuration.
                           Current status: $clean_status
@@ -135,10 +155,19 @@ Options:
  -i, --install            Run 'sudo make install' after the build.
                           Current status: $install_status
 
- -u, --tar-pdf-upload STR Build a tar.lz tarball and PDF manual, then
-                          upload them to the given server:folder.
+ -D, --dist               Build a tar.lz tarball and PDF manual.
+                          Current status: $dist_status
+
+ -u, --upload STR         First run '--dist', then upload tarball and PDF
+                          manual to the given 'server:folder'.
                           For example: -u my-server:folder
-                          Current status: $tpu_status
+                          Current status: $upload_status
+
+ -p, --publish STR        Short for '-a -c -d -C -u STR'. '-d' is added
+                          because it will greatly speed up the build. It
+                          will have no effect on the produced tarball.
+
+ -I, --install-archive    Short for '-a -c -C -i -D'.
 
  -P, --printparams        Another name for '--help', for similarity with
                           Gnuastro's programs. Note that the output of
@@ -177,6 +206,10 @@ do
             echo $version
             exit 0
             ;;
+        -a|--autoreconf)
+            reconf=1
+            shift # past argument
+            ;;
         -c|--clean)
             clean=1
             shift # past argument
@@ -202,16 +235,44 @@ do
             install=1
             shift # past argument
             ;;
-        -u|--tar-pdf-upload)
-            tar_pdf_upload=1
+        -D|--dist)
+            dist=1
+            shift # past argument
+            ;;
+        -u|--upload)
+            dist=1
+            upload=1
+            url="$2"
+            if [ x"$url" = x ]; then
+                echo "No argument given to '--upload' ('-u')."
+                exit 1;
+            fi
+            shift # past argument
+            shift # past value
+            ;;
+        -p|--publish)
+            dist=1
+            clean=1
+            debug=1
+            check=1
+            reconf=1
+            upload=1
             url="$2"
             if [ x"$url" = x ]; then
-                echo "No argument given to '--tar-pdf-upload' ('-u')."
+                echo "No argument given to '--publish' ('-u')."
                 exit 1;
             fi
             shift # past argument
             shift # past value
             ;;
+        -I|--install-archive)
+            dist=1
+            clean=1
+            check=1
+            reconf=1
+            install=1
+            shift # past argument
+            ;;
         -h|-P|--help|--printparams)
             help_print
             exit 0
@@ -240,6 +301,15 @@ 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)
@@ -363,13 +433,22 @@ fi
 
 
 
-# Build a tarball, and upload it to the requested server.
-if [ x$tar_pdf_upload = x1 ]; then
-
-    # Make the distribution tarball and pdf manual.
+# Make the tarball and PDF for distribution.
+if [ x$dist = x1 ]; then
     make dist-lzip pdf
+fi
+
+
+
+
+
+# Build a tarball, and upload it to the requested server.
+if [ x$upload = x1 ]; then
 
-    # Get the base package name, and use it to make a generic tarball name.
+    # 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"
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 6412382..fed24ef 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -6171,6 +6171,13 @@ GNU/Linux operating systems, see @ref{Configure and 
build in RAM}).
 Print the version string of Gnuastro that will be used in the build. This
 string will be appended to the directory name containing the built files.
 
address@hidden -a
address@hidden --autoreconf
+Run @command{autoreconf -f} before building the package. In Gnuastro, this
+is necessary when a new commit has been made to the project history. In
+Gnuastro's build system, the Git description will be used as the version,
+see @ref{Version numbering} and @ref{Synchronizing}.
+
 @item -c
 @itemx --clean
 @cindex GNU Autoreconf
@@ -6216,15 +6223,44 @@ checks to work on (for example defined in 
@file{tests/during-dev.sh}).
 @itemx --install
 After finishing the build, also run @command{make install}.
 
address@hidden -D
address@hidden --dist
+Run @code{make dist-lzip pdf} to build a distribution tarball (in
address@hidden format) and a PDF manual. This can be useful for archiving,
+or sending to colleagues who don't use Git for an easy build and manual.
+
 @item -u STR
address@hidden --tar-pdf-upload STR
-After finishing the build, run @command{make dist-lzip pdf} to build an
-Lzip tarball and pdf manual. Then rename the tarball suffix to
address@hidden (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
address@hidden my-server:dir}, will copy the two files to the
address@hidden directory of @code{my-server}.
address@hidden --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.
+
address@hidden -p
address@hidden --publish
+Short for @option{--autoreconf --clean --debug --check --upload
+STR}. @option{--debug} is added because it will greatly speed up the
+build. It will have no effect on the produced tarball. This is good when
+you have made a commit and are ready to publish it on your server (if
+nothing crashes). Recall that if any of the previous steps fail the script
+aborts.
+
address@hidden -I
address@hidden --install-archive
+Short for @option{--autoreconf --clean --check --install --dist}. This is
+useful when you actually want to install the commit you just made (if the
+build and checks succeed). It will also produce a distribution tarball and
+PDF manual for easy access to the installed tarball on your system at a
+later time.
+
+Ideally, Gnuastro's Git version history makes it easy for a prepared system
+to revert back to a different point in history. But Gnuastro also needs to
+bootstrap files and also your collaborators might (usually do!) find it too
+much of a burden to do the bootstrapping themselves. So it is convenient to
+have a tarball and PDF manual of the version you have installed (and are
+using in your reserach) handily available.
 
 @item -h
 @itemx --help



reply via email to

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