[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle/master] Bug 19528: run get-moz-build-date before removing .git (fixup)



commit 02ff59eaeb1bea0ce00ee0223da9eab0ff69834d
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date:   Wed Sep 14 17:11:38 2016 +0200

    Bug 19528: run get-moz-build-date before removing .git (fixup)
    
    Additionally, we make get-moz-build-date fail with an error if it was not
    possible to get the year from git.
---
 gitian/build-helpers/get-moz-build-date       | 5 +++++
 gitian/descriptors/linux/gitian-firefox.yml   | 3 ++-
 gitian/descriptors/mac/gitian-firefox.yml     | 3 ++-
 gitian/descriptors/windows/gitian-firefox.yml | 3 ++-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/gitian/build-helpers/get-moz-build-date b/gitian/build-helpers/get-moz-build-date
index 168a8c7..3dae232 100755
--- a/gitian/build-helpers/get-moz-build-date
+++ b/gitian/build-helpers/get-moz-build-date
@@ -4,6 +4,11 @@
 use strict;
 
 my ($year) = split('-', `git show -s --format='%ci'`);
+if ($? != 0) {
+    print STDERR "Failed to get year from the git commit\n";
+    print "exit 1\n";
+    exit 1;
+}
 
 die "missing argument" unless @ARGV;
 my $version = $ARGV[0];
diff --git a/gitian/descriptors/linux/gitian-firefox.yml b/gitian/descriptors/linux/gitian-firefox.yml
index 14799d6..79356a9 100644
--- a/gitian/descriptors/linux/gitian-firefox.yml
+++ b/gitian/descriptors/linux/gitian-firefox.yml
@@ -88,12 +88,13 @@ script: |
   mkdir -p $INSTDIR/Debug/Browser/browser/components
 
   cd tor-browser
+  # run get-moz-build-date before removing .git, which is used to get the year
+  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   # .git and the src takes up a lot of useless space, and we need the space to build
   rm -rf .git
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   rm -f configure
   rm -f js/src/configure
-  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL} --enable-bundled-fonts"
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   make $MAKEOPTS -f client.mk build
diff --git a/gitian/descriptors/mac/gitian-firefox.yml b/gitian/descriptors/mac/gitian-firefox.yml
index bd7d7f7..607a04c 100644
--- a/gitian/descriptors/mac/gitian-firefox.yml
+++ b/gitian/descriptors/mac/gitian-firefox.yml
@@ -43,13 +43,14 @@ script: |
   TB_COMMIT_DATE=$(git show -s --format='%ci')
   COPYRIGHT_YEAR=${TB_COMMIT_DATE%%-*}
   mv .mozconfig-mac .mozconfig
+  # run get-moz-build-date before removing .git, which is used to get the year
+  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   # .git and the src takes up a lot of useless space, and we need the space to build
   #git archive HEAD | tar -x -C $OUTDIR/src
   rm -rf .git
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   rm -f configure
   rm -f js/src/configure
-  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL} --enable-bundled-fonts"
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   make $MAKEOPTS -f client.mk build
diff --git a/gitian/descriptors/windows/gitian-firefox.yml b/gitian/descriptors/windows/gitian-firefox.yml
index 788b053..cc7fdeb 100644
--- a/gitian/descriptors/windows/gitian-firefox.yml
+++ b/gitian/descriptors/windows/gitian-firefox.yml
@@ -68,13 +68,14 @@ script: |
   # Our flags don't get passed to NSS. We need to do that manually using an
   # obscure one.
   export DLLFLAGS="-specs=/home/ubuntu/build/msvcr100.spec"
+  # run get-moz-build-date before removing .git, which is used to get the year
+  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   # .git and the src takes up a lot of useless space, and we need the space to build
   #git archive HEAD | tar -x -C $OUTDIR/src
   rm -rf .git
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   rm -f configure
   rm -f js/src/configure
-  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL} --enable-bundled-fonts"
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   #

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits