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