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