kdesrc-build: Add flag to import Perl deps on popular distros
Open, HighPublic

Description

It would be easier to add needed Perl dependencies if kdesrc-build supported a way to show (or even install) the required Perl packages using the native distro's package manager.

This requires:

  • A way to detect the distro and running version
  • A mapping of dependencies to packages for each popular distro/version
  • A way to do this automatically under sudo
mpyne created this task.Aug 25 2018, 7:32 PM
mpyne triaged this task as High priority.

A way to detect the distro and running version

Maybe use /etc/os-release? Example:

PRETTY_NAME="Debian GNU/Linux buster/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/"

This should also work for Fedora/RHEL SUSE, Arch etc. It's one of those standardisation things that was adapted from Debian (/etc/debian-version), pushed by the systemd project and subsequently adopted by many (most?) distros.

I've added shell support for /etc/os-release at commit f3f100de6410d5ad9b84bef2d237ee2540e0f043

From there it shouldn't be too hard to just have a subdir under the kdesrc-build source mapping vendor IDs to perl modules and the like. Or more likely, a YAML file instead since I already have a YAML parser anyways.