LockedPtr const-conversion constructor and assignment operator
[hiphop-php.git] / third-party / update-first-party.sh
blobab686c225020faa37a7d9880adb2e44fb6076b35
1 #!/bin/sh
2 # Update the pinned versions of first-party dependencies
4 # It is likely that patches will need updating - see README.md
5 set -e
6 OLD="$1"
7 NEW="$2"
9 if [ -z "$1" ] || [ -z "$2" ]; then
10 echo "Usage: $0 OLD NEW"
11 echo " OLD and NEW should be of the form YYYY.MM.DD.xx (usually 00)"
12 exit 0
15 sed -i.orig -e "s/$OLD/$NEW/g" -- */CMakeLists.txt
17 egrep --only-matching "https://github.com/.+$NEW.+\.gz" -- */CMakeLists.txt | \
18 while read -r MATCH; do
19 CMAKE_FILE="${MATCH%%:*}"
20 URL="${MATCH#*:}"
22 FILE="$(mktemp)"
23 wget -O "$FILE" "$URL"
24 HASH="$(openssl dgst -sha256 "$FILE" | awk '{print $NF}')"
25 rm "$FILE"
26 sed -i.orig -e 's/SHA[0-9]*=[0-9a-z]*/SHA256='"$HASH/" "$CMAKE_FILE"
27 done