summaryrefslogtreecommitdiffstats
path: root/chrome/installer/linux/common/apt.include
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/linux/common/apt.include')
-rw-r--r--chrome/installer/linux/common/apt.include150
1 files changed, 0 insertions, 150 deletions
diff --git a/chrome/installer/linux/common/apt.include b/chrome/installer/linux/common/apt.include
deleted file mode 100644
index c58737c..0000000
--- a/chrome/installer/linux/common/apt.include
+++ /dev/null
@@ -1,150 +0,0 @@
-# TODO(mmoss) Support configuring multiple repositories (e.g. stable and
-# testing)
-REPOCONFIG="@@REPOCONFIG@@"
-
-APT_GET="`which apt-get 2> /dev/null`"
-APT_CONFIG="`which apt-config 2> /dev/null`"
-
-# 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 signing key (see also:
-# http://www.google.com/linuxrepositories/aboutkey.html)
-install_key() {
- APT_KEY="`which apt-key 2> /dev/null`"
- if [ -x "$APT_KEY" ]; then
- "$APT_KEY" add - >/dev/null 2>&1 <<KEYDATA
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.2.2 (GNU/Linux)
-
-mQGiBEXwb0YRBADQva2NLpYXxgjNkbuP0LnPoEXruGmvi3XMIxjEUFuGNCP4Rj/a
-kv2E5VixBP1vcQFDRJ+p1puh8NU0XERlhpyZrVMzzS/RdWdyXf7E5S8oqNXsoD1z
-fvmI+i9b2EhHAA19Kgw7ifV8vMa4tkwslEmcTiwiw8lyUl28Wh4Et8SxzwCggDcA
-feGqtn3PP5YAdD0km4S4XeMEAJjlrqPoPv2Gf//tfznY2UyS9PUqFCPLHgFLe80u
-QhI2U5jt6jUKN4fHauvR6z3seSAsh1YyzyZCKxJFEKXCCqnrFSoh4WSJsbFNc4PN
-b0V0SqiTCkWADZyLT5wll8sWuQ5ylTf3z1ENoH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HKGSujEGQhWq8ZRoJAT
-G0KSObnmZ7FwFWu1e9XFoUCt0bSjiJWTIyaObMrWu/LvJ3e9I87HseSJStfw6fki
-5og9qFEkMrIrBCp3QGuQWBq/rTdMuwNFiEkEGBECAAkFAkXwb0sCGwwACgkQoECD
-D3+sWZF/WACfeNAu1/1hwZtUo1bR+MWiCjpvHtwAnA1R3IHqFLQ2X3xJ40XPuAyY
-/FJG
-=Quqp
------END PGP PUBLIC KEY BLOCK-----
-KEYDATA
- fi
-}
-
-# Set variables for the locations of the apt sources lists.
-find_apt_sources() {
- 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')"
-}
-
-# Add the Google repository to the apt sources.
-# Returns:
-# 0 - no update necessary
-# 1 - sources were updated
-# 2 - error
-update_sources_lists() {
- if [ ! "$REPOCONFIG" ]; then
- return 0
- fi
-
- find_apt_sources
-
- if [ -d "$APT_SOURCESDIR" ]; then
- # Nothing to do if it's already there.
- SOURCELIST=$(grep -H "$REPOCONFIG" "$APT_SOURCESDIR/@@PACKAGE@@.list" \
- 2>/dev/null | cut -d ':' -f 1)
- if [ -n "$SOURCELIST" ]; then
- return 0
- fi
-
- printf "$REPOCONFIG\n" > "$APT_SOURCESDIR/@@PACKAGE@@.list"
- if [ $? -eq 0 ]; then
- return 1
- fi
- fi
- # TODO(mmoss) What are the chances that any distro we support doesn't provide
- # APT_SOURCESDIR nowadays? Should we just bail if we get here? It makes
- # cleanup easier if we don't have to worry about undoing changes to
- # APT_SOURCES, which may conflict with other changes or manual edits.
-
- # Nothing to do if it's already there.
- SOURCELIST=$(grep -H "$REPOCONFIG" "$APT_SOURCES" 2>/dev/null \
- | cut -d ':' -f 1)
- if [ -n "$SOURCELIST" ]; then
- return 0
- fi
-
- if [ -w "$APT_SOURCES" ]; then
- printf "$REPOCONFIG #@@PACKAGE@@\n" >> "$APT_SOURCES"
- return 1
- fi
-
- return 2
-}
-
-# Remove a repository from the apt sources.
-# Returns:
-# 0 - successfully removed, or not configured
-# 1 - failed to remove
-clean_sources_lists() {
- if [ ! "$REPOCONFIG" ]; then
- return 0
- fi
-
- find_apt_sources
-
- if [ -d "$APT_SOURCESDIR" ]; then
- # Check if our package.list has this repo configured.
- SOURCELIST=$(grep -H "$REPOCONFIG" "$APT_SOURCESDIR/@@PACKAGE@@.list" \
- 2>/dev/null | cut -d ':' -f 1)
- if [ -n "$SOURCELIST" ]; then
- sed -i -e "\,$REPOCONFIG,d" "$SOURCELIST"
- if [ $? -ne 0 ]; then
- return 1
- fi
- # Delete file if empty (all comments or whitespace)
- LINECOUNT=$(sed -e '/^[[:space:]]*\(#.*\|$\)/d' "$SOURCELIST" | wc -l)
- if [ "$LINECOUNT" = "0" ]; then
- rm -f "$SOURCELIST"
- fi
- fi
- fi
-
- # Also check if it was added to the global sources.list
- SOURCELIST=$(grep -H "$REPOCONFIG" "$APT_SOURCES" 2>/dev/null \
- | cut -d ':' -f 1)
- if [ -n "$SOURCELIST" ]; then
- # Remove repo line(s) marked with our package comment
- sed -i -e "\,$REPOCONFIG #@@PACKAGE@@,d" "$SOURCELIST"
- if [ $? -ne 0 ]; then
- return 1
- fi
- fi
-
- return 0
-}