Blame SPECS/repackReproduciblePolycies.sh

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