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