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

Unified Diff: chrome/installer/linux/common/apt.include

Issue 2542263003: Remove apt_config_val from apt.include (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/linux/common/apt.include
diff --git a/chrome/installer/linux/common/apt.include b/chrome/installer/linux/common/apt.include
index 76c65a8a77018d73099ca87ca6b484f382546642..14f196fd2556c3d9018506095a3f508143c2cad1 100644
--- a/chrome/installer/linux/common/apt.include
+++ b/chrome/installer/linux/common/apt.include
@@ -6,14 +6,6 @@ APT_CONFIG="`which apt-config 2> /dev/null`"
SOURCES_PREAMBLE="### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.\n"
-# Parse apt configuration and return requested variable value.
-apt_config_val() {
- APTVAR="$1"
- if [ -x "$APT_CONFIG" ]; then
- "$APT_CONFIG" dump | sed -e "/^$APTVAR /"'!d' -e "s/^$APTVAR \"\(.*\)\".*/\1/"
- fi
-}
-
# Install the repository/package signing keys, if they aren't already.
# (see also: https://www.google.com/linuxrepositories/)
install_key() {
@@ -141,14 +133,7 @@ KEYDATA
# Set variables for the locations of the apt sources lists.
find_apt_sources() {
- # NB: These variables only *sometimes* include a trailing slash. (In
- # particular, in Ubuntu 16.10 / Debian 9, the default value *stopped*
- # including the trailing slash.) We have to join them with slashes, even
- # though that sometimes gives a double slash.
- APTDIR=$(apt_config_val Dir)
- APTETC=$(apt_config_val 'Dir::Etc')
- APT_SOURCES="$APTDIR/$APTETC/$(apt_config_val 'Dir::Etc::sourcelist')"
- APT_SOURCESDIR="$APTDIR/$APTETC/$(apt_config_val 'Dir::Etc::sourceparts')"
+ eval $("$APT_CONFIG" shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d')
}
# Update the Google repository if it's not set correctly.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698