Blame SOURCES/repackReproduciblePolycies.sh

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