Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import subprocess
import os
trepo = str("nemo:testing:hw:{0}:{1}".format(os.environ["VENDOR"],os.environ["DEVICE"])).lower()
drepo = str("nemo:devel:hw:{0}:{1}".format(os.environ["VENDOR"],os.environ["DEVICE"])).lower()
cmd = "osc ls {0}".format(drepo)
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
dpackages = process.communicate()[0]
cmd = "osc ls {0}".format(trepo)
process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
tpackages = process.communicate()[0]
for p in tpackages.split('\n'):
p = p.strip()
if p == '' or p[0] == '#' or p == "_pattern":
continue
if p in dpackages.split('\n'):
continue
print "osc -A https://api.merproject.org rdelete {0} {1} -m maintenance".format(trepo,p)
for p in dpackages.split('\n'):
p = p.strip()
if p == '' or p[0] == '#' or p == "_pattern":
continue
print "osc -A https://api.merproject.org copypac {0} {1} {2}".format(drepo,p,trepo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.