[sagenb] 168/179: Add a -s option to dist.sh

felix salfelder felix-guest at moszumanska.debian.org
Tue May 6 12:05:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit 76744de68d1e3a249156e305826a9c04c42da7b0
Author: Punarbasu Purkayastha <ppurka at gmail.com>
Date:   Sun Dec 29 19:43:19 2013 +0800

    Add a -s option to dist.sh
    
    This will allow one to repackage sagenb with only the changed
    files in sagenb itself.
    Otherwise, every time dist.sh is run, it redownloads all the
    dependencies all over again. It is waste of time and bandwidth.
    
    With this -s switch, you can avoid redownloading all the
    dependencies while packaging sagenb.
---
 dist.sh | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/dist.sh b/dist.sh
index 312a4ca..e0d9639 100755
--- a/dist.sh
+++ b/dist.sh
@@ -4,18 +4,20 @@
 # with Sage. For more complete instructions on how to generate a new
 # SPKG, read the SPKG.txt file in the current SPKG.
 #
-# Usage: dist.sh [-g]
+# Usage: dist.sh [-g] [-s]
 #
 #   -g      Also package the git repository
+#   -s      Only package the sagenb repository
 
 die () {
     echo >&2 "$@"
     exit 1
 }
 
-while getopts ":g" opt; do
+while getopts ":gs" opt; do
     case $opt in
         g) INSTALL_REPO=1 ;;
+        s) SAGENB_ONLY=1 ;;
         *) die "Invalid option!"
     esac
 done
@@ -27,11 +29,21 @@ if [ -n "$INSTALL_REPO" ]; then
         die "Uncommitted changes in sagenb - please commit, stash, or discard"
 fi
 
-rm -rf dist
-mkdir -p dist
+if [ -n "$SAGENB_ONLY" ]; then
+    if [ -d dist ]; then
+        rm -f dist/sagenb-*.tar.gz
+    else
+        mkdir -p dist
+    fi
+else
+    rm -rf dist
+    mkdir -p dist
+fi
 
-echo "Fetching source tarballs of (sub)dependencies of sagenb to dist/"
-python util/fetch_deps.py dist || die "Couldn't fetch all (sub)dependencies"
+if [ -z "$SAGENB_ONLY" ]; then
+    echo "Fetching source tarballs of (sub)dependencies of sagenb to dist/"
+    python util/fetch_deps.py dist || die "Couldn't fetch all (sub)dependencies"
+fi
 
 echo "Creating source tarball of sagenb itself in dist/"
 python setup.py sdist > sdist.log || die "Couldn't make sagenb source tarball"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list