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

scripts: further update scripts to work better with derivative distros. #103

Merged
merged 5 commits into from
Oct 12, 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
39 changes: 25 additions & 14 deletions scripts/install_pulseaudio_sources_apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,33 @@ if [ ! -d "$PULSE_DIR" ]; then
;;
esac

# Make sure sources are available
if ! grep -q '^ *deb-src' /etc/apt/sources.list; then
echo "- Adding source repositories" >&2
cp /etc/apt/sources.list /tmp/sources.list
# Scan the source repositories. Add sources for all repositories
# in this suite.
# Ignore other suites. This is needed when running the wrapper in a
# derivative-distro (like Linux Mint 21.2 'victoria') with --suite
# option (--suite=jammy).
echo "- Adding source repositories" >&2
SRCLIST=$(find /etc/apt/ /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.list')
for srclst in $SRCLIST; do
while read type url suite rest; do
if [ "$type" = deb ]; then
case "$suite" in
$codename | $codename-updates | $codename-security)
case "$suite" in
$codename | $codename-updates | $codename-security)
if [ "$type" = deb ]; then
echo "deb $url $suite $rest"
echo "deb-src $url $suite $rest"
;;
esac
fi
done </tmp/sources.list \
| sudo tee -a /etc/apt/sources.list >/dev/null
rm /tmp/sources.list
fi
fi
;;
esac
done <$srclst
done >/tmp/combined_sources.list

sudo rm $SRCLIST ;# Remove source respositories

# remove duplicates from the combined source.list in order to prevent
# apt warnings/errors; this is useful in cases where the user has
# already configured source code repositories.
sort -u < /tmp/combined_sources.list | \
sudo tee /etc/apt/sources.list > /dev/null

sudo apt-get update

Expand Down
2 changes: 1 addition & 1 deletion scripts/install_pulseaudio_sources_apt_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ echo "- Creating schroot config file $schroot_conf"
} | sudo tee $schroot_conf >/dev/null || exit $?

# Copy some files to the build root
for file in /etc/apt/sources.list; do
for file in $(find /etc/apt/ /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.list'); do
echo "- Copying $file to the root"
sudo install -m 0644 $file $BUILDROOT/$file || exit $?
done
Expand Down