mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-03-09 18:21:09 +00:00
britney_util: add make_hintitem()
This function allows a textual representation of a package (e.g. "foo/amd64") to be convered to a HintItem(). Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
This commit is contained in:
parent
09e9e16431
commit
629c80937d
@ -23,7 +23,7 @@ from functools import partial
|
||||
from itertools import chain, ifilter, ifilterfalse, izip, repeat
|
||||
import re
|
||||
import time
|
||||
|
||||
from migrationitem import HintItem, MigrationItem
|
||||
|
||||
from consts import (VERSION, BINARIES, PROVIDES, DEPENDS, CONFLICTS,
|
||||
RDEPENDS, RCONFLICTS, ARCHITECTURE, SECTION)
|
||||
@ -361,3 +361,13 @@ def write_heidi(filename, sources_t, packages_t,
|
||||
srcv = src[VERSION]
|
||||
srcsec = src[SECTION] or 'unknown'
|
||||
f.write('%s %s source %s\n' % (src_name, srcv, srcsec))
|
||||
|
||||
def make_hintitem(package, sources, VERSION=VERSION):
|
||||
"""Convert a textual package specification to a HintItem
|
||||
|
||||
sources is a list of source packages in each suite, used to determine
|
||||
the version which should be used for the HintItem.
|
||||
"""
|
||||
|
||||
item = MigrationItem(package)
|
||||
return HintItem("%s/%s" % (item.uvname, sources[item.suite][item.package][VERSION]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user