Debian Bug report logs - #681477
dpkg-vendor: implement --select-closest command

version graph

Package: dpkg-dev; Maintainer for dpkg-dev is Dpkg Developers <[email protected]>; Source for dpkg-dev is src:dpkg (PTS, buildd, popcon).

Reported by: Raphael Hertzog <[email protected]>

Date: Fri, 13 Jul 2012 14:09:01 UTC

Severity: wishlist

Found in version dpkg/1.16.7

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#681477; Package dpkg-dev. (Fri, 13 Jul 2012 14:09:05 GMT) (full text, mbox, link).


Acknowledgement sent to Raphael Hertzog <[email protected]>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <[email protected]>. (Fri, 13 Jul 2012 14:09:10 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Raphael Hertzog <[email protected]>
To: [email protected]
Subject: dpkg-vendor: implement --select-closest command versions
Date: Fri, 13 Jul 2012 16:07:32 +0200
Package: dpkg-dev
Version: 1.16.7
Severity: wishlist
User: [email protected]
Usertags: dpkg-vendor

The --derives-from command works but when you have multiple levels of
derivatives, it imposes you to order your checks in the correct order 
to have the expected behaviour. It's also not reliable in the case
where the derivative relationships are symmetric (i.e. like RedHat and Fedora
which are evolving in parallel but building on each another). This
symmetric relationship is explicitely allowed in the ID_LIKE field
of /etc/os-release.

Therefore I suggest to implement a "dpkg-vendor --select-closest <distro1>
<distro2> ..." command that would compare all the listed distributions and
that would return the distribution which is closest to the current
distribution. This enables us to do:

TARGET_VENDOR := $(shell dpkg-vendor --select-closest debian ubuntu mint)

ifeq($(TARGET_VENDOR),mint)
    # Mint specific options
else ifeq($(TARGET_VENDOR),ubuntu)
    # Ubuntu specific options
else ifeq($(TARGET_VENDOR),debian)
    # Debian specific options
endif

This command can be reliably implemented with /etc/dpkg/origin/* and with
/etc/os-release since the latter orders the derivatives listed in ID_LIKE
from the closest to the furthest.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/




Changed Bug title to 'dpkg-vendor: implement --select-closest command' from 'dpkg-vendor: implement --select-closest command versions' Request was from Raphaël Hertzog <[email protected]> to [email protected]. (Fri, 13 Jul 2012 14:30:04 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 05:16:49 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.