1 |
commit: da4b628c361f0ab07511a0ad257e0067e7d682d5 |
2 |
Author: Kent Fredric <kentfredric <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Jul 31 17:04:42 2012 +0000 |
4 |
Commit: Kent Fredric <kentfredric <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Jul 31 17:04:42 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=commit;h=da4b628c |
7 |
|
8 |
[script] Fast virtuals index |
9 |
|
10 |
--- |
11 |
scripts/lib/virtuals.pm | 185 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
1 files changed, 185 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/scripts/lib/virtuals.pm b/scripts/lib/virtuals.pm |
15 |
new file mode 100644 |
16 |
index 0000000..0e1e163 |
17 |
--- /dev/null |
18 |
+++ b/scripts/lib/virtuals.pm |
19 |
@@ -0,0 +1,185 @@ |
20 |
+package virtuals { |
21 |
+ |
22 |
+ use 5.16.0; |
23 |
+ use Moo; |
24 |
+ use Sub::Quote qw( quote_sub ); |
25 |
+ |
26 |
+ has items => ( |
27 |
+ is => rw =>, |
28 |
+ default => quote_sub(q{ [] }), |
29 |
+ ); |
30 |
+} |
31 |
+ |
32 |
+package virtual::record { |
33 |
+ use 5.16.0; |
34 |
+ use Moo; |
35 |
+ |
36 |
+ has package => ( is => rw =>, required => 1, ); |
37 |
+ has repo => ( is => rw =>, required => 1, ); |
38 |
+ |
39 |
+ sub virtual { |
40 |
+ my $self = shift; |
41 |
+ return $self->package =~ s/^/virtual\/perl-/r; |
42 |
+ } |
43 |
+ |
44 |
+ sub core { |
45 |
+ my $self = shift; |
46 |
+ return $self->package =~ s/^/perl-core\//r; |
47 |
+ } |
48 |
+}; |
49 |
+ |
50 |
+package virtuals::perl { |
51 |
+ use 5.16.0; |
52 |
+ use Moo; |
53 |
+ extends 'virtuals'; |
54 |
+ |
55 |
+ sub instance { |
56 |
+ my ( $class ) = shift; |
57 |
+ state $cache = do { |
58 |
+ $class->new(); |
59 |
+ }; |
60 |
+ return $class; |
61 |
+ } |
62 |
+ |
63 |
+ has +items => ( default => quote_sub(q| map { virtual::record->new( $_ , 'perl-experimental' ) } $_[0]->_packages; |) ); |
64 |
+ |
65 |
+ sub _packages { |
66 |
+ return qw( Archive-Extract |
67 |
+ B-Debug |
68 |
+ B-Lint |
69 |
+ CPAN |
70 |
+ CPANPLUS |
71 |
+ CPANPLUS-Dist-Build |
72 |
+ Devel-DProf |
73 |
+ Devel-PPPort |
74 |
+ Devel-SelfStubber |
75 |
+ Dumpvalue |
76 |
+ Exporter |
77 |
+ ExtUtils-MakeMaker |
78 |
+ File-Fetch |
79 |
+ Filter-Simple |
80 |
+ HTTP-Tiny |
81 |
+ IPC-SysV |
82 |
+ Log-Message |
83 |
+ Log-Message-Simple |
84 |
+ Math-Complex |
85 |
+ Module-CoreList |
86 |
+ NEXT |
87 |
+ Object-Accessor |
88 |
+ Pod-LaTeX |
89 |
+ Pod-Perldoc |
90 |
+ Pod-Plainer |
91 |
+ SelfLoader |
92 |
+ Term-UI |
93 |
+ Unicode-Collate |
94 |
+ Unicode-Normalize |
95 |
+ constant |
96 |
+ i18n-langtags |
97 |
+ if ); |
98 |
+ } |
99 |
+} |
100 |
+ |
101 |
+package virtuals::gentoo { |
102 |
+ use 5.16.0; |
103 |
+ use Moo; |
104 |
+ extends 'virtuals'; |
105 |
+ has +items => ( default => quote_sub(q| map { virtual::record->new( $_ , 'gentoo' ) } $_[0]->_packages; |), ); |
106 |
+ |
107 |
+ sub instance { |
108 |
+ my ( $class ) = shift; |
109 |
+ state $cache = do { |
110 |
+ $class->new(); |
111 |
+ }; |
112 |
+ return $class; |
113 |
+ } |
114 |
+ |
115 |
+ |
116 |
+ sub _packages { |
117 |
+ return qw( |
118 |
+ Archive-Tar |
119 |
+ Attribute-Handlers |
120 |
+ AutoLoader |
121 |
+ CGI |
122 |
+ Class-ISA |
123 |
+ Compress-Raw-Bzip2 |
124 |
+ CPAN-Meta |
125 |
+ CPAN-Meta-Requirements |
126 |
+ CPAN-Meta-YAML |
127 |
+ Data-Dumper |
128 |
+ DB_File |
129 |
+ digest-base |
130 |
+ Digest-MD5 |
131 |
+ Digest-SHA |
132 |
+ Encode |
133 |
+ ExtUtils-CBuilder |
134 |
+ ExtUtils-Command |
135 |
+ ExtUtils-Constant |
136 |
+ ExtUtils-Install |
137 |
+ ExtUtils-MakeMaker |
138 |
+ ExtUtils-Manifest |
139 |
+ ExtUtils-ParseXS |
140 |
+ File-Path |
141 |
+ File-Spec |
142 |
+ File-Temp |
143 |
+ Filter |
144 |
+ Getopt-Long |
145 |
+ IO |
146 |
+ IO-Compress |
147 |
+ IO-Zlib |
148 |
+ IPC-Cmd |
149 |
+ JSON-PP |
150 |
+ Locale-Maketext-Simple |
151 |
+ MIME-Base64 |
152 |
+ Math-BigInt |
153 |
+ Math-BigInt-FastCalc |
154 |
+ Memoize |
155 |
+ Module-Build |
156 |
+ Module-CoreList |
157 |
+ Module-Load |
158 |
+ Module-Load-Conditional |
159 |
+ Module-Loaded |
160 |
+ Module-Metadata |
161 |
+ Module-Pluggable |
162 |
+ Package-Constants |
163 |
+ Params-Check |
164 |
+ Parse-CPAN-Meta |
165 |
+ Perl-OSType |
166 |
+ Pod-Escapes |
167 |
+ Pod-Simple |
168 |
+ PodParser |
169 |
+ Safe |
170 |
+ Scalar-List-Utils |
171 |
+ Socket |
172 |
+ Storable |
173 |
+ Switch |
174 |
+ Sys-Syslog |
175 |
+ Term-ANSIColor |
176 |
+ Test |
177 |
+ Test-Harness |
178 |
+ Test-Simple |
179 |
+ Text-Balanced |
180 |
+ Text-ParseWords |
181 |
+ Text-Tabs+Wrap |
182 |
+ Thread-Queue |
183 |
+ Thread-Semaphore |
184 |
+ Time-HiRes |
185 |
+ Time-Local |
186 |
+ Time-Piece |
187 |
+ Version-Requirements |
188 |
+ XSLoader |
189 |
+ digest-base |
190 |
+ i18n-langtags |
191 |
+ libnet |
192 |
+ locale-maketext |
193 |
+ net-ping |
194 |
+ parent |
195 |
+ podlators |
196 |
+ threads |
197 |
+ threads-shared |
198 |
+ version |
199 |
+ ); |
200 |
+ } |
201 |
+}; |
202 |
+ |
203 |
+1; |
204 |
+ |