[bin] add --keyslot support to bump_kernel_tag_mods*

This commit is contained in:
Fabio Erculiani 2011-11-29 20:58:23 +01:00
parent d476b1d242
commit bdf9cf7734
2 changed files with 16 additions and 4 deletions

View File

@ -12,9 +12,12 @@ if only_injected:
do_spm_repo = "--no-spm-repo" not in args
if not do_spm_repo:
args.remove("--no-spm-repo")
keyslot = "--keyslot" in args
if keyslot:
args.remove("--keyslot")
if len(args) < 3:
print("bump_kernel_tag_mods <query tag> <compile tag> <source (query) repo> <destination entropy repo> [--only-injected] [--no-spm-repo]")
print("bump_kernel_tag_mods <query tag> <compile tag> <source (query) repo> <destination entropy repo> [--only-injected] [--no-spm-repo] [--keyslot]")
raise SystemExit(1)
kernel_tag = args.pop(0)
@ -48,6 +51,9 @@ try:
injected_atoms = []
for lst in (normal_pkgs, injected_pkgs):
for pkg_id in lst:
if keyslot:
atom_str = repo.retrieveKeySlotAggregated(pkg_id)
else:
atom_str = entropy.dep.remove_tag(repo.retrieveAtom(pkg_id))
if do_spm_repo:
spm_repo = repo.retrieveSpmRepository(pkg_id)

View File

@ -8,9 +8,12 @@ args = sys.argv[1:]
do_spm_repo = "--no-spm-repo" not in args
if not do_spm_repo:
args.remove("--no-spm-repo")
keyslot = "--keyslot" in args
if keyslot:
args.remove("--keyslot")
if len(args) < 3:
print("bump_kernel_tag_mods <query tag> <compile tag> <source (query) repo> <destination entropy repo> [--no-spm-repo]")
print("bump_kernel_tag_mods <query tag> <compile tag> <source (query) repo> <destination entropy repo> [--no-spm-repo] [--keyslot]")
raise SystemExit(1)
kernel_tag = args.pop(0)
@ -40,6 +43,9 @@ try:
if spm_repo is not None:
atom_str += "::" + spm_repo
injected_atoms.append(atom_str)
if keyslot:
injected_atoms = [repo.retrieveKeySlotAggregated(pkg_id) for pkg_id in pkg_ids]
else:
injected_atoms = [entropy.dep.remove_tag(repo.retrieveAtom(pkg_id)) for pkg_id in pkg_ids]
finally:
srv.shutdown()