为什么升级到新版本后会重新启用 google PPA?

为什么升级到新版本后会重新启用 google PPA?

升级时,PPA 通常会被禁用,必须手动重新启用。大约一个月前,我升级到了 12.04,我刚刚注意到,虽然我的其他 PPA 都被禁用了,但 Google PPA 却不是已禁用。这是为什么?

答案1

(此答案感谢 Jorge Castro)

Google 软件包安装了一个 cron 作业,/etc/cron.daily/用于定制存储库配置并在版本升级后重新启用源。

每个 Google 软件包都会将其自己的脚本(或指向脚本的链接)放在此处。例如:google-musicmanagergoogle-chromegoogle-talkplugin(后者是指向 处脚本的符号链接/opt/google/talkplugin/cron/google-talkplugin)。

以下是来自 google-talkplugin 脚本的描述:

# This script is part of the google-talkplugin package.
#
# It creates the repository configuration file for package updates, and it
# monitors that config to see if it has been disabled by the overly aggressive
# distro upgrade process (e.g.  intrepid -> jaunty). When this situation is
# detected, the respository will be re-enabled. If the respository is disabled
# for any other reason, this won't re-enable it.
#
# This functionality can be controlled by creating the $DEFAULTS_FILE and
# setting "repo_add_once" and/or "repo_reenable_on_distupgrade" to "true" or
# "false" as desired. An empty $DEFAULTS_FILE is the same as setting both values
# to "false".

该脚本将:

  1. # Install the repository signing key
  2. # Update the Google repository if it's not set correctly.
  3. # Add the Google repository to the apt sources.
  4. # Remove our custom sources list file.
  5. # Detect if the repo config was disabled by distro upgrade and enable if necessary.

这是在版本升级后检测并重新启用 repo 配置的脚本部分。

handle_distro_upgrade() {
  if [ ! "$REPOCONFIG" ]; then
    return 0
  fi

  find_apt_sources
  SOURCELIST="$APT_SOURCESDIR/google-talkplugin.list"
  if [ -r "$SOURCELIST" ]; then
    REPOLINE=$(grep -E "^[[:space:]]*#[[:space:]]*$REPOCONFIG[[:space:]]*# disabled on upgrade to .*" "$SOURCELIST")
    if [ $? -eq 0 ]; then
      sed -i -e "s,^[[:space:]]*#[[:space:]]*\($REPOCONFIG\)[[:space:]]*# disabled on upgrade to .*,\1," \
        "$SOURCELIST"
      LOGGER=$(which logger 2> /dev/null)
      if [ "$LOGGER" ]; then
        "$LOGGER" -t "$0" "Reverted repository modification: $REPOLINE."
      fi
    fi
  fi
}

这是/etc/apt/sources.list.d/google-talkplugin.list脚本创建的文件。

### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/talkplugin/deb/ stable main

相关内容