Skip to content

Commit

Permalink
Fix the script to fix two scenarios: 1. No source list file needs to …
Browse files Browse the repository at this point in the history
…be updated 2. Multiple source list files need to be updated (#1180)
  • Loading branch information
xby-G authored May 14, 2024
1 parent 90d52f8 commit b71dd5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/pip-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function remove_old_backports {
oldstable=$(curl -s https://deb.debian.org/debian/dists/oldstable/Release | awk '/^Codename/ {print $2}');
stable=$(curl -s https://deb.debian.org/debian/dists/stable/Release | awk '/^Codename/ {print $2}');

matched_files="$(grep -rsil '\-backports' /etc/apt/sources.list*)"
matched_files=( $(grep -rsil '\-backports' /etc/apt/sources.list*||:) )
if [[ -n "$matched_files" ]]; then
for filename in "$matched_files"; do
for filename in "${matched_files[@]}"; do
grep -e "$oldstable-backports" -e "$stable-backports" "$filename" || \
sed -i -e 's/^.*-backports.*$//' "$filename"
done
Expand Down

0 comments on commit b71dd5e

Please sign in to comment.