8000 feat: detect Debian Testing as actual codename instead of Sid by silentJET85 · Pull Request #1418 · wimpysworld/deb-get · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: detect Debian Testing as actual codename instead of Sid #1418

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 13 additions & 5 deletions deb-get
Original file line number Diff line number Diff line change
Expand Up @@ -1371,11 +1371,19 @@ if ! [[ ' ubuntu debian ' =~ " ${UPSTREAM_ID} " ]]; then
fi
fi

# Debian Sid doesn't have it's own unique os-release file. It is the same as Debian stable.
# So we first check /etc/debian_version to see if we're running sid. If not, we will trust what os-release says.
if [[ "${UPSTREAM_ID}" == "debian" ]] && grep -q "sid" /etc/debian_version; then
UPSTREAM_CODENAME="sid"
OS_CODENAME="sid"
# Debian Sid & Testing don't always have their own unique os-release file. It is often the same as the previous Debian stable.
# So we first check /etc/debian_version to make sure we're not running Stable.
# If not, we will then use apt-cache policy to distinguish between Debian Sid and Debian Testing.
local ETC_DEB_VER="$(< /etc/debian_version)"
if [[ "${UPSTREAM_ID}" == "debian" ]] && grep -q "sid" <<< "${ETC_DEB_VER}"; then
if apt-cache policy | grep -q -i -e "o=debian.*n=${ETC_DEB_VER%%/*}" -e "o=debian.*n=testing"; then
UPSTREAM_CODENAME="${ETC_DEB_VER%%/*}"
OS_CODENAME="${UPSTREAM_CODENAME}"
DEBIAN_TESTING="${UPSTREAM_CODENAME}"
else
UPSTREAM_CODENAME="sid"
OS_CODENAME="sid"
fi
else
local codename
for codename in UBUNTU_CODENAME DEBIAN_CODENAME VERSION_CODENAME; do
Expand Down
0