skonfig / base

explorer and types for general use
GNU General Public License v3.0
4 stars 4 forks source link

__package_apt: quote `--target-release` #84

Closed sideeffect42 closed 1 year ago

sideeffect42 commented 1 year ago

If a user uses __package_apt on Devuan ceres e.g. like this:

__package_apt foo \
  --target-release "$(cat "${__global:?}/explorer/lsb_codename")-backports

It results in the following error message:

code-remote:stderr
------------------
E: Unable to locate package ceres-backports

The reason for this being that lsb_codename on Devuan ceres contains two words (e.g. daedalus ceres). Word expansion on the target then converted the second word "ceres-backports" into a separate argument which got interpreted by apt-get(8) as the package.

This simple patch quotes the target release, resulting in an error message which makes more sense:

code-remote:stderr
------------------
E: The value 'daedalus ceres-backports' is invalid for APT::Default-Release as such a release is not available in the sources