Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(tue-install-ppa-now) small update #679

Merged
merged 2 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.4
1.10.5
13 changes: 11 additions & 2 deletions installer/tue-install-impl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ function tue-install-ppa-now
tue-install-error "Invalid tue-install-ppa-now call: needs ppa or deb as argument."
fi

local PPA_ADDED needs_to_be_added
local PPA_ADDED args needs_to_be_added sources_list_entry
# shellcheck disable=SC2048
for ppa in $*
do
Expand All @@ -888,6 +888,7 @@ function tue-install-ppa-now
tue-install-error "Invalid tue-install-ppa-now call: needs to start with 'ppa:' or 'deb ' ($ppa)"
fi
needs_to_be_added="false"
sources_list_entry="false"
if [[ "$ppa" == "ppa:"* ]]
then
if ! grep -q "^deb.*${ppa#ppa:}" /etc/apt/sources.list.d/* 2>&1
Expand All @@ -896,6 +897,7 @@ function tue-install-ppa-now
fi
elif [[ "$ppa" == "deb "* ]]
then
sources_list_entry="true"
if ! grep -qF "$ppa" /etc/apt/sources.list 2>&1
then
needs_to_be_added="true"
Expand Down Expand Up @@ -926,7 +928,14 @@ function tue-install-ppa-now
((i=i+1))
done

tue-install-pipe sudo add-apt-repository --yes "$ppa" || tue-install-error "An error occurred while adding ppa: $ppa"
args="--yes --no-update"

if [[ "${sources_list_entry}" == "true" ]]
then
args="${args:+${args} }-S"
fi
# shellcheck disable=SC2086
tue-install-pipe sudo add-apt-repository ${args} "$ppa" || tue-install-error "An error occurred while adding ppa: $ppa"
PPA_ADDED=true
else
tue-install-debug "$ppa is already added previously"
Expand Down