From c04c6a6c6a3412593e77cf31eb5ceefc46f87783 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 25 Feb 2014 07:17:39 +0100 Subject: record package metadata that describes co-installability Specifically all entries in the Conflicts header are saved in the conflict table, all entries in the Provides header are saved in the provide table (to cover conflicts with virtual packages) and packages using dpkg-divert in preinst get a magic "_dpkg-divert" entry in their conflict table. With this metadata it should be possible to compute undeclared file conflicts. --- readyaml.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'readyaml.py') diff --git a/readyaml.py b/readyaml.py index 2ef9a3b..50603b1 100755 --- a/readyaml.py +++ b/readyaml.py @@ -31,6 +31,8 @@ def readyaml(db, stream): if pid is not None: cur.execute("DELETE FROM content WHERE pid = ?;", (pid,)) cur.execute("DELETE FROM dependency WHERE pid = ?;", (pid,)) + cur.execute("DELETE FROM conflict WHERE pid = ?;", (pid,)) + cur.execute("DELETE FROM provide WHERE pid = ?;", (pid,)) cur.execute("UPDATE package SET version = ?, architecture = ?, source = ? WHERE id = ?;", (metadata["version"], metadata["architecture"], metadata["source"], pid)) else: @@ -40,6 +42,10 @@ def readyaml(db, stream): pid = cur.lastrowid cur.executemany("INSERT INTO dependency (pid, required) VALUES (?, ?);", ((pid, dep) for dep in metadata["depends"])) + cur.executemany("INSERT INTO conflict (pid, conflicting) VALUES (?, ?);", + ((pid, conflict) for conflict in metadata["conflicts"])) + cur.executemany("INSERT INTO provide (pid, provided) VALUES (?, ?);", + ((pid, provided) for provided in metadata["provides"])) for entry in gen: if entry == "commit": db.commit() -- cgit v1.2.3