Blame SOURCES/repackReproduciblePolycies.sh

4ca1da
#!/bin/sh
4ca1da
set -e
4ca1da
# https://bugzilla.redhat.com/show_bug.cgi?id=1142153
4ca1da
M=META-INF/MANIFEST.MF
4ca1da
#P=/usr/lib/jvm/java/jre/lib/security/policy
4ca1da
P=$1/lib/security/policy
4ca1da
ERRORS=0
4ca1da
  for type in unlimited limited ; do
4ca1da
for f in local_policy.jar US_export_policy.jar ; do
4ca1da
ORIG=$P/$type/$f
4ca1da
echo "processing $f ($ORIG)"
4ca1da
if [ ! -f  $ORIG ]; then
4ca1da
  echo "File not found! $ORIG"
4ca1da
  let ERRORS=$ERRORS+1
4ca1da
  continue
4ca1da
fi
4ca1da
d=`mktemp -d`
4ca1da
NW=$d/$f
4ca1da
  pushd $d
4ca1da
    jar  xf   $ORIG
4ca1da
    cat $M
4ca1da
#    sed -i "s/Created-By.*/Created-By: 1.7.0/g"  $M
4ca1da
    sed -i "s/Created-By.*/Created-By: $2/g"  $M
4ca1da
    cat $M
4ca1da
    find . -exec touch -t 201401010000 {} +
4ca1da
    zip -rX  $f *
4ca1da
  popd
4ca1da
  echo "replacing  $ORIG"
4ca1da
  touch -t 201401010000 $ORIG
4ca1da
  md5sum    $ORIG
4ca1da
  sha256sum $ORIG
4ca1da
  echo "by $NW"
4ca1da
  md5sum    $NW
4ca1da
  sha256sum $NW
4ca1da
  touch -t 201401010000 $NW
4ca1da
  cp $NW $ORIG
4ca1da
  md5sum    $ORIG
4ca1da
  sha256sum $ORIG
4ca1da
  touch -t 201401010000 $ORIG
4ca1da
  rm -rfv $d
4ca1da
done
4ca1da
  done
4ca1da
4ca1da
exit $ERRORS