]> git.proxmox.com Git - cargo.git/commitdiff
Update audit-vendor-source
authorXimin Luo <infinity0@debian.org>
Thu, 6 Aug 2020 22:18:14 +0000 (23:18 +0100)
committerXimin Luo <infinity0@debian.org>
Thu, 6 Aug 2020 22:18:14 +0000 (23:18 +0100)
debian/scripts/audit-vendor-source

index 971baa4e59d54914040e9ec5f5b41851c76d2323..2e8920ddc1ba7cfa6db1473f4200c4c6f2a7779a 100755 (executable)
@@ -2,6 +2,9 @@
 # Audit Rust crate source for suspicious files in the current directory, that
 # shouldn't or can't be part of a Debian source package.
 #
+# NOTE: this overwrites & deletes files in the current directory!!! Make a
+# backup before running this script.
+#
 # Usage: $0 <whitelist> <filter_description> [<extra args to suspicious-source>]
 
 set -e
@@ -18,6 +21,9 @@ grep -v '^#' "$whitelist" | xargs  -I% sh -c 'rm -r ./% || true'
 echo "Checking for suspicious files..."
 # Remove cargo metadata files
 find . '(' -name '.cargo-checksum.json' -or -name '.cargo_vcs_info.json' ')' -delete
+# Strip comments & blank lines before testing rust source code -
+# some authors like to write really long comments
+find . -name '*.rs' -execdir sed -i -e '\,^\s*//,d' -e '/^\s*$/d' '{}' \;
 
 # TODO: merge the -m stuff into suspicious-source(1).
 suspicious-source -v "$@"