Blame SOURCES/repackReproduciblePolycies.sh

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