Gentoo Archives: gentoo-commits

From: "André Erdmann" <dywi@×××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/pkgdir/distroot/
Date: Tue, 03 Sep 2013 15:51:05
Message-Id: 1378223247.f047cd03d8593462fdf49054d8d8e6e39495538d.dywi@gentoo
1 commit: f047cd03d8593462fdf49054d8d8e6e39495538d
2 Author: André Erdmann <dywi <AT> mailerd <DOT> de>
3 AuthorDate: Tue Sep 3 15:47:27 2013 +0000
4 Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
5 CommitDate: Tue Sep 3 15:47:27 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=f047cd03
7
8 distroot: sync_distmap()
9
10 This method adds files existing in the distroot to the distmap (unless they
11 already have an entry). IOW, this method is a subset of what check_integrity()
12 does.
13
14 ---
15 roverlay/overlay/pkgdir/distroot/distroot.py | 17 ++++++++++++++++-
16 1 file changed, 16 insertions(+), 1 deletion(-)
17
18 diff --git a/roverlay/overlay/pkgdir/distroot/distroot.py b/roverlay/overlay/pkgdir/distroot/distroot.py
19 index 9412202..ad0e2b6 100644
20 --- a/roverlay/overlay/pkgdir/distroot/distroot.py
21 +++ b/roverlay/overlay/pkgdir/distroot/distroot.py
22 @@ -346,6 +346,22 @@ class DistrootBase ( object ):
23 return self.distmap.add_entry_for_volatile ( p_info )
24 # --- end of distmap_update_entry (...) ---
25
26 + def sync_distmap ( self ):
27 + """Creates dummy entries for files missing in the distmap."""
28 + if self.distmap is not None:
29 + hash_pool = roverlay.util.hashpool.HashPool (
30 + ( self.distmap.get_hash_type(), ), self.HASHPOOL_JOB_COUNT,
31 + use_threads=True
32 + )
33 +
34 + for abspath, relpath in self.iter_distfiles ( False ):
35 + if relpath not in distmap:
36 + hash_pool.add ( relpath, abspath, None )
37 +
38 + for relpath, hashdict in hash_pool.run_as_completed():
39 + self.distmap.add_dummy_entry ( relpath, hashdict=hashdict )
40 + # --- end of sync_distmap (...) ---
41 +
42 def check_integrity ( self ):
43 """Verifies (and regenerates) the distmap:
44
45 @@ -356,7 +372,6 @@ class DistrootBase ( object ):
46 (c) drop distmap entries whose file do not exist
47 """
48 if self.distmap is not None:
49 - root = self.get_root()
50 distfiles = set()
51 distmap_hashtype = self.distmap.get_hash_type()
52 checkfile = self.distmap.check_digest_integrity