diff --git a/src/parsehdr.c b/src/parsehdr.c index 6f5fb55d..2b75e99d 100644 --- a/src/parsehdr.c +++ b/src/parsehdr.c @@ -425,6 +425,8 @@ cr_package_from_header(Header hdr, // Calculate pre value if (num_flags & (RPMSENSE_PREREQ | RPMSENSE_SCRIPT_PRE | + RPMSENSE_POSTTRANS | + RPMSENSE_PRETRANS | RPMSENSE_SCRIPT_POST)) { pre = 1; diff --git a/tests/python/tests/test_contentstat.py b/tests/python/tests/test_contentstat.py index 319bd34f..5669b6b1 100644 --- a/tests/python/tests/test_contentstat.py +++ b/tests/python/tests/test_contentstat.py @@ -38,10 +38,10 @@ def test_contentstat(self): self.assertTrue(os.path.isfile(path)) - self.assertEqual(cs.size, 2668) + self.assertEqual(cs.size, 2805) self.assertEqual(cs.checksum_type, cr.SHA256) - self.assertEqual(cs.checksum, "67bc6282915fad80dc11f3d7c3210977a0bde"\ - "05a762256d86083c2447d425776") + self.assertEqual(cs.checksum, "d447983b39363a6519067ce477a7fc64409b4"\ + "900e0160da68d66b25207a0408d") def test_contentstat_ref_in_xmlfile(self): """Test if reference is saved properly""" diff --git a/tests/python/tests/test_package.py b/tests/python/tests/test_package.py index a41aaa0f..21f10028 100644 --- a/tests/python/tests/test_package.py +++ b/tests/python/tests/test_package.py @@ -53,7 +53,7 @@ def test_package_empty(self): def test_package_archer(self): pkg = cr.package_from_rpm(PKG_ARCHER_PATH) self.assertTrue(pkg) - self.assertEqual(pkg.pkgId, "4e0b775220c67f0f2c1fd2177e626b9c863a098130224ff09778ede25cea9a9e") + self.assertEqual(pkg.pkgId, "65dd4d39b7539cb0b6b150db20a314402845e006cc0456d910bce87741f81b82") self.assertEqual(pkg.name, "Archer") self.assertEqual(pkg.arch, "x86_64") self.assertEqual(pkg.version, "3.4.5") @@ -63,16 +63,16 @@ def test_package_archer(self): self.assertEqual(pkg.description, "Archer package") self.assertEqual(pkg.url, "http://soo_complex_package.eu/") #self.assertEqual(pkg.time_file, 1365416502) - self.assertEqual(pkg.time_build, 1365416480) + self.assertEqual(pkg.time_build, 1710742930) self.assertEqual(pkg.rpm_license, "GPL") self.assertEqual(pkg.rpm_vendor, "ISIS") self.assertEqual(pkg.rpm_group, "Development/Tools") self.assertEqual(pkg.rpm_buildhost, "localhost.localdomain") self.assertEqual(pkg.rpm_sourcerpm, "Archer-3.4.5-6.src.rpm") - self.assertEqual(pkg.rpm_header_start, 280) - self.assertEqual(pkg.rpm_header_end, 2865) + self.assertEqual(pkg.rpm_header_start, 4504) + self.assertEqual(pkg.rpm_header_end, 7517) self.assertEqual(pkg.rpm_packager, "Sterling Archer") - self.assertEqual(pkg.size_package, 3101) + self.assertEqual(pkg.size_package, 7737) self.assertEqual(pkg.size_installed, 0) self.assertEqual(pkg.size_archive, 544) self.assertEqual(pkg.location_href, None) @@ -85,16 +85,18 @@ def test_package_archer(self): ('fooc', 'EQ', '0', '3', None, False), ('food', 'LT', '0', '4', None, False), ('fooe', 'GT', '0', '5', None, False), - ('foof', 'EQ', '0', '6', None, True) + ('foof', 'EQ', '0', '6', None, True), + ('foog', 'EQ', '0', '7', None, True), + ('fooh', 'EQ', '0', '8', None, True) ]) self.assertEqual(pkg.provides, [ + ('Archer', 'EQ', '2', '3.4.5', '6', False), + ('Archer(x86-64)', 'EQ', '2', '3.4.5', '6', False), ('bara', 'LE', '0', '22', None, False), ('barb', 'GE', '0', '11.22.33', '44', False), ('barc', 'EQ', '0', '33', None, False), ('bard', 'LT', '0', '44', None, False), - ('bare', 'GT', '0', '55', None, False), - ('Archer', 'EQ', '2', '3.4.5', '6', False), - ('Archer(x86-64)', 'EQ', '2', '3.4.5', '6', False) + ('bare', 'GT', '0', '55', None, False) ]) self.assertEqual(pkg.conflicts, [ ('bba', 'LE', '0', '2222', None, False), diff --git a/tests/python/tests/test_parsepkg.py b/tests/python/tests/test_parsepkg.py index 4ab6a29d..5b358642 100644 --- a/tests/python/tests/test_parsepkg.py +++ b/tests/python/tests/test_parsepkg.py @@ -53,8 +53,8 @@ def test_xml_from_rpm(self): self.assertTrue(xml) self.assertTrue(len(xml) == 3) self.assertTrue("Archer" in xml[0]) - self.assertTrue('' in xml[1]) - self.assertTrue('' in xml[2]) + self.assertTrue('' in xml[1]) + self.assertTrue('' in xml[2]) # Test error cases diff --git a/tests/python/tests/test_sqlite.py b/tests/python/tests/test_sqlite.py index 5247a3c3..7faa7552 100644 --- a/tests/python/tests/test_sqlite.py +++ b/tests/python/tests/test_sqlite.py @@ -155,22 +155,23 @@ def test_sqlite_primary(self): # Check packages table res = con.execute("select * from packages").fetchall() self.assertEqual(res, - [(1, u'4e0b775220c67f0f2c1fd2177e626b9c863a098130224ff09778ede25cea9a9e', + [(1, u'65dd4d39b7539cb0b6b150db20a314402845e006cc0456d910bce87741f81b82', u'Archer', u'x86_64', u'3.4.5', u'2', u'6', u'Complex package.', u'Archer package', u'http://soo_complex_package.eu/', - res[0][10], 1365416480, u'GPL', u'ISIS', u'Development/Tools', - u'localhost.localdomain', u'Archer-3.4.5-6.src.rpm', 280, 2865, - u'Sterling Archer', 3101, 0, 544, None, None, u'sha256')]) + res[0][10], 1710742930, u'GPL', u'ISIS', u'Development/Tools', + u'localhost.localdomain', u'Archer-3.4.5-6.src.rpm', 4504, 7517, + u'Sterling Archer', 7737, 0, 544, None, None, u'sha256')]) # Check provides table self.assertEqual(con.execute("select * from provides").fetchall(), - [(u'bara', u'LE', u'0', u'22', None, 1), + [(u'Archer', u'EQ', u'2', u'3.4.5', u'6', 1), + (u'Archer(x86-64)', u'EQ', u'2', u'3.4.5', u'6', 1), + (u'bara', u'LE', u'0', u'22', None, 1), (u'barb', u'GE', u'0', u'11.22.33', u'44', 1), (u'barc', u'EQ', u'0', u'33', None, 1), (u'bard', u'LT', u'0', u'44', None, 1), - (u'bare', u'GT', u'0', u'55', None, 1), - (u'Archer', u'EQ', u'2', u'3.4.5', u'6', 1), - (u'Archer(x86-64)', u'EQ', u'2', u'3.4.5', u'6', 1)]) + (u'bare', u'GT', u'0', u'55', None, 1)]) + # Check conflicts table self.assertEqual(con.execute("select * from conflicts").fetchall(), @@ -195,7 +196,9 @@ def test_sqlite_primary(self): (u'fooc', u'EQ', u'0', u'3', None, 1, u'FALSE'), (u'food', u'LT', u'0', u'4', None, 1, u'FALSE'), (u'fooe', u'GT', u'0', u'5', None, 1, u'FALSE'), - (u'foof', u'EQ', u'0', u'6', None, 1, u'TRUE')]) + (u'foof', u'EQ', u'0', u'6', None, 1, u'TRUE'), + (u'foog', u'EQ', u'0', u'7', None, 1, u'TRUE'), + (u'fooh', u'EQ', u'0', u'8', None, 1, u'TRUE')]) # Check files table self.assertEqual(con.execute("select * from files").fetchall(), @@ -219,7 +222,7 @@ def test_sqlite_filelists(self): # Check packages table self.assertEqual(con.execute("select * from packages").fetchall(), - [(1, u'4e0b775220c67f0f2c1fd2177e626b9c863a098130224ff09778ede25cea9a9e')]) + [(1, u'65dd4d39b7539cb0b6b150db20a314402845e006cc0456d910bce87741f81b82')]) # Check files table self.assertEqual(set(con.execute("select * from filelist").fetchall()), @@ -245,7 +248,7 @@ def test_sqlite_other(self): # Check packages table self.assertEqual(con.execute("select * from packages").fetchall(), - [(1, u'4e0b775220c67f0f2c1fd2177e626b9c863a098130224ff09778ede25cea9a9e')]) + [(1, u'65dd4d39b7539cb0b6b150db20a314402845e006cc0456d910bce87741f81b82')]) # Check filelist table self.assertEqual(set(con.execute("select * from filelist").fetchall()), diff --git a/tests/python/tests/test_xml_file.py b/tests/python/tests/test_xml_file.py index fad87641..5584a8e1 100644 --- a/tests/python/tests/test_xml_file.py +++ b/tests/python/tests/test_xml_file.py @@ -196,13 +196,13 @@ def test_xmlfile_add_pkg(self): Archer x86_64 - 4e0b775220c67f0f2c1fd2177e626b9c863a098130224ff09778ede25cea9a9e + 65dd4d39b7539cb0b6b150db20a314402845e006cc0456d910bce87741f81b82 Complex package. Archer package Sterling Archer http://soo_complex_package.eu/ -