]> git.eshelyaron.com Git - emacs.git/commitdiff
Add date to dependency and source zips for snapshots
authorPhillip Lord <phillip.lord@russet.org.uk>
Wed, 29 Nov 2017 21:28:44 +0000 (21:28 +0000)
committerPhillip Lord <phillip.lord@russet.org.uk>
Thu, 30 Nov 2017 22:59:39 +0000 (22:59 +0000)
* admin/nt/dist-build/build-zips.sh,
  admin/nt/dist-build/build-dep-zips.py: Support snapshot naming

admin/nt/dist-build/build-dep-zips.py
admin/nt/dist-build/build-zips.sh

index f71988692c12527354069884b3ae804de029679c..6ec8fafaf8bd5ceb61e38f7f142b78e027bbc85c 100755 (executable)
@@ -103,8 +103,8 @@ def gather_deps(deps, arch, directory):
     ## And package them up
     os.chdir(directory)
     print("Zipping: {}".format(arch))
-    check_output_maybe("zip -9r ../../emacs-{}-{}-deps.zip *"
-                       .format(EMACS_MAJOR_VERSION, arch),
+    check_output_maybe("zip -9r ../../emacs-{}-{}{}-deps.zip *"
+                       .format(EMACS_MAJOR_VERSION, DATE, arch),
                        shell=True)
     os.chdir("../../")
 
@@ -168,8 +168,8 @@ def gather_source(deps):
     p.map(download_source,to_download)
 
     print("Zipping")
-    check_output_maybe("zip -9 ../emacs-{}-deps-mingw-w64-src.zip *"
-                       .format(EMACS_MAJOR_VERSION),
+    check_output_maybe("zip -9 ../emacs-{}-{}deps-mingw-w64-src.zip *"
+                       .format(EMACS_MAJOR_VERSION,DATE),
                        shell=True)
 
     os.chdir("..")
@@ -189,13 +189,16 @@ if(os.environ["MSYSTEM"] != "MSYS"):
 
 
 parser = argparse.ArgumentParser()
+parser.add_argument("-s", help="snapshot build",
+                    action="store_true")
+
 parser.add_argument("-t", help="32 bit deps only",
                     action="store_true")
 
 parser.add_argument("-f", help="64 bit deps only",
                     action="store_true")
 
-parser.add_argument("-s", help="source code only",
+parser.add_argument("-r", help="source code only",
                     action="store_true")
 
 parser.add_argument("-c", help="clean only",
@@ -205,19 +208,24 @@ parser.add_argument("-d", help="dry run",
                     action="store_true")
 
 args = parser.parse_args()
-do_all=not (args.c or args.s or args.f or args.t)
+do_all=not (args.c or args.r or args.f or args.t)
 
 deps=extract_deps()
 
 DRY_RUN=args.d
 
+if args.s:
+    DATE="{}-".format(check_output(["date", "+%Y-%m-%d"]).decode("utf-8").strip())
+else:
+    DATE=""
+
 if( do_all or args.t ):
     gather_deps(deps,"i686","mingw32")
 
 if( do_all or args.f ):
     gather_deps(deps,"x86_64","mingw64")
 
-if( do_all or args.s ):
+if( do_all or args.r ):
     gather_source(deps)
 
 if( args.c ):
index 2c7b56866ff5e9750eedf219152c09b56da43a88..5822d821a1cb85bf3207a5de649fcfc655f8728a 100755 (executable)
@@ -19,7 +19,7 @@
 
 
 function git_up {
-    echo Making git worktree for Emacs $VERSION
+    echo [build] Making git worktree for Emacs $VERSION
     cd $HOME/emacs-build/git/emacs-$MAJOR_VERSION
     git pull
     git worktree add ../$BRANCH $BRANCH
@@ -34,7 +34,7 @@ function build_zip {
     PKG=$2
     HOST=$3
 
-    echo Building Emacs-$VERSION for $ARCH
+    echo [build] Building Emacs-$VERSION for $ARCH
     if [ $ARCH == "i686" ]
     then
         PATH=/mingw32/bin:$PATH
@@ -52,11 +52,12 @@ function build_zip {
     ## time that is not always needed
     if (($CONFIG))
     then
-    ../../../git/$BRANCH/configure \
-        --without-dbus \
-        --host=$HOST --without-compress-install \
-        $CACHE \
-        CFLAGS="-O2 -static -g3"
+        echo [build] Configuring Emacs $ARCH
+        ../../../git/$BRANCH/configure \
+            --without-dbus \
+            --host=$HOST --without-compress-install \
+            $CACHE \
+            CFLAGS="-O2 -static -g3"
     fi
 
     make -j 16 install \
@@ -66,7 +67,18 @@ function build_zip {
     zip -r -9 emacs-$OF_VERSION-$ARCH-no-deps.zip *
     mv emacs-$OF_VERSION-$ARCH-no-deps.zip $HOME/emacs-upload
     rm bin/libXpm-noX4.dll
-    unzip $HOME/emacs-build/deps/emacs-$MAJOR_VERSION-$ARCH-deps.zip
+
+    if [ -z $SNAPSHOT ];
+    then
+        DEPS_FILE=$HOME/emacs-build/deps/emacs-$MAJOR_VERSION-$ARCH-deps.zip
+    else
+        ## Pick the most recent snapshot whatever that is
+        DEPS_FILE=`ls $HOME/emacs-build/deps/emacs-$MAJOR_VERSION-*-$ARCH-deps.zip | tail -n 1`
+    fi
+
+    echo [build] Using $DEPS_FILE
+    unzip $DEPS_FILE
+
     zip -r -9 emacs-$OF_VERSION-$ARCH.zip *
     mv emacs-$OF_VERSION-$ARCH.zip ~/emacs-upload
 }
@@ -74,7 +86,7 @@ function build_zip {
 function build_installer {
     ARCH=$1
     cd $HOME/emacs-build/install/emacs-$VERSION
-    echo Calling makensis in `pwd`
+    echo [build] Calling makensis in `pwd`
     cp ../../git/$BRANCH/admin/nt/dist-build/emacs.nsi .
 
     makensis -v4 \
@@ -148,14 +160,19 @@ fi
 
 if [ -z $VERSION ];
 then
-    echo Cannot determine Emacs version
+    echo [build] Cannot determine Emacs version
     exit 1
 fi
 
 MAJOR_VERSION="$(echo $VERSION | cut -d'.' -f1)"
 
+## ACTUAL VERSION is the version declared by emacs
 ACTUAL_VERSION=$VERSION
+
+## VERSION includes the word snapshot if necessary
 VERSION=$VERSION$SNAPSHOT
+
+## OF version includes the date if we have a snapshot
 OF_VERSION=$VERSION
 
 if [ -z $SNAPSHOT ];