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

version graph

Package: dpkg-dev; Maintainer for dpkg-dev is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg-dev is src:dpkg.

Reported by: Raphael Hertzog <hertzog@debian.org>

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

Severity: wishlist

Found in version dpkg/1.16.7

Reply or subscribe to this bug.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#681477; Package dpkg-dev. (Fri, 13 Jul 2012 14:09:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 13 Jul 2012 14:09:10 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: submit@bugs.debian.org
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: dpkg@packages.debian.org
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 <hertzog@debian.org> to control@bugs.debian.org. (Fri, 13 Jul 2012 14:30:04 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 20:13:29 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.