| OLD | NEW |
| 1 @@include@@variables.include | 1 @@include@@variables.include |
| 2 | 2 |
| 3 APT_GET="`which apt-get 2> /dev/null`" | 3 APT_GET="`which apt-get 2> /dev/null`" |
| 4 APT_CONFIG="`which apt-config 2> /dev/null`" | 4 APT_CONFIG="`which apt-config 2> /dev/null`" |
| 5 | 5 |
| 6 SOURCES_PREAMBLE="### THIS FILE IS AUTOMATICALLY CONFIGURED ### | 6 SOURCES_PREAMBLE="### THIS FILE IS AUTOMATICALLY CONFIGURED ### |
| 7 # You may comment out this entry, but any other modifications may be lost.\n" | 7 # You may comment out this entry, but any other modifications may be lost.\n" |
| 8 | 8 |
| 9 # Parse apt configuration and return requested variable value. | |
| 10 apt_config_val() { | |
| 11 APTVAR="$1" | |
| 12 if [ -x "$APT_CONFIG" ]; then | |
| 13 "$APT_CONFIG" dump | sed -e "/^$APTVAR /"'!d' -e "s/^$APTVAR \"\(.*\)\".*/\1
/" | |
| 14 fi | |
| 15 } | |
| 16 | |
| 17 # Install the repository/package signing keys, if they aren't already. | 9 # Install the repository/package signing keys, if they aren't already. |
| 18 # (see also: https://www.google.com/linuxrepositories/) | 10 # (see also: https://www.google.com/linuxrepositories/) |
| 19 install_key() { | 11 install_key() { |
| 20 APT_KEY="`which apt-key 2> /dev/null`" | 12 APT_KEY="`which apt-key 2> /dev/null`" |
| 21 if [ ! -x "$APT_KEY" ]; then | 13 if [ ! -x "$APT_KEY" ]; then |
| 22 return | 14 return |
| 23 fi | 15 fi |
| 24 | 16 |
| 25 NEED_KEYS=0 | 17 NEED_KEYS=0 |
| 26 "$APT_KEY" export 7fac5991 2>&1 | \ | 18 "$APT_KEY" export 7fac5991 2>&1 | \ |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 m5o2ggoONj3qI3JaRHsZaOs1qPQcyd46OyIFUpHJIfk4nezDCoQYd93bWUGqDwxI | 126 m5o2ggoONj3qI3JaRHsZaOs1qPQcyd46OyIFUpHJIfk4nezDCoQYd93bWUGqDwxI |
| 135 /n/CsdO0365yqDO/ADscehlVqdAupVv2 | 127 /n/CsdO0365yqDO/ADscehlVqdAupVv2 |
| 136 =dmoF | 128 =dmoF |
| 137 -----END PGP PUBLIC KEY BLOCK----- | 129 -----END PGP PUBLIC KEY BLOCK----- |
| 138 KEYDATA | 130 KEYDATA |
| 139 fi | 131 fi |
| 140 } | 132 } |
| 141 | 133 |
| 142 # Set variables for the locations of the apt sources lists. | 134 # Set variables for the locations of the apt sources lists. |
| 143 find_apt_sources() { | 135 find_apt_sources() { |
| 144 # NB: These variables only *sometimes* include a trailing slash. (In | 136 eval $("$APT_CONFIG" shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d') |
| 145 # particular, in Ubuntu 16.10 / Debian 9, the default value *stopped* | |
| 146 # including the trailing slash.) We have to join them with slashes, even | |
| 147 # though that sometimes gives a double slash. | |
| 148 APTDIR=$(apt_config_val Dir) | |
| 149 APTETC=$(apt_config_val 'Dir::Etc') | |
| 150 APT_SOURCES="$APTDIR/$APTETC/$(apt_config_val 'Dir::Etc::sourcelist')" | |
| 151 APT_SOURCESDIR="$APTDIR/$APTETC/$(apt_config_val 'Dir::Etc::sourceparts')" | |
| 152 } | 137 } |
| 153 | 138 |
| 154 # Update the Google repository if it's not set correctly. | 139 # Update the Google repository if it's not set correctly. |
| 155 # Note: this doesn't necessarily enable the repository, it just makes sure the | 140 # Note: this doesn't necessarily enable the repository, it just makes sure the |
| 156 # correct settings are available in the sources list. | 141 # correct settings are available in the sources list. |
| 157 # Returns: | 142 # Returns: |
| 158 # 0 - no update necessary | 143 # 0 - no update necessary |
| 159 # 2 - error | 144 # 2 - error |
| 160 update_bad_sources() { | 145 update_bad_sources() { |
| 161 if [ ! "$REPOCONFIG" ]; then | 146 if [ ! "$REPOCONFIG" ]; then |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 get_lib_dir() { | 264 get_lib_dir() { |
| 280 if [ "$DEFAULT_ARCH" = "i386" ]; then | 265 if [ "$DEFAULT_ARCH" = "i386" ]; then |
| 281 LIBDIR=lib/i386-linux-gnu | 266 LIBDIR=lib/i386-linux-gnu |
| 282 elif [ "$DEFAULT_ARCH" = "amd64" ]; then | 267 elif [ "$DEFAULT_ARCH" = "amd64" ]; then |
| 283 LIBDIR=lib/x86_64-linux-gnu | 268 LIBDIR=lib/x86_64-linux-gnu |
| 284 else | 269 else |
| 285 echo Unknown CPU Architecture: "$DEFAULT_ARCH" | 270 echo Unknown CPU Architecture: "$DEFAULT_ARCH" |
| 286 exit 1 | 271 exit 1 |
| 287 fi | 272 fi |
| 288 } | 273 } |
| OLD | NEW |