diff options
| author | bors <bors@rust-lang.org> | 2015-05-14 00:42:32 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-05-14 00:42:32 +0000 |
| commit | e5394240a295650b567aa406b4a0e1e3a6749a5f (patch) | |
| tree | 6dc2325c3039db85303702ef5f68e810be5d065e | |
| parent | 5a341ecfc985c190d8c359a8c995a094ef22ab9e (diff) | |
| parent | 2c0db5e331b2b15633fc9028cf019f6a2fe48a6f (diff) | |
| download | rust-e5394240a295650b567aa406b4a0e1e3a6749a5f.tar.gz rust-e5394240a295650b567aa406b4a0e1e3a6749a5f.zip | |
Auto merge of #25208 - lfairy:version-hash, r=brson
The code takes a prefix of the MD5 hash of the version string. Since the hash command differs across GNU and BSD platforms, we scan for the right one in the configure script. Closes #25007
| -rwxr-xr-x | configure | 18 | ||||
| -rw-r--r-- | mk/main.mk | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/configure b/configure index 9b9de9da067..4e763f76139 100755 --- a/configure +++ b/configure @@ -106,8 +106,8 @@ probe() { T=$(command -v $P 2>&1) if [ $? -eq 0 ] then - VER0=$($P --version 2>/dev/null | head -1 \ - | sed -e 's/[^0-9]*\([vV]\?[0-9.]\+[^ ]*\).*/\1/' ) + VER0=$($P --version 2>/dev/null \ + | grep -o '[vV]\?[0-9][0-9.][a-z0-9.-]*' | head -1 ) if [ $? -eq 0 -a "x${VER0}" != "x" ] then VER="($VER0)" @@ -711,6 +711,20 @@ else probe_need CFG_GIT git fi +# Use `md5sum` on GNU platforms, or `md5 -q` on BSD +probe CFG_MD5 md5 +probe CFG_MD5SUM md5sum +if [ -n "$CFG_MD5" ] +then + CFG_HASH_COMMAND="$CFG_MD5 -q | head -c 8" +elif [ -n "$CFG_MD5SUM" ] +then + CFG_HASH_COMMAND="$CFG_MD5SUM | head -c 8" +else + err 'could not find one of: md5 md5sum' +fi +putvar CFG_HASH_COMMAND + probe CFG_CLANG clang++ probe CFG_CCACHE ccache probe CFG_GCC gcc diff --git a/mk/main.mk b/mk/main.mk index 738580cb5b5..964153e4494 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -20,7 +20,9 @@ CFG_RELEASE_NUM=1.1.0 # versions (section 9) CFG_PRERELEASE_VERSION=.1 -CFG_FILENAME_EXTRA=4e7c5e5c +# Append a version-dependent hash to each library, so we can install different +# versions in the same place +CFG_FILENAME_EXTRA=$(shell printf '%s' $(CFG_RELEASE) | $(CFG_HASH_COMMAND)) ifeq ($(CFG_RELEASE_CHANNEL),stable) # This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly" |
