]> git.proxmox.com Git - rustc.git/blobdiff - debian/check-orig-suspicious.sh
bump version to 1.75.0+dfsg1-1~bpo12+pve1
[rustc.git] / debian / check-orig-suspicious.sh
index b4f2cc2c8e750a7340c02fce3d4c6fcc5b8b33b0..a168b7866b3e2946705bcc0544f65585d308d2bf 100755 (executable)
@@ -1,34 +1,25 @@
 #!/bin/bash
-
-set -ex
+set -e
 
 ver="$1"
 test -n "$ver" || exit 2
-
-FILTER="Files-Excluded: in debian/copyright and run a repack."
-SUS_WHITELIST=$(find "${PWD}" -name upstream-tarball-unsuspicious.txt -type f)
-
-rm -rf rustc-${ver/*~*/beta}-src/
-tar xf ../rustc_$ver+dfsg1.orig.tar.xz && cd rustc-${ver/*~*/beta}-src/
-
-# Remove tiny files 4 bytes or less
-find . -size -4c -delete
-# Remove non-suspicious files, warning on patterns that match nothing
-grep -v '^#' ${SUS_WHITELIST} | xargs  -I% sh -c 'rm -r ./% || true'
-echo "Checking for suspicious files..."
-
-# TODO: merge the -m stuff into suspicious-source(1).
-suspicious-source -v -m text/x-objective-c
-# The following shell snippet is a bit more strict than suspicious-source(1)
-find . -type f -and -not -name '.cargo-checksum.json' -exec file '{}' \; | \
-  sed -e 's/\btext\b\(.*\), with very long lines/verylongtext\1/g' | \
-  grep -v '\b\(text\|empty\)\b' || true
-
-# Most C and JS code should be in their own package
-find src/vendor/ -name '*.c' -o -name '*.js'
-
-echo "The above files (if any) seem suspicious, please audit them."
-echo "If good, add them to ${SUS_WHITELIST}."
-echo "If bad, add them to ${FILTER}."
+dfsg="$2"
+if test -z "$dfsg"; then
+  dfsg=1
+fi
+
+SUS_WHITELIST="$(find "${PWD}/debian" -name upstream-tarball-unsuspicious.txt -type f)"
+
+rm -rf "rustc-${ver/*~*/beta}-src/"
+tar xf "../rustc_$ver+dfsg$dfsg.orig.tar.xz" && cd "rustc-${ver/*~*/beta}-src/"
+if test -f "../../rustc_$ver+dfsg$dfsg.orig-extra.tar.xz" ; then
+  tar xf "../../rustc_$ver+dfsg$dfsg.orig-extra.tar.xz"
+fi
+
+../debian/scripts/audit-vendor-source \
+  "$SUS_WHITELIST" \
+  "Files-Excluded: in debian/copyright and run a repack." \
+  -m text/x-script.python \
+  -m application/csv
 
 echo "Artifacts left in rustc-$ver-src, please remove them yourself."