]> git.proxmox.com Git - dh-cargo.git/commitdiff
Add the version of rustc to *Built-Using d/control fields
authorXimin Luo <infinity0@debian.org>
Fri, 16 Aug 2019 01:14:16 +0000 (18:14 -0700)
committerXimin Luo <infinity0@debian.org>
Fri, 16 Aug 2019 01:14:16 +0000 (18:14 -0700)
debian/changelog
dh-cargo-built-using

index f7c37fb2a0896f6c83a09976618925123bcacb3e..ba9625e06fa5a24358866e5abe32a62bce9bd185 100644 (file)
@@ -1,6 +1,7 @@
 dh-cargo (20) UNRELEASED; urgency=medium
 
   * Remove Cargo.lock since this prevents us from upgrading stuff.
+  * Add the version of rustc to *Built-Using d/control fields.
 
  -- Ximin Luo <infinity0@debian.org>  Thu, 15 Aug 2019 18:01:15 -0700
 
index cff501fd7ec1be7f7f3567b40580cfd78c57b573..1c0a691db15ac37ba2672f6f1f5e2d399054adac 100755 (executable)
@@ -31,12 +31,8 @@ pkg_has_srcleft_license() {
        fi
 }
 
-rust_libs() {
-       cat "$CARGO_TARGET_DIR/deps"/*.d \
-       | sed -nre 's   ^\S*/('"$CARGO_REGISTRY"'/[^/]*)/.*     '"$(readlink -f "$PWD")/"'\1    gp' \
-       | sort -u \
-       | xargs -r readlink -f \
-       | xargs -r dpkg -S \
+dep_files_to_pkgs() {
+       xargs -r dpkg -S \
        | sed -nre 's   (.*): .*        \1      gp' \
        | xargs -r dpkg-query --show \
        | while read pkg ver; do echo "$pkg $ver $(pkg_has_srcleft_license "${pkg%:*}" "$ver")"; done
@@ -44,6 +40,17 @@ rust_libs() {
        # this is due to nature of crate copyright info, and the debian rust packaging policy
 }
 
+rust_dep_files() {
+       cat "$CARGO_TARGET_DIR/deps"/*.d \
+       | sed -nre 's   ^\S*/('"$CARGO_REGISTRY"'/[^/]*)/.*     '"$(readlink -f "$PWD")/"'\1    gp' \
+       | sort -u \
+       | xargs -r readlink -f
+}
+
+rust_libs() {
+       { which rustc; rust_dep_files; } | dep_files_to_pkgs
+}
+
 gcc_default_searchdirs() {
        gcc -print-search-dirs \
        | sed -nre 's   ^libraries: (.*)        \1      gp' \