Fixes and updates.
This commit is contained in:
parent
8ca363fd75
commit
1310e854bb
|
|
@ -1,17 +1,54 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# avoid duplicates
|
# avoid duplicates
|
||||||
set -x
|
set -x
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
rm /etc/apt/sources.list
|
rm /etc/apt/sources.list
|
||||||
rm /etc/apt/sources.list.d/devuan.list
|
rm /etc/apt/sources.list.d/devuan.list
|
||||||
|
|
||||||
sudo apt install -y apt-transport-tor apt-transport-https
|
# If you leave the update too long the keyring expires and your apt breaks.
|
||||||
|
install_devuan_keyring() {
|
||||||
|
local BASE_URL="https://pkgmaster.devuan.org/devuan/pool/main/d/devuan-keyring/"
|
||||||
|
local DEB_DIR="/tmp"
|
||||||
|
|
||||||
# https://www.devuan.org/os/packages
|
# Check for wget dependency
|
||||||
# FIXME: the mirror is now permenently on deb but:
|
if ! command -v wget &>/dev/null; then
|
||||||
# http://deb.devuan.org/merged
|
echo "Error: wget is not installed." >&2
|
||||||
# is used for main, update, backports and security
|
return 1
|
||||||
# http://deb.devuan.org/devuan
|
fi
|
||||||
# is used for experimental, proposed-updates
|
|
||||||
|
echo "Searching for the latest devuan-keyring..."
|
||||||
|
|
||||||
|
# Fetch directory listing, extract .deb links, filter, sort by version, take latest
|
||||||
|
local LATEST_DEB
|
||||||
|
LATEST_DEB=$(wget -q -O - "$BASE_URL" |
|
||||||
|
grep -oP 'devuan-keyring_\d{4}\.\d{2}\.\d{2}_all\.deb' |
|
||||||
|
sort -rV |
|
||||||
|
head -n 1)
|
||||||
|
|
||||||
|
if [ -z "$LATEST_DEB" ]; then
|
||||||
|
echo "Error: Could not find any devuan-keyring_*.deb in listing" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Latest found: $LATEST_DEB"
|
||||||
|
local FULL_URL="${BASE_URL}${LATEST_DEB}"
|
||||||
|
local DEB_PATH="${DEB_DIR}/${LATEST_DEB}"
|
||||||
|
|
||||||
|
echo "Downloading to $DEB_PATH..."
|
||||||
|
wget -q --show-progress -O "$DEB_PATH" "$FULL_URL"
|
||||||
|
|
||||||
|
echo "Installing package..."
|
||||||
|
sudo dpkg -i "$DEB_PATH"
|
||||||
|
|
||||||
|
# Clean up the downloaded file
|
||||||
|
rm "$DEB_PATH"
|
||||||
|
echo "Installation complete and cleanup finished."
|
||||||
|
}
|
||||||
|
install_devuan_keyring
|
||||||
|
|
||||||
|
sudo apt install -y usrmerge
|
||||||
|
sudo apt install -y apt-transport-tor apt-transport-https
|
||||||
|
|
||||||
TRANSPORT="https"
|
TRANSPORT="https"
|
||||||
#MIRROR=deb
|
#MIRROR=deb
|
||||||
|
|
@ -54,21 +91,21 @@ PROPOSED_LIST=('excalibur-proposed-updates')
|
||||||
# Active (enabled) loop – all merged in your current choice
|
# Active (enabled) loop – all merged in your current choice
|
||||||
for RELEASE in "${ACTIVE_LIST[@]}"; do
|
for RELEASE in "${ACTIVE_LIST[@]}"; do
|
||||||
echo "${RELEASE}"
|
echo "${RELEASE}"
|
||||||
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
|
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
|
||||||
Enabled: yes
|
Enabled: yes
|
||||||
Types: deb deb-src
|
Types: deb deb-src
|
||||||
URIs: ${MERGED_URI}
|
URIs: ${MERGED_URI}
|
||||||
Suites: ${RELEASE}
|
Suites: ${RELEASE}
|
||||||
Components: ${SECTION_MERGED}
|
Components: ${SECTION_MERGED}
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
EOF
|
EOF
|
||||||
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
|
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Special / other (experimental, and potentially *-proposed-updates later)
|
# Special / other (experimental, and potentially *-proposed-updates later)
|
||||||
for RELEASE in "${OTHER_LIST[@]}"; do
|
for RELEASE in "${OTHER_LIST[@]}"; do
|
||||||
echo "${RELEASE}"
|
echo "${RELEASE}"
|
||||||
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
|
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
|
||||||
Enabled: yes
|
Enabled: yes
|
||||||
Types: deb deb-src
|
Types: deb deb-src
|
||||||
URIs: ${DEVUAN_URI}
|
URIs: ${DEVUAN_URI}
|
||||||
|
|
@ -76,20 +113,20 @@ for RELEASE in "${OTHER_LIST[@]}"; do
|
||||||
Components: ${SECTION_SPECIAL}
|
Components: ${SECTION_SPECIAL}
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
# Signed-By: /usr/share/keyrings/devuan-archive-keyring.gpg # optional, if needed
|
# Signed-By: /usr/share/keyrings/devuan-archive-keyring.gpg # optional, if needed
|
||||||
EOF
|
EOF
|
||||||
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
|
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo ${#OTHER_LIST[@]}
|
echo ${#OTHER_LIST[@]}
|
||||||
for RELEASE in "${OTHER_LIST[@]}"; do
|
for RELEASE in "${OTHER_LIST[@]}"; do
|
||||||
echo "${RELEASE}"
|
echo "${RELEASE}"
|
||||||
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
|
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
|
||||||
Enabled: yes
|
Enabled: yes
|
||||||
Types: deb deb-src
|
Types: deb deb-src
|
||||||
URIs: ${TRANSPORT}://${MIRROR}.devuan.org/devuan
|
URIs: ${TRANSPORT}://${MIRROR}.devuan.org/devuan
|
||||||
Suites: ${RELEASE}
|
Suites: ${RELEASE}
|
||||||
Components: main
|
Components: main
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
@ -99,15 +136,15 @@ done
|
||||||
echo ${#PROPOSED_LIST[@]}
|
echo ${#PROPOSED_LIST[@]}
|
||||||
for RELEASE in "${PROPOSED_LIST[@]}"; do
|
for RELEASE in "${PROPOSED_LIST[@]}"; do
|
||||||
echo "${RELEASE}"
|
echo "${RELEASE}"
|
||||||
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
|
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
|
||||||
Enabled: no
|
Enabled: no
|
||||||
Types: deb deb-src
|
Types: deb deb-src
|
||||||
URIs: ${DEVUAN_URI}
|
URIs: ${DEVUAN_URI}
|
||||||
Suites: ${RELEASE}
|
Suites: ${RELEASE}
|
||||||
Components: ${SECTION_SPECIAL}
|
Components: ${SECTION_SPECIAL}
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
# Note: proposed-updates for upcoming point releases; not for production
|
# Note: proposed-updates for upcoming point releases; not for production
|
||||||
EOF
|
EOF
|
||||||
# Optional symlink even if disabled
|
# Optional symlink even if disabled
|
||||||
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
|
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
|
||||||
done
|
done
|
||||||
|
|
@ -140,15 +177,15 @@ for RELEASE in "${ONION_LIST[@]}"; do
|
||||||
SECTION_USED="${SECTION_MERGED}" # assume you defined SECTION_MERGED earlier as "main contrib non-free non-free-firmware"
|
SECTION_USED="${SECTION_MERGED}" # assume you defined SECTION_MERGED earlier as "main contrib non-free non-free-firmware"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}-onion.sources" <<-EOF
|
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}-onion.sources" <<EOF
|
||||||
Enabled: no # change to yes if you run tor and want default onion
|
Enabled: no
|
||||||
Types: deb deb-src
|
Types: deb deb-src
|
||||||
URIs: ${TOR_URI}
|
URIs: ${TOR_URI}
|
||||||
Suites: ${RELEASE}
|
Suites: ${RELEASE}
|
||||||
Components: ${SECTION_USED}
|
Components: ${SECTION_USED}
|
||||||
Architectures: amd64
|
Architectures: amd64
|
||||||
# Tor / onion routing - requires apt-transport-tor installed and tor running
|
# Tor / onion routing - requires apt-transport-tor installed and tor running
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ln -sf "${AVAILABLE}/devuan_${RELEASE}-onion.sources" "${ACTIVE}/devuan_${RELEASE}-onion.sources"
|
ln -sf "${AVAILABLE}/devuan_${RELEASE}-onion.sources" "${ACTIVE}/devuan_${RELEASE}-onion.sources"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue