ros-infrastructure / rospkg

rospkg Python library for ROS
http://wiki.ros.org/rospkg
36 stars 97 forks source link

Update debian codename mapping #238

Closed cottsay closed 2 years ago

cottsay commented 2 years ago

A few issues here:

  1. With py3.8, we're using 'distro' instead of 'platform', which gives us only the major version number. Using str.split handles both cases.
  2. Add bookworm and trixie
  3. Looks like 'sid' doesn't have a number, but that's okay

This should only result in a change in behavior for Debian versions newer than Buster. I tested it on Buster, Bullseye and Sid.

nuclearsandwich commented 2 years ago

Actually, does it make sense to switch Debian to use the Freedesktop.org /etc/os-release detector? It might still need some special handling for Sid as here's what I see on Bullseye vs Sid for /etc/os-release:

❯ lxc exec bullseye /bin/cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
❯ lxc exec sid /bin/cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
cottsay commented 2 years ago

Actually, does it make sense to switch Debian to use the Freedesktop.org /etc/os-release detector?

Yes, I think it does. We need to understand how that change will affect Debian derivatives like Raspbian first. Right now, Raspbian Buster is detected as Debian by the current implementation, but would be identified as raspbian if we switched to FdoDetect.

$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"