]> git.proxmox.com Git - rustc.git/commitdiff
Update d/copyright, put prune-checksums back so we can bootstrap w/o cargo
authorXimin Luo <infinity0@debian.org>
Mon, 16 Oct 2017 15:20:18 +0000 (17:20 +0200)
committerXimin Luo <infinity0@debian.org>
Mon, 16 Oct 2017 15:20:18 +0000 (17:20 +0200)
debian/copyright
debian/prune-checksums [new file with mode: 0755]
debian/rules

index 2248b2cfface2db072c3b7a65c7c3fba03c0f4f5..1c0c3525556ffa741c33914bdf797789d588b9ac 100644 (file)
@@ -115,7 +115,7 @@ Files-Excluded:
  src/vendor/ws2_32-sys
 # DO NOT EDIT above, AUTOGENERATED
 
-# Use /usr/share/cargo/scripts/guess-crate-copyright to help update this quickly
+# Use /usr/share/cargo/guess-crate-copyright to help update this quickly
 
 Files: C*.md
        R*.md
@@ -281,6 +281,11 @@ Comment: see upstream projects,
  * https://github.com/BurntSushi/rust-memchr
  * https://github.com/BurntSushi/utf8-ranges
 
+Files: src/vendor/ar/*
+Copyright: 2017 Matthew D. Steele <mdsteele@alum.mit.edu>
+License: MIT
+Comment: see https://github.com/mdsteele/rust-ar
+
 Files: src/vendor/atty/*
 Copyright: 2015-2017 softprops <d.tangren@gmail.com>
 License: Expat
@@ -303,11 +308,16 @@ Comment: see https://github.com/utkarshkukreti/diff.rs
 
 Files: src/vendor/dtoa/*
        src/vendor/itoa/*
+       src/vendor/quote/*
+       src/vendor/syn/*
+       src/vendor/synom/*
 Copyright: 2016-2017 David Tolnay <dtolnay@gmail.com>
 License: Expat or Apache-2.0
 Comment:
  see https://github.com/dtolnay/dtoa
  see https://github.com/dtolnay/itoa
+ see https://github.com/dtolnay/quote
+ see https://github.com/dtolnay/syn
 
 Files: src/vendor/error-chain-0*
 Copyright: 2016-2017 Brian Anderson <banderson@mozilla.com>
@@ -388,6 +398,13 @@ Comment:
  see https://github.com/serde-rs/serde
  see https://github.com/serde-rs/json
 
+Files: src/vendor/serde_derive/*
+       src/vendor/serde_derive_internals/*
+Copyright: 2014-2017 Erick Tryzelaar <erick.tryzelaar@gmail.com>
+           2016-2017 David Tolnay <dtolnay@gmail.com>
+License: Expat or Apache-2.0
+Comment: see https://github.com/serde-rs/serde
+
 Files: src/vendor/stable_deref_trait/*
 Copyright: 2017-2017 Robert Grosse <n210241048576@gmail.com>
 License: Expat or Apache-2.0
@@ -405,7 +422,7 @@ License: Expat or Apache-2.0
 Comment: see https://github.com/kbknapp/term_size-rs.git
 
 Files: src/vendor/textwrap/*
-Copyright: 20XX-2017 Martin Geisler <martin@geisler.net>
+Copyright: 2016-2017 Martin Geisler <martin@geisler.net>
 License: Expat
 Comment: see https://github.com/mgeisler/textwrap
 
@@ -422,6 +439,12 @@ Comment:
  see https://github.com/unicode-rs/unicode-segmentation
  see https://github.com/unicode-rs/unicode-width
 
+Files: src/vendor/unicode-xid/*
+Copyright: 2015-2017 erick.tryzelaar <erick.tryzelaar@gmail.com>
+           2015-2017 kwantam <kwantam@gmail.com>
+License: Expat or Apache-2.0
+Comment: see https://github.com/unicode-rs/unicode-xid
+
 Files: src/vendor/vec_map/*
 Copyright: 2015-2017 Alexis Beingessner <a.beingessner@gmail.com>
            2015-2017 Andrew Paseltiner <apaseltiner@gmail.com>
diff --git a/debian/prune-checksums b/debian/prune-checksums
new file mode 100755 (executable)
index 0000000..0c895cf
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/python3
+# Copyright: 2015-2017 The Debian Project
+# License: MIT or Apache-2.0
+#
+# Helper to remove removed-files from .cargo-checksum
+# TODO: rewrite to perl and add to dh-cargo, maybe?
+
+from collections import OrderedDict
+import argparse
+import json
+import os
+import sys
+
+def prune_keep(cfile):
+    with open(cfile) as fp:
+        sums = json.load(fp, object_pairs_hook=OrderedDict)
+
+    oldfiles = sums["files"]
+    newfiles = OrderedDict([entry for entry in oldfiles.items() if os.path.exists(entry[0])])
+    sums["files"] = newfiles
+
+    if len(oldfiles) == len(newfiles):
+        return
+
+    with open(cfile, "w") as fp:
+        json.dump(sums, fp, separators=(',', ':'))
+
+def prune(cfile):
+    with open(cfile, "r+") as fp:
+        sums = json.load(fp, object_pairs_hook=OrderedDict)
+        sums["files"] = {}
+        fp.seek(0)
+        json.dump(sums, fp, separators=(',', ':'))
+        fp.truncate()
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser()
+    parser.add_argument("-k", "--keep", action="store_true", help="keep "
+        "checksums of files that still exist, and assume they haven't changed.")
+    parser.add_argument('crates', nargs=argparse.REMAINDER,
+        help="crates whose checksums to prune. (default: ./)")
+    args = parser.parse_args(sys.argv[1:])
+    crates = args.crates or ["."]
+    f = prune_keep if args.keep else prune
+    for c in crates:
+        cfile = os.path.join(c, ".cargo-checksum.json") if os.path.isdir(c) else c
+        f(cfile)
index e3db0e5b4a5567d67ad69578b2eac9fd97669e80..74063a2abf008fe9a66e96cf97165deb862eab39 100755 (executable)
@@ -183,16 +183,16 @@ override_dh_auto_configure: debian/config.toml
        if test $$(grep "127.0.0.1\s*localhost" /etc/hosts | wc -l) -gt 1; then \
          debian/ensure-patch -N debian/patches/d-host-duplicates.patch; fi
        # We patched mdbook so have to rm the checksums
-       /usr/share/cargo/prune-checksums src/vendor/mdbook/.cargo-checksum.json
+       debian//prune-checksums src/vendor/mdbook/.cargo-checksum.json
        # Unfortunately upstream uses a duplicate copy of libbacktrace and wants to
        # compile it again for rust-installer, see #43449
        ln -rsf src/libbacktrace -t src/vendor/backtrace-sys/src/
-       /usr/share/cargo/prune-checksums src/vendor/backtrace-sys/.cargo-checksum.json
+       debian/prune-checksums src/vendor/backtrace-sys/.cargo-checksum.json
        # Link against system liblzma, see https://github.com/alexcrichton/xz2-rs/issues/16
        echo 'fn main() { println!("cargo:rustc-link-lib=lzma"); }' > src/vendor/lzma-sys/build.rs
-       /usr/share/cargo/prune-checksums src/vendor/lzma-sys/.cargo-checksum.json
+       debian/prune-checksums src/vendor/lzma-sys/.cargo-checksum.json
        # We excluded some embedded libraries in d/copyright
-       /usr/share/cargo/prune-checksums src/vendor/dbghelp-sys/.cargo-checksum.json
+       debian/prune-checksums src/vendor/dbghelp-sys/.cargo-checksum.json
        # TODO: work-around for slightly buggy prune-unused-deps, can rm in 1.20.0
        rmdir src/vendor/* 2>/dev/null || true
        # Do the actual configure