Commit 0577db33 authored by Mike Perry's avatar Mike Perry
Browse files

Make a deterministic tar wrapper and improve the zip wrappers.

Resulting file permissions inside the archive seem to vary arbitrarily between
build machines, even though we set umask. What's up with that?
parent b99768d3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
#!/bin/sh
# Crappy deterministic tar wrapper
export LC_ALL=C

TARFILE=$1
shift

find $@ -executable -exec chmod 700 {} \;
find $@ ! -executable -exec chmod 600 {} \;

tar --no-recursion -Jcvf $TARFILE `find $@ | sort`
+3 −0
Original line number Diff line number Diff line
@@ -5,4 +5,7 @@ export LC_ALL=C
ZIPFILE=$1
shift

find $@ -executable -exec chmod 700 {} \;
find $@ ! -executable -exec chmod 600 {} \;

find $@ | sort | zip $ZIPOPTS -X -@ $ZIPFILE
+2 −2
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@ ZIPFILE=`basename $1`
mkdir tmp_dzip
cd tmp_dzip
unzip ../$1
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find . -executable -exec chmod 700 {} \;
find . ! -executable -exec chmod 600 {} \;
find . | sort | zip $ZIPOPTS -X -@ $ZIPFILE
mv $ZIPFILE ../$1
cd ..
+5 −8
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ files:
- "noscript@noscript.net.xpi"
- "uriloader@pdf.js.xpi"
- "dzip.sh"
- "dtar.sh"
- "bare-version"
- "bundle.inputs"
- "versions"
@@ -56,24 +57,20 @@ script: |
  cd tor-launcher
  make clean
  make package
  # FIXME: Switch to re-dzip.sh here?
  mkdir pkg/tmp
  cd pkg/tmp
  unzip ../*.xpi
  # FIXME: is there a better way to fix these input umask permissions??
  find . -type f -exec chmod 644 {} \;
  find . -type d -exec chmod 755 {} \;
  ~/build/dzip.sh ../../../tor-browser/Data/profile/extensions/tor-launcher@torproject.org.xpi .
  cd ../../../
  #
  cd torbutton
  mkdir -p pkg
  ./makexpi.sh
  # FIXME: Switch to re-dzip.sh here?
  mkdir pkg/tmp
  cd pkg/tmp
  unzip ../*.xpi
  # FIXME: is there a better way to fix these input umask permissions??
  find . -type f -exec chmod 644 {} \;
  find . -type d -exec chmod 755 {} \;
  ~/build/dzip.sh ../../../tor-browser/Data/profile/extensions/torbutton@torproject.org.xpi .
  cd ../../../
  #
@@ -114,7 +111,7 @@ script: |
  cd ../../../
  #7z a -sfx tor-browser.exe tor-browser_en-US
  #mv tor-browser.exe $OUTDIR/tor-browser-linux${GBUILD_BITS}_en-US.7z-selfextract
  tar --no-recursion -Jcvf $OUTDIR/tor-browser-linux${GBUILD_BITS}-${TORBROWSER_VERSION}_en-US.tar.xz `find tor-browser_en-US | sort`
  ~/build/dtar.sh $OUTDIR/tor-browser-linux${GBUILD_BITS}-${TORBROWSER_VERSION}_en-US.tar.xz tor-browser_en-US
  rm -rf tor-browser_en-US
  #
  unzip linux-langpacks.zip
@@ -135,7 +132,7 @@ script: |

    #7z a -sfx tor-browser.exe tor-browser_$LANG
    #mv tor-browser.exe $OUTDIR/tor-browser-linux${GBUILD_BITS}_$LANG.7z-selfextract
    tar --no-recursion -Jcvf $OUTDIR/tor-browser-linux${GBUILD_BITS}-${TORBROWSER_VERSION}_$LANG.tar.xz `find tor-browser_$LANG | sort`
    ~/build/dtar.sh $OUTDIR/tor-browser-linux${GBUILD_BITS}-${TORBROWSER_VERSION}_$LANG.tar.xz tor-browser_$LANG

    rm -rf tor-browser_$LANG
    cd linux-langpacks
+2 −6
Original line number Diff line number Diff line
@@ -51,13 +51,11 @@ script: |
  cd tor-launcher
  make clean
  make package
  # FIXME: Switch to re-dzip.sh here?
  mkdir pkg/tmp
  cd pkg/tmp
  unzip ../*.xpi
  rm ../*.xpi
  # FIXME: is there a better way to fix these input umask permissions??
  find . -type f -exec chmod 644 {} \;
  find . -type d -exec chmod 755 {} \;
  ~/build/dzip.sh ../tor-launcher@torproject.org.xpi .
  mv ../tor-launcher@torproject.org.xpi ../../../TorBrowserBundle.app/Library/"Application Support"/Firefox/Profiles/profile/extensions/tor-launcher@torproject.org.xpi
  cd ../../../
@@ -65,13 +63,11 @@ script: |
  cd torbutton
  mkdir -p pkg
  ./makexpi.sh
  # FIXME: Switch to re-dzip.sh here?
  mkdir pkg/tmp
  cd pkg/tmp
  unzip ../*.xpi
  rm ../*.xpi
  # FIXME: is there a better way to fix these input umask permissions??
  find . -type f -exec chmod 644 {} \;
  find . -type d -exec chmod 755 {} \;
  ~/build/dzip.sh ../torbutton@torproject.org.xpi .
  mv ../torbutton@torproject.org.xpi ../../../TorBrowserBundle.app/Library/"Application Support"/Firefox/Profiles/profile/extensions/torbutton@torproject.org.xpi
  cd ../../../
Loading