| #!/bin/bash | |
| # rustdatehash: computes a git commit hash for a nightly from a given date. | |
| # Works from about 2015-03-01 | |
| # usage: ./rustdatehash yyyy-mm-dd | |
| set -e | |
| set -u | |
| set -o pipefail | |
| # not using $1 in grep because the date in version string sometimes doesn't match the argument | |
| wget -q -O - https://static.rust-lang.org/dist/$1/rust-nightly-i686-unknown-linux-gnu.tar.gz |\ | |
| gunzip -c |\ | |
| strings -n 10 |\ | |
| grep '([0-9a-z]\{5,\} 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9])' -o |\ | |
| grep '[0-9a-z]\{5,\}*' -o |\ | |
| head -n 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment