Re: [Patch] createrepo --check option take two
Hans-Peter Jansen <[email protected]>
| Newsgroups | gmane.linux.rpm.metadata |
|---|---|
| Message-ID | <[email protected]> |
Am Donnerstag, 26. Mai 2005 06:03 schrieb seth vidal: > On Tue, 2005-05-24 at 12:07 +0200, Hans-Peter Jansen wrote: > > Hi Seth, > > > > Here's a slightly reworked version of the --check option, it now > > checks the directory timestamp, containing the rpm, as it happened, > > that an older rpm appeared today in one of my rsyned suse update > > repos (due to some internal lags), which didn't triggered the > > rebuild, then.. > > > > As a nice plus, the number of stats are greatly decreased, if a dir > > in the repo is not up to date (not that it matters, compared to the > > following repo rebuild...). > > > > Do you think, it's worth to include it upstream now? > > quite possibly, yes. than please commit the attached patch on top of the previous. It fixes a problem, when the rpm files are in the current directory. That results in os.path.dirname() returning an empty string, which os.path.getmtime() doesn't like :-(. > There are some other things I'd like to see done to the > format/program as well: > 1. make the checksum be an internal package checksum and/or store a > cache of package checksums and rebuild based on timestamp change (for > quicker re-indexing of a repo) Will need to take a deeper look into things to grok this. > 2. split out the metadata some more as described a few months ago Do you have a pointer handy? Either I missed it, or I wasn't subscribed then.. > 3. work on any ways to make the repo creation as fast as possible. Sure, but this option already has a nice ROI for the pretty common case of an unchanged repo, but you're right, speeding up the creation case wouldn't harm also ;-). Pete _______________________________________________ Rpm-metadata mailing list [email protected] https://lists.dulug.duke.edu/mailman/listinfo/rpm-metadata
createrepo-check-option-curdir-fix.diff
(text/x-diff, 985 B)
--- genpkgmetadata.py~ 2005-05-24 11:42:40.000000000 +0200
+++ genpkgmetadata.py 2005-06-01 17:33:21.325771457 +0200
@@ -434,7 +434,10 @@
# check also the mtime of the dir, where the rpm resides to
# avoid a false positive, if an older rpm is mirrored lately
ts = os.path.getmtime(filename)
- dirts = os.path.getmtime(os.path.dirname(filename))
+ dn = os.path.dirname(filename)
+ if not dn:
+ dn = '.'
+ dirts = os.path.getmtime(dn)
if ts > repots or dirts > repots:
repots = 0
break
--- ChangeLog~ 2005-06-01 17:36:29.816894785 +0200
+++ ChangeLog 2005-06-01 22:02:32.422942134 +0200
@@ -1,3 +1,7 @@
+2005-06-01 22:01 Hans-Peter Jansen <[email protected]>
+
+ * genpkgmetadata.py: fix the "rpm in current dir" problem
+
2005-05-24 11:38 Hans-Peter Jansen <[email protected]>
* genpkgmetadata.py: