Blame SOURCES/repackReproduciblePolycies.sh

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