Improves the logic around ppa addition

kickstart will check if the ppa has already been added and only update
the package cache the first time it is added. Further updates must be
handled by hand.

It also installs the required packages to manage the ppa over command
line if it is not present yet.
This commit is contained in:
Bruno Tavares 2015-09-27 13:20:33 -03:00
parent caa3a7378b
commit 790f5b41ee

View File

@ -1,6 +1,13 @@
kickstart.apt.ppa() { kickstart.apt.ppa() {
if ! cat /etc/apt/sources.list.d/* | kickstart.stream.contains "${1#ppa:}"; then
if ! kickstart.command_exists add-apt-repository; then
kickstart.info "Required add-apt-repository command not found. Installing package."
kickstart.package.install python-software-properties || kickstart.package.install software-properties-common
fi
kickstart.mute add-apt-repository -y "$1" kickstart.mute add-apt-repository -y "$1"
kickstart.package.update kickstart.package.update
fi
} }
kickstart.apt.add_key_from_url() { kickstart.apt.add_key_from_url() {