mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 01:20:40 +00:00
4b27d28701
This comes from: svn diff ^/nixpkgs/trunk/@18255 ^/nixpkgs/branches/stdenv-updates/ > diff patch -p0 < diff and then adding into svn all files new from the patch. trunk@18255 comes from the last time I updated stdenv-updates from trunk. svn path=/nixpkgs/stdenv-updates2/; revision=18272
48 lines
1.3 KiB
Bash
48 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
# Update patch set for GNU Bash or Readline.
|
|
|
|
if [ $# -ne 2 ]
|
|
then
|
|
echo "Usage: $(basename $0) PROJECT VERSION"
|
|
echo ""
|
|
echo "Update the patch set for PROJECT (one of \`bash' or \`readline') for"
|
|
echo "the given version (e.g., \`4.0'). Produce \`PROJECT-patches.nix'."
|
|
exit 1
|
|
fi
|
|
|
|
PROJECT="$1"
|
|
VERSION="$2"
|
|
VERSION_CONDENSED="$(echo $VERSION | sed -es/\\.//g)"
|
|
|
|
GPG="$(if $(type -P gpg2 > /dev/null); then echo gpg2; else echo gpg; fi)"
|
|
PATCH_LIST="$PROJECT-patches.nix"
|
|
|
|
set -e
|
|
|
|
start=1
|
|
end=100 # must be > 99 for correct padding
|
|
|
|
rm -vf "$PATCH_LIST"
|
|
|
|
( echo "# Automatically generated by \`$(basename $0)'; do not edit." ; \
|
|
echo "" ; \
|
|
echo "patch: [" ) \
|
|
>> "$PATCH_LIST"
|
|
|
|
for i in `seq -w $start $end`
|
|
do
|
|
wget ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i || break
|
|
wget ftp.gnu.org/gnu/$PROJECT/$PROJECT-$VERSION-patches/$PROJECT$VERSION_CONDENSED-$i.sig
|
|
"$GPG" --verify $PROJECT$VERSION_CONDENSED-$i.sig
|
|
echo "(patch \"$i\" \"$(nix-hash --flat --type sha256 --base32 $PROJECT$VERSION_CONDENSED-$i)\")" \
|
|
>> "$PATCH_LIST"
|
|
|
|
rm -f $PROJECT$VERSION_CONDENSED-$i{,.sig}
|
|
done
|
|
|
|
echo "]" >> "$PATCH_LIST"
|
|
|
|
echo "Got $(expr $i - 1) patches."
|
|
echo "Patch list has been written to \`$PATCH_LIST'."
|