DEB_DESTDIR := $(CURDIR)/debian/tmp
-RUST_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | sed -re 's/([^.]+)\.([^.]+)\..*/\1.\2/')
+SED_VERSION_SHORT := sed -re 's/([^.]+)\.([^.]+)\..*/\1.\2/'
+RUST_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | $(SED_VERSION_SHORT))
RUST_LONG_VERSION := $(shell echo '$(DEB_VERSION_UPSTREAM)' | sed -re 's/([^+]+).*/\1/')
LIBSTD_PKG := libstd-rust-$(RUST_VERSION)
+# Sed expression that matches the "rustc" we have in our Build-Depends field
+SED_RUSTC_BUILDDEP := sed -ne "/^Build-Depends:/,/^[^[:space:]\#]/{/^ *rustc .*,/p}" debian/control
# These are the normal build flags. Upstream is moving to debian/config.toml
# but at the current version not all of these flags are available in that file.
RUSTBUILD = ./x.py
RUSTBUILD_FLAGS = --config debian/config.toml -v
+update-version:
+ oldver=$(shell $(SED_RUSTC_BUILDDEP) | sed -ne 's/.*(<= \(.*\)).*/\1/gp' | $(SED_VERSION_SHORT)); \
+ newver=$(RUST_VERSION); \
+ if [ $$oldver != $$newver ]; then debian/update-version.sh $$oldver $$newver; fi
+
# Below we detect how we're supposed to bootstrap the stage0 compiler. See
# README.Debian for more details of the cases described below.
#
-# Sed expression that matches the "rustc" we have in our Build-Depends field
-SED_RUSTC_BUILDDEP := /^Build-Depends:/,/^[^[:space:]\#]/{/\s*rustc.*,/$$action}
PRECONFIGURE_CHECK = :
HAVE_BINARY_TARBALL := $(shell ls -1 dl/*$(DEB_HOST_RUST_TYPE)* 2>/dev/null | wc -l)
# allow not using the binary tarball although it exists
# In this case, we'll bootstrap from the stage0 given in that tarball.
# To ensure the uploader of the .dsc didn't make a mistake, we first check
# that rustc isn't a Build-Depends for the current architecture.
- ifneq (,$(shell action=p; sed -ne "$(SED_RUSTC_BUILDDEP)" debian/control))
- ifeq (,$(shell action=p; sed -ne "$(SED_RUSTC_BUILDDEP)" debian/control | grep '!$(DEB_HOST_ARCH)'))
+ ifneq (,$(shell $(SED_RUSTC_BUILDDEP)))
+ ifeq (,$(shell $(SED_RUSTC_BUILDDEP) | grep '!$(DEB_HOST_ARCH)'))
PRECONFIGURE_CHECK = $(error found matches for dl/*$(DEB_HOST_RUST_TYPE)*, \
but rustc might be a Build-Depends for $(DEB_HOST_ARCH))
endif
#!/bin/bash
+# Don't run this directly, use "debian/rules update-version" instead
+
prev_stable() {
local V=$1
python -c 'import sys; k=map(int,sys.argv[1].split(".")); k[1]-=1; print ".".join(map(str,k))' "$V"
ORIG_R="${ORIG/./\\.}" # match a literal dot, otherwise this might sometimes match e.g. debhelper (>= 9.20141010)
sed -i -e "s|libstd-rust-${ORIG_R}|libstd-rust-$NEW|g" \
- -e "s|rustc (<= ${ORIG_R}|rustc (<= $NEW|g" \
- -e "s|rustc (>= ${ORIG_M1/./\\.}|rustc (>= ${NEW_M1}|g" control
+ -e "s|rustc\( *\)(<= ${ORIG_R}|rustc\1(<= $NEW|g" \
+ -e "s|rustc\( *\)(>= ${ORIG_M1/./\\.}|rustc\1(>= ${NEW_M1}|g" control
git mv libstd-rust-$ORIG.lintian-overrides libstd-rust-$NEW.lintian-overrides
sed -i -e "s|libstd-rust-${ORIG_R}|libstd-rust-$NEW|g" libstd-rust-$NEW.lintian-overrides
}
-update 1.16 1.17
+cd $(dirname "$0")
+update "$1" "$2"