Commit fdbd42c9 authored by Luca Giambonini's avatar Luca Giambonini

bug fix when moving packages from one repo to an other.

the current code from the automatic detection and the manual are alligned
parent 737479dd
......@@ -312,11 +312,6 @@ def do_remove_pkg(options, dbname, arch, pkgs):
#create_signature(dbpath + AKABEI_DB_EXT)
setchown(dbname, dbpath + AKABEI_DB_EXT + ".sig")
# ok now remove for real the pkg and the signature if present (can be moved before the remove_pkg function is called)
for pkg in pkgs:
if os.path.isfile(pkg): os.remove(pkg)
if os.path.isfile(pkg + ".sig"): os.remove(pkg + ".sig")
status_succes()
# internal function
......@@ -344,16 +339,10 @@ def do_move_pkg(options, dbsrcName, dbdestName, arch, pkgs):
if dbdestName:
warning("pkg(s) to be moved from [%s] to [%s] are:\n%s" % (dbsrcName, dbdestName, "\n".join(str(x) for x in pkgs)))
if options.dryrun: return
# move the files to the new directory
_move_pkg(options, dbsrcName, dbdestName, arch, pkgs)
# remove the pkg(s) to the current db
do_remove_pkg(options, dbsrcName, arch, pkgs)
# move the files to the new directory
for pkg in pkgs:
os.rename(os.path.join(CHAKRA_REPO, dbsrcName, arch, pkg), os.path.join(CHAKRA_REPO, dbdestName, arch, pkg))
if os.path.isfile(os.path.join(CHAKRA_REPO, dbsrcName, arch, pkg + ".sig")):
os.rename(os.path.join(CHAKRA_REPO, dbsrcName, arch, pkg + ".sig"), os.path.join(CHAKRA_REPO, dbdestName, arch, pkg + ".sig"))
# add the pkg(s) to the destination db
do_add_pkg(options, dbdestName, arch, pkgs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment