From 57bd8fc53a8a72ef7ae552ecdae160121269966f Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Tue, 29 Oct 2013 14:22:36 +0100 Subject: [PATCH] example: Update simple_createrepo.py example --- examples/python/simple_createrepo.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/python/simple_createrepo.py b/examples/python/simple_createrepo.py index e6624a6..e5b3478 100755 --- a/examples/python/simple_createrepo.py +++ b/examples/python/simple_createrepo.py @@ -16,6 +16,7 @@ def do_repodata(path): if not os.path.exists(new_repodata_path): shutil.move(repodata_path, new_repodata_path) break + x += 1 os.mkdir(repodata_path) # Prepare metadata files @@ -23,9 +24,9 @@ def do_repodata(path): pri_xml_path = os.path.join(repodata_path, "primary.xml.gz") fil_xml_path = os.path.join(repodata_path, "filelists.xml.gz") oth_xml_path = os.path.join(repodata_path, "other.xml.gz") - pri_db_path = os.path.join(repodata_path, "primary.sqlite.gz") - fil_db_path = os.path.join(repodata_path, "filelists.sqlite.gz") - oth_db_path = os.path.join(repodata_path, "other.sqlite.gz") + pri_db_path = os.path.join(repodata_path, "primary.sqlite") + fil_db_path = os.path.join(repodata_path, "filelists.sqlite") + oth_db_path = os.path.join(repodata_path, "other.sqlite") pri_xml = cr.PrimaryXmlFile(pri_xml_path) fil_xml = cr.FilelistsXmlFile(fil_xml_path) @@ -48,6 +49,7 @@ def do_repodata(path): # Process all packages for filename in pkg_list: pkg = cr.package_from_rpm(filename) + pkg.location_href = os.path.basename(filename) print "Processing: %s" % pkg.nevra() pri_xml.add_pkg(pkg) fil_xml.add_pkg(pkg) -- 2.7.4