sys.exit(0) root = tempfile.mkdtemp() if pacman.initialize(root) == -1: print "initialize() failed" if os.getcwd().split('/')[-2] in ["frugalware-current", "current"]: treename = "frugalware-current" else: treename = "frugalware" local = pacman.db_register("local") db = pacman.db_register(treename) if not db: print "db_register() failed" if pacman.db_setserver(db, "file://" + os.getcwd() + "/../frugalware-%s" % sys.argv[1]) == -1: print "db_setserver() failed" if pacman.db_update(1, db) == -1: print "db_update() failed" if pacman.trans_init(pacman.TRANS_TYPE_SYNC, pacman.TRANS_FLAG_NOCONFLICTS, None, None, None) == -1: print "trans_init() failed" i = pacman.db_getpkgcache(db) while i: pkg = pacman.void_to_PM_PKG(pacman.list_getdata(i)) pkgname = pacman.void_to_char(pacman.pkg_getinfo(pkg, pacman.PKG_NAME)) if pacman.trans_addtarget(pkgname): print "failed to add target '%s' (%s)" % (pkgname, pacman.strerror(pacman.cvar.pm_errno)) break i = pacman.list_next(i) junk = pacman.LISTp_new() if pacman.trans_prepare(junk) == -1: print "%s:" % pacman.strerror(pacman.cvar.pm_errno) i = pacman.list_first(pacman.LISTp_to_LIST(junk))
if len(sys.argv) > 1 and sys.argv[1] == "--help": print "base packages which depend on packages outsite base (->base is needed)" sys.exit(0) basecats = ['base'] root = tempfile.mkdtemp() pacman.initialize(root) if os.getcwd().split('/')[-2] == "frugalware-current": treename = "frugalware-current" else: treename = "frugalware" db = pacman.db_register(treename) pacman.db_setserver(db, "file://" + os.getcwd() + "/../frugalware-%s" % sys.argv[1]) pacman.db_update(1, db) i = pacman.db_getpkgcache(db) while i: pkg = pacman.void_to_PM_PKG(pacman.list_getdata(i)) pkgname = pacman.void_to_char(pacman.pkg_getinfo(pkg, pacman.PKG_NAME)) group = pacman.void_to_char(pacman.list_getdata(pacman.void_to_PM_LIST(pacman.pkg_getinfo(pkg, pacman.PKG_GROUPS)))) if group not in basecats: i = pacman.list_next(i) continue j = pacman.void_to_PM_LIST(pacman.pkg_getinfo(pkg, pacman.PKG_DEPENDS)) while j: found = False dep = pacman.void_to_char(pacman.list_getdata(j)).split("<")[0].split(">")[0].split("=")[0] k = pacman.db_getpkgcache(db) while not found and k:
root = tempfile.mkdtemp() if pacman.initialize(root) == -1: print "initialize() failed" if os.getcwd().split('/')[-2] in ["frugalware-current", "current"]: treename = "frugalware-current" else: treename = "frugalware" local = pacman.db_register("local") db = pacman.db_register(treename) if not db: print "db_register() failed" if pacman.db_setserver( db, "file://" + os.getcwd() + "/../frugalware-%s" % sys.argv[1]) == -1: print "db_setserver() failed" if pacman.db_update(1, db) == -1: print "db_update() failed" if pacman.trans_init(pacman.TRANS_TYPE_SYNC, pacman.TRANS_FLAG_NOCONFLICTS, None, None, None) == -1: print "trans_init() failed" i = pacman.db_getpkgcache(db) while i: pkg = pacman.void_to_PM_PKG(pacman.list_getdata(i)) pkgname = pacman.void_to_char(pacman.pkg_getinfo(pkg, pacman.PKG_NAME)) if pacman.trans_addtarget(pkgname): print "failed to add target '%s' (%s)" % ( pkgname, pacman.strerror(pacman.cvar.pm_errno)) break i = pacman.list_next(i) junk = pacman.LISTp_new() if pacman.trans_prepare(junk) == -1: