Blame SOURCES/repackReproduciblePolycies.sh

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