Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: src/scripts/dpkg_no_scripts.sh

Issue 542097: Move is_whitelisted to the common script so that all users get the previous fix (Closed)
Patch Set: Fix silent failure case Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/scripts/common.sh ('k') | src/scripts/package_script_whitelist.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/dpkg_no_scripts.sh
diff --git a/src/scripts/dpkg_no_scripts.sh b/src/scripts/dpkg_no_scripts.sh
index 63c19429110e972664cbf9c22798e592bbbdb92b..e4a57e56975ea012c69eca73c04aea630811d1f3 100755
--- a/src/scripts/dpkg_no_scripts.sh
+++ b/src/scripts/dpkg_no_scripts.sh
@@ -26,6 +26,8 @@ DEFINE_boolean dpkg_fallback $FLAGS_TRUE \
"Run normal dpkg if maintainer scripts are not whitelisted."
DEFINE_string status_fd "" \
"The file descriptor to report status on; ignored."
+DEFINE_string whitelist "${SRC_ROOT}/package_scripts/package.whitelist" \
+ "The whitelist file to use."
DEFINE_boolean unpack $FLAGS_FALSE "Is the action 'unpack'?"
DEFINE_boolean configure $FLAGS_FALSE "Is the action 'configure'?"
DEFINE_boolean remove $FLAGS_FALSE "Is the action 'remove'?"
@@ -45,19 +47,6 @@ eval set -- "${FLAGS_ARGV}"
# Die on any errors.
set -e
-# Returns true if the input file is whitelisted.
-#
-# $1 - The file to check
-is_whitelisted() {
- local whitelist="${SRC_ROOT}/package_scripts/package.whitelist"
- test -f "$whitelist" || return
-
- local checksum=$(md5sum "$1" | awk '{ print $1 }')
- local count=$(sed -e "s/#.*$//" "${whitelist}" | grep -c "$checksum" \
- || /bin/true)
- test $count -ne 0
-}
-
# Returns true if either of the two given files exist and are not whitelisted.
#
# $1 - The package name.
@@ -157,7 +146,7 @@ do_unpack() {
rm -rf "$tmpdir"
# Run our maintainer script for this package if we have one.
- local chromium_postinst="${SRC_ROOT}/package_scripts/${package}.preinst"
+ local chromium_preinst="${SRC_ROOT}/package_scripts/${package}.preinst"
if [ -f "$chromium_preinst" ]; then
echo "Running: ${chromium_preinst}"
ROOT="$FLAGS_root" SRC_ROOT="$SRC_ROOT" $chromium_preinst
« no previous file with comments | « src/scripts/common.sh ('k') | src/scripts/package_script_whitelist.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698