From ef183144add2b92359a9ade2ec0b28681b26956b Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Wed, 29 Nov 2017 21:28:44 +0000 Subject: [PATCH] Add date to dependency and source zips for snapshots * 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 | 22 +++++++++++----- admin/nt/dist-build/build-zips.sh | 37 +++++++++++++++++++-------- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/admin/nt/dist-build/build-dep-zips.py b/admin/nt/dist-build/build-dep-zips.py index f71988692c1..6ec8fafaf8b 100755 --- a/admin/nt/dist-build/build-dep-zips.py +++ b/admin/nt/dist-build/build-dep-zips.py @@ -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 ): diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh index 2c7b56866ff..5822d821a1c 100755 --- a/admin/nt/dist-build/build-zips.sh +++ b/admin/nt/dist-build/build-zips.sh @@ -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 ]; -- 2.39.5