[debexpo-devel] issue 81 (repeated uploads)
Serafeim Zanikolas
serzan at hellug.gr
Tue Mar 24 23:14:40 CET 2009
Hi,
I've been silent due to major personal changes (new country/job).
I attach a patch WRT the thread with msg-id 20090215232522.GI3693 at localhost
(repeated uploads). Briefly, instead of giving up when a package is
re-uploaded, it keeps a copy of the old files, tries to import the new set of
files, and restores the old files if it fails. It doesn't use a transaction
because by the time it gets to update the db, it's clear that the import has
succeeded.
The patch works (it deals gracefuly with re-uploads of the same pkg) but at
this point it's intended as a platform for discussion. WRT the db records,
when a pkg is re-uploaded, it:
keeps the records from the previous upload in the table:
packages
adds new recs and keeps the old ones in:
package_info
inserts a new rec in:
package_versions
and removes the old recs and inserts new recs in:
source_packages
binary_packages
package_files (recs are meant to reference either a src or a bin pkg;
a rec is removed if it references neither)
Somehow the ORM mapper, without being explicitly instructed, also deletes the
old record from package_versions, which orphans the package_info and
package_comments. I don't understand why this happens, especially so given
that package_versions reference the packages table, which isn't touched at
all during re-imports.
BTW I'm assuming that we do want to keep comments and plugin results for
previous uploads. The idea is that when browsing a package one will see the
plugin results and comments for the latest upload, but may also choose to see
the relevant data for previous uploads. It gets a lot simpler if we don't care
about previous uploads.
Cheers,
Serafeim
More information about the debexpo-devel
mailing list