summaryrefslogtreecommitdiff
path: root/test/rpmdb-cache.py
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2022-08-02 19:18:29 +0900
committerbiao716.wang <biao716.wang@samsung.com>2022-08-04 15:42:15 +0900
commitf8781453269db52ea28bfdfe1de3f60e03db1370 (patch)
tree1a1002baa5e22cd70ef5b9eaed997968b7911806 /test/rpmdb-cache.py
parent29ec9f8128e658bc1883c2c99ce43b2d550a90ee (diff)
downloadyum-f8781453269db52ea28bfdfe1de3f60e03db1370.tar.gz
yum-f8781453269db52ea28bfdfe1de3f60e03db1370.tar.bz2
yum-f8781453269db52ea28bfdfe1de3f60e03db1370.zip
port code from python2.x to python3.x
Change-Id: Icc21ea029e40d82919e522f0ab5e99cc7a397399 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'test/rpmdb-cache.py')
-rwxr-xr-xtest/rpmdb-cache.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/test/rpmdb-cache.py b/test/rpmdb-cache.py
index 7768a93..fdfc92f 100755
--- a/test/rpmdb-cache.py
+++ b/test/rpmdb-cache.py
@@ -11,7 +11,7 @@ yb2 = yum.YumBase()
yb2.conf.cache = True
if len(sys.argv) > 1 and sys.argv[1].lower() == 'full':
- print "Doing full test"
+ print("Doing full test")
__provides_of_requires_exact__ = True
assert hasattr(yb1.rpmdb, '__cache_rpmdb__')
@@ -22,66 +22,66 @@ yb2.setCacheDir()
ver1 = yb1.rpmdb.simpleVersion(main_only=True)[0]
ver2 = yb2.rpmdb.simpleVersion(main_only=True)[0]
if ver1 != ver2:
- print >>sys.stderr, "Error: Version mismatch:", ver1, ver2
+ print("Error: Version mismatch:", ver1, ver2, file=sys.stderr)
# Conflicts
cpkgs1 = yb1.rpmdb.returnConflictPackages()
cpkgs2 = yb2.rpmdb.returnConflictPackages()
if len(cpkgs1) != len(cpkgs2):
- print >>sys.stderr, "Error: Conflict len mismatch:", len(cpkgs1),len(cpkgs2)
+ print("Error: Conflict len mismatch:", len(cpkgs1),len(cpkgs2), file=sys.stderr)
for pkg in cpkgs1:
if pkg not in cpkgs2:
- print >>sys.stderr, "Error: Conflict cache missing", pkg
+ print("Error: Conflict cache missing", pkg, file=sys.stderr)
for pkg in cpkgs2:
if pkg not in cpkgs1:
- print >>sys.stderr, "Error: Conflict cache extra", pkg
+ print("Error: Conflict cache extra", pkg, file=sys.stderr)
# File Requires
frd1, blah, fpd1 = yb1.rpmdb.fileRequiresData()
frd2, blah, fpd2 = yb2.rpmdb.fileRequiresData()
if len(frd1) != len(frd2):
- print >>sys.stderr, "Error: FileReq len mismatch:", len(frd1), len(frd2)
+ print("Error: FileReq len mismatch:", len(frd1), len(frd2), file=sys.stderr)
for pkgtup in frd1:
if pkgtup not in frd2:
- print >>sys.stderr, "Error: FileReq cache missing", pkgtup
+ print("Error: FileReq cache missing", pkgtup, file=sys.stderr)
continue
if len(set(frd1[pkgtup])) != len(set(frd2[pkgtup])):
- print >>sys.stderr, ("Error: FileReq[%s] len mismatch:" % (pkgtup,),
- len(frd1[pkgtup]), len(frd2[pkgtup]))
+ print(("Error: FileReq[%s] len mismatch:" % (pkgtup,),
+ len(frd1[pkgtup]), len(frd2[pkgtup])), file=sys.stderr)
for name in frd1[pkgtup]:
if name not in frd2[pkgtup]:
- print >>sys.stderr, ("Error: FileReq[%s] cache missing" % (pkgtup,),
- name)
+ print(("Error: FileReq[%s] cache missing" % (pkgtup,),
+ name), file=sys.stderr)
for pkgtup in frd2:
if pkgtup not in frd1:
- print >>sys.stderr, "Error: FileReq cache extra", pkgtup
+ print("Error: FileReq cache extra", pkgtup, file=sys.stderr)
continue
for name in frd2[pkgtup]:
if name not in frd1[pkgtup]:
- print >>sys.stderr, ("Error: FileReq[%s] cache extra" % (pkgtup,),
- name)
+ print(("Error: FileReq[%s] cache extra" % (pkgtup,),
+ name), file=sys.stderr)
# File Provides (of requires) -- not exact
if len(fpd1) != len(fpd2):
- print >>sys.stderr, "Error: FileProv len mismatch:", len(fpd1), len(fpd2)
+ print("Error: FileProv len mismatch:", len(fpd1), len(fpd2), file=sys.stderr)
for name in fpd1:
if name not in fpd2:
- print >>sys.stderr, "Error: FileProv cache missing", name
+ print("Error: FileProv cache missing", name, file=sys.stderr)
continue
if not __provides_of_requires_exact__:
continue # We might be missing some providers
if len(fpd1[name]) != len(fpd2[name]):
- print >>sys.stderr, ("Error: FileProv[%s] len mismatch:" % (pkgtup,),
- len(fpd1[name]), len(fpd2[name]))
+ print(("Error: FileProv[%s] len mismatch:" % (pkgtup,),
+ len(fpd1[name]), len(fpd2[name])), file=sys.stderr)
for pkgtup in fpd1[name]:
if pkgtup not in fpd2[name]:
- print >>sys.stderr,"Error: FileProv[%s] cache missing" % name,pkgtup
+ print("Error: FileProv[%s] cache missing" % name,pkgtup, file=sys.stderr)
for name in fpd2:
if name not in fpd1:
- print >>sys.stderr, "Error: FileProv cache extra", name
+ print("Error: FileProv cache extra", name, file=sys.stderr)
continue
for pkgtup in fpd2[name]:
if pkgtup not in fpd1[name]:
- print >>sys.stderr,"Error: FileProv[%s] cache extra" % name,pkgtup
+ print("Error: FileProv[%s] cache extra" % name,pkgtup, file=sys.stderr)