4 include /usr
/share
/dpkg
/pkg-info.mk
5 include /usr
/share
/dpkg
/vendor.mk
6 include /usr
/share
/dpkg
/architecture.mk
7 SED_VERSION_SHORT
:= sed
-re
's/([^.]+)\.([^.]+)\..*/\1.\2/'
8 RUST_VERSION
:= $(shell echo
'$(DEB_VERSION_UPSTREAM)' |
$(SED_VERSION_SHORT
))
9 RUST_LONG_VERSION
:= $(shell echo
'$(DEB_VERSION_UPSTREAM)' | sed
-re
's/([^+]+).*/\1/')
10 LIBSTD_PKG
:= libstd-rust-
$(RUST_VERSION
)
11 # Sed expression that matches the "rustc" we have in our Build-Depends field
12 SED_RUSTC_BUILDDEP
:= sed
-ne
"/^Build-Depends:/,/^[^[:space:]\#]/{/^ *rustc:native .*,/p}" debian
/control
13 # Version of /usr/bin/rustc
14 LOCAL_RUST_VERSION
:= $(shell rustc
--version
--verbose | sed
-ne
's/^release: //p')
16 include /usr
/share
/dpkg
/buildflags.mk
17 # TODO: more correct to use `[build] rustflags = []` list syntax in Cargo.toml
18 RUSTFLAGS
= $(addprefix -C link-args
=,$(LDFLAGS
))
19 RUSTFLAGS
+= --cap-lints warn
--remap-path-prefix
=$(CURDIR
)=/usr
/src
/rustc-
$(RUST_LONG_VERSION
)
20 export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS RUSTFLAGS
21 export CARGO_HOME
= $(CURDIR
)/debian
/cargo
22 ifneq (,$(filter $(DEB_BUILD_ARCH
), sparc64
))
23 export CARGO_INCREMENTAL
= 0
26 # Defines DEB_*_RUST_TYPE triples
27 include debian
/architecture.mk
28 export DEB_HOST_RUST_TYPE
30 # Uncomment this to turn on verbose mode.
33 DEB_DESTDIR
:= $(CURDIR
)/debian
/tmp
35 # Use system LLVM (comment out to use vendored LLVM)
38 # Make it easier to test against a custom LLVM
39 ifneq (,$(LLVM_DESTDIR
))
40 LLVM_LIBRARY_PATH
:= $(LLVM_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
):$(LLVM_DESTDIR
)/usr
/lib
41 LD_LIBRARY_PATH
:= $(if
$(LD_LIBRARY_PATH
),$(LD_LIBRARY_PATH
):$(LLVM_LIBRARY_PATH
),$(LLVM_LIBRARY_PATH
))
42 export LD_LIBRARY_PATH
45 RUSTBUILD
= RUST_BACKTRACE
=1 python3 src
/bootstrap
/bootstrap.py
46 RUSTBUILD_FLAGS
= --config debian
/config.toml
-vvv
--on-fail env
47 # TODO: This should simply be "$(RUSTBUILD) test" but unfortunately this causes
48 # an insane blow up in the time it takes to run tests. See upstream #37477 for
49 # details. Upstream worked around it in #38984 but in Debian we can't take
50 # advantage of that work-around, because we want as much debuginfo as possible
51 # (so we set debuginfo-lines = true, debuginfo-only-std = false) so we have to
52 # work around it instead by disabling backtrace when running tests.
53 RUSTBUILD_TEST
= python3 src
/bootstrap
/bootstrap.py
test
54 # To run a specific test, run something like:
55 # $ debian/rules override_dh_auto_test-arch \
56 # RUSTBUILD_TEST_FLAGS="src/test/run-make --test-args extern-fn-struct"
57 # See src/bootstrap/README.md for more options.
58 RUSTBUILD_TEST_FLAGS
=
61 oldver
=$(shell $(SED_RUSTC_BUILDDEP
) | sed
-ne
's/.*(<= \(.*\)).*/\1/gp' |
$(SED_VERSION_SHORT
)); \
62 newver
=$(RUST_VERSION
); \
63 debian
/update-version.sh
$$oldver $$newver $(RUST_LONG_VERSION
) $(CARGO_NEW
)
65 # Below we detect how we're supposed to bootstrap the stage0 compiler. See
66 # README.Debian for more details of the cases described below.
68 PRECONFIGURE_CHECK
= :
69 HAVE_BINARY_TARBALL
:= $(shell ls
-1 stage0
/*/*$(DEB_HOST_RUST_TYPE
)* 2>/dev
/null | wc
-l
)
70 DOWNLOAD_BOOTSTRAP
:= false
71 # allow not using the binary tarball although it exists
72 #ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf i386 powerpc ppc64el s390x))
73 # HAVE_BINARY_TARBALL := 0
75 ifeq (0,$(HAVE_BINARY_TARBALL
))
76 # Case A (Building from source): the extracted source tree does not include
77 # a bootstrapping tarball for the current architecture e.g. because the
78 # distro already has a rustc for this arch, or the uploader expects that
79 # this requirement be fulfilled in some other way.
81 # Case A-1: the builder did not select the "pkg.rustc.dlstage0" build profile.
82 # In this case, we use the distro's rustc - either the previous or current version.
83 ifeq (,$(findstring pkg.rustc.dlstage0
,$(DEB_BUILD_PROFILES
)))
84 # Make it easier to test against a custom rustc
85 ifneq (,$(RUST_DESTDIR
))
86 RUST_LIBRARY_PATH
:= $(RUST_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
):$(RUST_DESTDIR
)/usr
/lib
87 LD_LIBRARY_PATH
:= $(if
$(LD_LIBRARY_PATH
),$(LD_LIBRARY_PATH
):$(RUST_LIBRARY_PATH
),$(RUST_LIBRARY_PATH
))
88 export LD_LIBRARY_PATH
91 # Case A-2: the builder selected the "dlstage0" build profile.
92 # In this case, the rust build scripts will download a stage0 into stage0/ and use that.
93 # We don't need to do anything specific in this build file, so this case is empty.
95 DOWNLOAD_BOOTSTRAP
:= true
98 # Case B (Bootstrapping a new distro): the extracted source tree does
99 # include a bootstrapping tarball for the current architecture; see the
100 # `source_orig-stage0` target below on how to build this.
102 # In this case, we'll bootstrap from the stage0 given in that tarball.
103 # To ensure the uploader of the .dsc didn't make a mistake, we first check
104 # that rustc isn't a Build-Depends for the current architecture.
105 ifneq (,$(shell $(SED_RUSTC_BUILDDEP
)))
106 ifeq (,$(shell $(SED_RUSTC_BUILDDEP
) | grep
'!$(DEB_HOST_ARCH)'))
107 PRECONFIGURE_CHECK
= $(error found matches for stage0
/*/*$(DEB_HOST_RUST_TYPE
)*, \
108 but rustc might be a Build-Depends for
$(DEB_HOST_ARCH
))
114 ifneq (,$(findstring nodoc
,$(DEB_BUILD_PROFILES
)))
118 MAKE_OPTIMISATIONS
:= true
119 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
120 MAKE_OPTIMISATIONS
:= false
123 # Build products or non-source files in src/, that shouldn't go in rust-src
124 SRC_CLEAN
= src
/bootstrap
/bootstrap.pyc \
127 # Workaround for linux #865549
128 ifeq (0,$(shell test $$(uname
-s
) = "Linux" -a
$$(getconf PAGESIZE
) -gt
4096; echo
$$?
))
129 SYSTEM_WORKAROUNDS
+= ulimit
-s
$$(expr
$$(getconf PAGESIZE
) / 1024 '*' 256 + 8192);
131 # Try to work around #933045
132 ifneq (,$(filter $(DEB_BUILD_ARCH
), mips mipsel
))
133 SYSTEM_WORKAROUNDS
+= export MALLOC_ARENA_MAX
=1;
137 $(SYSTEM_WORKAROUNDS
) dh
$@
--parallel
141 $(SYSTEM_WORKAROUNDS
) dh
$@
--parallel
144 # Upstream contains a lot of these
145 dh_clean
-XCargo.toml.orig
147 debian
/config.toml
: debian
/config.toml.in debian
/rules
148 u
="$(DEB_VERSION_UPSTREAM)"; \
149 if
[ "$$u" != "$${u%~beta.*+dfsg*}" ]; then channel
="beta"; \
150 else channel
="stable"; fi
; echo
$$channel; \
151 m4
-DRELEASE_CHANNEL
="$$channel" \
152 -DDEB_BUILD_RUST_TYPE
="$(DEB_BUILD_RUST_TYPE)" \
153 -DDEB_HOST_RUST_TYPE
="$(DEB_HOST_RUST_TYPE)" \
154 -DDEB_TARGET_RUST_TYPE
="$(DEB_TARGET_RUST_TYPE)" \
155 -DDEB_BUILD_GNU_TYPE
="$(DEB_BUILD_GNU_TYPE)" \
156 -DDEB_HOST_GNU_TYPE
="$(DEB_HOST_GNU_TYPE)" \
157 -DDEB_TARGET_GNU_TYPE
="$(DEB_TARGET_GNU_TYPE)" \
158 -DMAKE_OPTIMISATIONS
="$(MAKE_OPTIMISATIONS)" \
159 -DLLVM_DESTDIR
="$(LLVM_DESTDIR)" \
160 -DLLVM_VERSION
="$(LLVM_VERSION)" \
161 -DRUST_DESTDIR
="$(RUST_DESTDIR)" \
163 if
$(DOWNLOAD_BOOTSTRAP
) ||
[ $(HAVE_BINARY_TARBALL
) != 0 ]; \
164 then sed
-i
-e
'/^rustc = /d' -e
'/^cargo = /d' "$@"; fi
165 # Work around low-memory (32-bit) architectures: https://github.com/rust-lang/rust/issues/45854
166 #ifneq (,$(filter $(DEB_BUILD_ARCH), armhf armel mips mipsel powerpc powerpcspe))
167 sed
-i
-e
's/^debuginfo-level = .*/debuginfo-level = 0/g' "$@"
170 debian
/rust-src.
%: debian
/rust-src.
%.in
171 m4
-DRUST_LONG_VERSION
="$(RUST_LONG_VERSION)" \
174 debian
/dh_auto_configure.stamp
: debian
/config.toml
175 # fail the build if we have any instances of OLD_LLVM_VERSION in debian, except for debian/changelog
176 ! grep
--color
=always
-i
'll\(..\|d\)-\?$(subst .,\.,$(OLD_LLVM_VERSION))' --exclude
=changelog
--exclude
='*.patch' -R debian
177 # fail the build if we accidentally vendored openssl, indicates we pulled in unnecessary dependencies
178 test ! -e vendor
/openssl
179 # fail the build if we didn't update d-ignore-error-detail-diff.patch
180 ! grep
-Ri
'\$SRC_DIR' src
/test/
181 # fail the build if our version contains ~exp and we are not releasing to experimental
182 v
="$(DEB_VERSION)"; test "$$v" = "$${v%~exp*}" -o
"$(DEB_DISTRIBUTION)" = "experimental" -o
"$(DEB_DISTRIBUTION)" = "UNRELEASED"
183 $(PRECONFIGURE_CHECK
)
184 if
[ -d stage0
]; then mkdir
-p build
&& ln
-sfT ..
/stage0 build
/cache
; fi
185 # work around #842634
186 if
test $$(grep
"127.0.0.1\s*localhost" /etc
/hosts | wc
-l
) -gt
1; then \
187 debian
/ensure-patch
-N debian
/patches
/d-host-duplicates.patch
; fi
188 # We patched some crates so have to rm the checksums
189 find vendor
-name .cargo-checksum.json
-execdir
"$(CURDIR)/debian/prune-checksums" "{}" ";"
190 # Link against system liblzma, see https://github.com/alexcrichton/xz2-rs/issues/16
191 echo
'fn main() { println!("cargo:rustc-link-lib=lzma"); }' > vendor
/lzma-sys
/build.rs
192 # We don't run ./configure because we use debian/config.toml directly
193 ln
-sf debian
/config.toml config.toml
196 override_dh_auto_configure-arch
: debian
/dh_auto_configure.stamp
197 override_dh_auto_configure-indep
: debian
/dh_auto_configure.stamp
198 ifeq (true
,$(BUILD_DOCS
))
199 # Change config.toml now and not later, since that might trigger a rebuild
200 sed
-i
-e
's/^docs = false/docs = true/' debian
/config.toml
203 override_dh_auto_clean
:
204 $(RM
) -rf build tmp .cargo debian
/cargo_home config.stamp config.mk Makefile
205 $(RM
) -rf
$(TEST_LOG
) debian
/config.toml debian
/rust-src.
install debian
/rust-src.links debian
/*.stamp
206 $(RM
) -rf
$(SRC_CLEAN
) config.toml
208 debian
/dh_auto_build.stamp
:
209 $(RUSTBUILD
) build
$(RUSTBUILD_FLAGS
)
211 override_dh_auto_build-arch
: debian
/dh_auto_build.stamp
212 override_dh_auto_build-indep
: debian
/dh_auto_build.stamp
213 $(RUSTBUILD
) build
$(RUSTBUILD_FLAGS
) --host
$(DEB_BUILD_RUST_TYPE
) --target wasm32-unknown-unknown src
/libstd
214 ifeq (true
,$(BUILD_DOCS
))
215 $(RUSTBUILD
) doc
$(RUSTBUILD_FLAGS
)
218 TEST_LOG
= debian
/rustc-tests.log
219 # This is advertised as "5 tests failed" in README.Debian because our counting
220 # method is imprecise and in practise we count some failures twice.
222 ifneq (,$(filter $(DEB_BUILD_ARCH
), ppc64 arm64 mips64el i386
))
223 FAILURES_ALLOWED
= 12
225 ifneq (,$(filter $(DEB_BUILD_ARCH
), mips mipsel s390x
))
226 FAILURES_ALLOWED
= 24
228 ifneq (,$(filter $(DEB_BUILD_ARCH
), powerpc powerpcspe sparc64 x32
))
229 FAILURES_ALLOWED
= 180
231 FAILED_TESTS
= grep
"FAILED\|^command did not execute successfully" $(TEST_LOG
) | grep
-v
'^test result: FAILED'
232 override_dh_auto_test-arch
:
233 # ensure that rustc_llvm is actually dynamically linked to libLLVM
234 set
-e
; find build
/*/stage2
/lib
/rustlib
/* -name
'*rustc_llvm*.so' | \
236 stat
-c
'%s %n' "$$x"; \
237 objdump
-p
"$$x" | grep
-q
"NEEDED.*LLVM"; \
238 test "$$(stat -c %s "$$x")" -lt
6000000; \
240 ifeq (, $(filter nocheck
,$(DEB_BUILD_PROFILES
)))
241 ifeq (, $(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
242 { $(RUSTBUILD_TEST
) --no-fail-fast
$(RUSTBUILD_FLAGS
) $(RUSTBUILD_TEST_FLAGS
); echo
$$?
; } | tee
-a
$(TEST_LOG
)
243 # test that the log has at least 1 pass, to prevent e.g. #57709
244 grep
-l
"^test .* \.\.\. ok$$" $(TEST_LOG
)
245 echo
"==== Debian rustc test report ===="; \
246 echo
"Specific test failures:"; \
248 num_failures
=$$($(FAILED_TESTS
) | wc
-l
); \
249 exit_code
=$$(tail
-n1
$(TEST_LOG
)); \
250 echo
"Summary: exit code $$exit_code, counted $$num_failures tests failed."; \
251 echo
-n
"$(FAILURES_ALLOWED) maximum allowed. "; \
252 if
test "$$num_failures" -eq
0 -a
"$$exit_code" -ne
0; then \
253 echo
"Aborting just in case, because we missed counting some test failures."; \
254 echo
"This could happen if we failed to build the tests, or if the testsuite runner is buggy."; \
256 elif
test "$$num_failures" -le
$(FAILURES_ALLOWED
); then \
257 echo
"Continuing..."; \
259 echo
"Aborting the build."; \
260 echo
"Check the logs further above for details."; \
263 # don't continue if RUSTBUILD_TEST_FLAGS is non-empty
264 test -z
"$(RUSTBUILD_TEST_FLAGS)"
268 override_dh_auto_test-indep
:
269 ifeq (, $(filter nocheck
,$(DEB_BUILD_PROFILES
)))
270 ifeq (, $(filter nocheck
,$(DEB_BUILD_OPTIONS
)))
271 # TODO: test wasm32-unknown-unknown but it doesn't yet work
272 ifeq (true
,$(BUILD_DOCS
))
273 # Run all rules that test the docs, i.e. in step.rs that depend on default:doc
274 $(RUSTBUILD_TEST
) --no-fail-fast src
/tools
/linkchecker
$(RUSTBUILD_FLAGS
)
276 test -z
"$(RUSTBUILD_TEST_FLAGS)"
281 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) $(X_CMD
) $(RUSTBUILD_FLAGS
) $(X_FLAGS
)
283 debian
/dh_auto_install.stamp
:
284 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) install $(RUSTBUILD_FLAGS
)
286 mkdir
-p
$(DEB_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
)/
287 mv
$(DEB_DESTDIR
)/usr
/lib
/lib
*.so
$(DEB_DESTDIR
)/usr
/lib
/$(DEB_HOST_MULTIARCH
)/
289 # Replace duplicated compile-time/run-time dylibs with symlinks
291 for f in
$(DEB_DESTDIR
)/usr
/lib
/rustlib
/$(DEB_HOST_RUST_TYPE
)/lib
/lib
*.so
; do \
293 if
[ -f
"$(DEB_DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/$$name" ]; then \
294 echo
"ln -sf ../../../$(DEB_HOST_MULTIARCH)/$$name $$f"; \
295 ln
-sf ..
/..
/..
/$(DEB_HOST_MULTIARCH
)/$$name $$f; \
301 override_dh_auto_install-arch
: debian
/dh_auto_install.stamp
302 override_dh_auto_install-indep
: debian
/dh_auto_install.stamp
303 DESTDIR
=$(DEB_DESTDIR
) $(RUSTBUILD
) install $(RUSTBUILD_FLAGS
) --host
$(DEB_BUILD_RUST_TYPE
) --target wasm32-unknown-unknown src
/libstd
304 ifeq (true
,$(BUILD_DOCS
))
305 # Brute force to remove privacy-breach-logo lintian warning.
306 # We could have updated the upstream sources but it would complexify
309 find
$(DEB_DESTDIR
)/usr
/share
/doc
/*/html
-iname
'*.html' | \
310 while read file
; do \
311 topdir
=$$(echo
"$$file" | sed
's,^$(DEB_DESTDIR)/usr/share/doc/rust/html/,,; s,/[^/]*$$,/,; s,^[^/]*$$,,; s,[^/]\+/,../,g'); \
313 -e
"s,https://\(doc\|www\).rust-lang.org/\(favicon.ico\|logos/rust-logo-32x32-blk.png\),$${topdir}rust-logo-32x32-blk.png," \
314 -e
's,<img src="https://img.shields.io/[^"]*" alt="\([^"]*\)" />,<span class="deb-privacy-replace--shields-io">\1</span>,g' "$$file"; \
316 find
$(DEB_DESTDIR
) \
( -iname
'*.html' -empty
-o
-name .lock
-o
-name
'*.inc' \
) -delete
;
319 override_dh_install-arch
:
321 dh_install
-p
$(LIBSTD_PKG
) usr
/lib
/$(DEB_HOST_MULTIARCH
)/
322 dh_install
-plibstd-rust-dev usr
/lib
/rustlib
/$(DEB_HOST_RUST_TYPE
)/lib
/
323 dh_install
-prustc usr
/lib
/rustlib
/$(DEB_HOST_RUST_TYPE
)/codegen-backends
/
325 override_dh_install-indep
: debian
/rust-src.
install debian
/rust-src.links
327 dh_install
-plibstd-rust-dev-wasm32-cross usr
/lib
/rustlib
/wasm32-
*/lib
/
329 debian
/rust-gdb
/usr
/share
/rust-gdb
/*.py \
330 debian
/rust-lldb
/usr
/share
/rust-lldb
/*.py
331 $(RM
) -rf
$(SRC_CLEAN
:%=debian
/rust-src
/usr
/src
/rustc-
$(RUST_LONG_VERSION
)/%)
332 # Get rid of lintian warnings
333 find debian
/rust-src
/usr
/src
/rustc-
$(RUST_LONG_VERSION
) \
334 \
( -name .gitignore \
335 -o
-name
'LICENSE*' \
338 -o
-name
'COPYING*' \
340 # Remove files that autoload remote resources, caught by lintian
341 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/cssparser
/docs
/*.html
342 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/kuchiki
/docs
/*.html
343 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/url
/docs
/*.html
344 $(RM
) -rf debian
/rust-src
/usr
/src
/rustc-
*/vendor
/xz2
/.gitmodules
346 override_dh_installchangelogs
:
347 dh_installchangelogs RELEASES.md
349 override_dh_installdocs
:
350 dh_installdocs
-X.
tex -X.aux
-X.log
-X.out
-X.toc
353 dh_missing
--list-missing
355 override_dh_compress
:
359 # Work around #35733, #468333
360 find debian
/libstd-rust-dev
*/ -name
'*.rlib' -execdir mv
'{}' '{}.a' \
;
361 # This is expected to print out lots of "File format unrecognized" warnings about
362 # rust.metadata.bin and *.deflate but the .o files inside the rlibs should be stripped
363 # Some files are still omitted because of #875780 however.
365 find debian
/libstd-rust-dev
*/ -name
'*.rlib.a' -execdir sh
-c
'mv "$$1" "$${1%.a}"' - '{}' \
;
367 override_dh_makeshlibs
:
370 # dh_makeshlibs doesn't support our "libfoo-version.so" naming
371 # structure, so we have to do this ourselves.
372 install -o
0 -g
0 -d debian
/$(LIBSTD_PKG
)/DEBIAN
373 LC_ALL
=C ls debian
/$(LIBSTD_PKG
)/usr
/lib
/$(DEB_HOST_MULTIARCH
)/lib
*.so | \
374 sed
-n
's,^.*/\(lib.*\)-\(.\+\)\.so$$,\1 \2,p' | \
375 while read name version
; do \
376 echo
"$$name $$version $(LIBSTD_PKG) (>= $(DEB_VERSION_UPSTREAM))"; \
377 done
> debian
/$(LIBSTD_PKG
)/DEBIAN
/shlibs
378 chmod
644 debian
/$(LIBSTD_PKG
)/DEBIAN
/shlibs
379 chown
0:0 debian
/$(LIBSTD_PKG
)/DEBIAN
/shlibs
381 override_dh_shlibdeps
:
382 dh_shlibdeps
-- -x
$(LIBSTD_PKG
)
384 QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE
= x
=$$?
; if
[ $$x = 2 ]; then exit
0; else exit
$$x; fi
386 QUILT_PATCHES
=debian
/patches quilt push
-aq
; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE
)
387 $(MAKE
) -f debian
/rules
clean
388 debian
/make_orig-stage0_tarball.sh
389 QUILT_PATCHES
=debian
/patches quilt pop
-aq
; $(QUILT_SPECIAL_SNOWFLAKE_RETURN_CODE
)
393 u
="$(DEB_VERSION_UPSTREAM)"; \
394 if
[ "$$u" != "$${u%~beta.*+dfsg*}" ]; then \
395 newver
=$(shell echo
$(RUST_VERSION
) | perl
-lpe
's/(\d+)\.(\d+)/$$1 . "." . ($$2)/e'); \
397 newver
=$(shell echo
$(RUST_VERSION
) | perl
-lpe
's/(\d+)\.(\d+)/$$1 . "." . ($$2+1)/e'); \
400 debian
/watch-beta
: debian
/watch-beta.in debian
/rules
401 set
-e
; $(get_beta_version
); \
402 m4
-DOLDVER
="$$oldver" -DNEWVER
="$$newver.0" "$<" > "$@"
404 source_orig-beta
: debian
/watch-beta
405 uscan
$(USCAN_OPTS
) $(if
$(USCAN_DESTDIR
),--destdir
=$(USCAN_DESTDIR
),) --verbose
--watchfile
"$<"
406 set
-e
; $(get_beta_version
); \
407 bd
="$(if $(USCAN_DESTDIR),$(USCAN_DESTDIR),..)"; \
408 tar xf
$$bd/rustc-
$$newver.0-beta
.999-src.
tar.xz rustc-beta-src
/version
; \
409 bv
="$$(sed -re 's/[0-9]+.[0-9]+.[0-9]+-beta.([0-9]+) \(.*\)/\1/g' rustc-beta-src/version)"; \
410 bash
-c
'shopt -s nullglob; for i in '"$$bd"'/rustc*beta.999*; do mv $$i $${i/beta.999/beta.'"$$bv"'}; done'; \
411 rm -f rustc-beta-src
/version
; \
412 rmdir
-p rustc-beta-src
; \
413 echo
"prepared rustc $$newver.0~beta.$$bv in $$bd"