Blame SOURCES/repackReproduciblePolycies.sh

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