Blame repackReproduciblePolycies.sh

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