1 |
Author: zmedico |
2 |
Date: 2009-04-30 06:58:43 +0000 (Thu, 30 Apr 2009) |
3 |
New Revision: 13463 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/bin/egencache |
7 |
main/branches/2.1.6/man/egencache.1 |
8 |
Log: |
9 |
Add a --repo option, allowing cache to be generated for overlays. (trunk r13292) |
10 |
|
11 |
Modified: main/branches/2.1.6/bin/egencache |
12 |
=================================================================== |
13 |
--- main/branches/2.1.6/bin/egencache 2009-04-30 06:58:28 UTC (rev 13462) |
14 |
+++ main/branches/2.1.6/bin/egencache 2009-04-30 06:58:43 UTC (rev 13463) |
15 |
@@ -34,6 +34,9 @@ |
16 |
parser.add_option("--update", |
17 |
action="store_true", |
18 |
help="update metadata/cache/ (generate as necessary)") |
19 |
+ parser.add_option("--repo", |
20 |
+ action="store", |
21 |
+ help="name of repo to operate on (default repo is located at $PORTDIR)") |
22 |
parser.add_option("--cache-dir", |
23 |
help="location of the metadata cache", |
24 |
dest="cache_dir") |
25 |
@@ -126,7 +129,7 @@ |
26 |
max_jobs=max_jobs, max_load=max_load) |
27 |
self.returncode = os.EX_OK |
28 |
metadbmodule = portdb.mysettings.load_best_module("portdbapi.metadbmodule") |
29 |
- self._trg_cache = metadbmodule(portdb.porttree_root, |
30 |
+ self._trg_cache = metadbmodule(portdb.porttrees[0], |
31 |
"metadata/cache", portage.auxdbkeys[:]) |
32 |
if rsync: |
33 |
self._trg_cache.raise_stat_collision = True |
34 |
@@ -259,8 +262,8 @@ |
35 |
# completely controlled by commandline arguments. |
36 |
env = {} |
37 |
|
38 |
- # TODO: Implement --repo for choosing a repo. |
39 |
- env['PORTDIR_OVERLAY'] = '' |
40 |
+ if options.repo is None: |
41 |
+ env['PORTDIR_OVERLAY'] = '' |
42 |
|
43 |
if options.cache_dir is not None: |
44 |
env['PORTAGE_DEPCACHEDIR'] = options.cache_dir |
45 |
@@ -300,7 +303,16 @@ |
46 |
settings.lock() |
47 |
|
48 |
portdb = portage.portdbapi(settings["PORTDIR"], mysettings=settings) |
49 |
+ if options.repo is not None: |
50 |
+ repo_path = portdb.getRepositoryPath(options.repo) |
51 |
+ if repo_path is None: |
52 |
+ parser.error("Unable to locate repository named '%s'" % \ |
53 |
+ (options.repo,)) |
54 |
+ return 1 |
55 |
|
56 |
+ # Limit ebuilds to the specified repo. |
57 |
+ portdb.porttrees = [repo_path] |
58 |
+ |
59 |
cp_iter = None |
60 |
if atoms: |
61 |
cp_iter = iter(atoms) |
62 |
|
63 |
Modified: main/branches/2.1.6/man/egencache.1 |
64 |
=================================================================== |
65 |
--- main/branches/2.1.6/man/egencache.1 2009-04-30 06:58:28 UTC (rev 13462) |
66 |
+++ main/branches/2.1.6/man/egencache.1 2009-04-30 06:58:43 UTC (rev 13463) |
67 |
@@ -7,9 +7,7 @@ |
68 |
.SH "DESCRIPTION" |
69 |
The egencache program generates metadata cache for ebuild repositories and |
70 |
stores it in the \fImetadata/cache/\fR directory within the repository itself, |
71 |
-for distribution. Currenly, only the repository located at \fBPORTDIR\fR |
72 |
-(configured in \fBmake.conf(5)\fR) can be updated by this program, but a |
73 |
-future version will have the ability to select a different repository. |
74 |
+for distribution. |
75 |
.SH ACTIONS |
76 |
.TP |
77 |
.BR "\-\-update [ATOM] ... " |
78 |
@@ -40,6 +38,12 @@ |
79 |
.BR \-\-load\-average=LOAD |
80 |
Specifies that maximum load allowed when spawning multiple jobs. |
81 |
.TP |
82 |
+.BR "\-\-repo=REPO" |
83 |
+Name of the repo to operate on (default repo is located at \fBPORTDIR\fR). |
84 |
+The name should correspond the value of a \fBrepo_name\fR entry (see |
85 |
+\fBportage\fR(5)) from one of the repositories that is configured via the |
86 |
+\fBPORTDIR\fR or \fBPORTDIR_OVERLAY\fR variables (see \fBmake.conf\fR(5)). |
87 |
+.TP |
88 |
.BR "\-\-rsync" |
89 |
When used together with the \fB\-\-update\fR action, this enables a workaround |
90 |
for cases in which the content of a cache entry changes and neither the file |