java-1.8.0-openjdk/repackReproduciblePolycies.sh

34 lines
671 B
Bash

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