source: soft/build_system/build_system/mkcd/tags/V4_1_4_1mdk/mkcd @ 1

Last change on this file since 1 was 1, checked in by fasma, 12 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 19.3 KB
Line 
1#!/usr/bin/perl -I /home/warly/files/cvs/mdk/soft/mkcd/pm/
2#
3# Copyright (C) 2000,2001,2002,2003,2004,2005 Mandrakesoft
4#
5# Author: Florent Villard <warly@mandraesoft.com>
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2, or (at your option)
10# any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20#
21# to prepare, create and burn iso images
22#
23
24my $VERSION = "4.1.2";
25
26use strict;
27use File::NCopy qw(copy);       
28use Mkcd::Commandline qw(parseCommandLine usage);
29use Mkcd::Tools qw(printTable getTracks du cpal checkcds cleanrpmsrate config compute_md5 include_md5 convert_size);
30use Mkcd::Group;
31use Mkcd::Package qw(check_rpmsrate packageOutOfRpmsrate getLeaves list_hdlist mkcd_build_hdlist %ARCH genDeps);
32use Mkcd::Config qw(%config);
33use MDK::Common qw(all);
34use packdrake;
35
36our %FUNCTIONS;
37our $functions;
38our $optimize;
39our $LOG;
40
41our $topdir = `pwd`;
42chop $topdir;
43
44$config{group} = new Mkcd::Group(\%config);
45$functions = $config{group}{disc}{functions}{functions};
46my $arg = @ARGV;
47our @params;
48@params = ( 
49    #    [ "one letter option", "long name option", "number of args (-X means Žat least XŽ)", "help text", "function to call", "log info"]
50    [ "", "mkcd", 0, "<options>", 
51    "mkcd Mandrakelinux Disc maker", 
52    sub { $arg or usage('mkcd', \@params) }, "" ],
53    [ "a", "auto", [
54        ["", "auto", -1, "<repository> <extra RPMS directory 1> <extra RPMS directory 2> ... <extra RPMS directory n>", 
55        "Auto mode configuration", 
56        sub {   
57            my ($tmp, @arg) = @_;
58            $tmp->[0] ||= {};
59            push @$tmp, @arg;
60            1
61        }, "Setting auto mode arguments"],
62        ["c", "cd", 1, "<number of discs>", 
63        "Max number of discs", 
64        sub { my ($tmp, $cd) = @_; if ($cd =~ /\d+/) { $tmp->[0]{cd} = $cd } else { return 0 }; 1 }, "Setting max number of discs"],
65        ["s", "sources", [
66          [ "", "sources", 0, "<options>", 
67          "Sources mode options", 
68            sub {   my ($tmp) = @_;
69                $tmp->[0] ||= {};
70                1
71            }, "Setting source mode options" ],
72          [ "s", "separate", 0, "", 
73          "Separate binaries discs from sources discs", 
74          sub { my ($tmp) = @_; $tmp->[0]{separate} = 1 }, "Setting source mode separate option" ]
75        ], "", 
76        "Create SRPMS discs too", 
77        sub { my ($tmp, $opt) = @_; $tmp->[0]{sources} = $opt }, "Setting source mode"],
78        ["", "noisolinux", 0, "", 
79        "Do not use a isolinux boot", 
80        sub { my ($tmp) = @_; $tmp->[0]{noisolinux} = 1 }, "Setting noisolinux option"]
81], "[options] <repository> <extra RPMS directory 1> <extra RPMS directory 2> ... <extra RPMS directory n>", 
82"Automated mode, build discs from a repository.", \&auto_mode, "Auto mode" ],
83    [ "", "addmd5", 1, "<iso file>", 
84    "Add md5sum to iso header.", 
85    sub { my $err = include_md5(pop, 1, 1); print $err }, "Adding md5 to ISO header" ],
86    [ "", "arch", 1, "<architecture>", 
87    "Specify a architecture (ia64, ppc), x86 is the default.", 
88    sub { $config{arch} = pop }, "Specifying the achitecture" ],
89    [ "k", "checkmd5", 1, "<iso file>", 
90    "Checking md5sum of iso header.", 
91    sub { my $err = include_md5(pop, 0, 1); print $err }, "Checking md5 of ISO header" ],
92    [ "", "bugzilla", 0, "", 
93    "Use bugzilla as information source.", 
94    sub { $config{bugzilla} = 1 }, "Using Bugzilla" ],
95    [ "b", "builddir", 1, "<build dir>", 
96    "Where live iso image are created (default current dir).", 
97    sub { $config{builddir} = pop @_ }, "Setting the build directory" ],
98    [ "", "buildhdlist", -1, "<rpms dir 1> <rpms dir 2> ... <rpms dir n>", "Build hdlist.cz files for given directories.", 
99    sub {
100        my $i;
101        mkcd_build_hdlist(int @_, 
102                [ 0, 
103                map { 
104                    $i++;
105                    if (/(.*)(hdlist.*\.cz)$/) { 
106                        { done => 1, hdlist => $_, synthesis => "$1synthesis.$2" } 
107                    } else {
108                        { rpms => [ glob "$_/*.rpm" ], hdlist => "./hdlist$i.cz", synthesis => "./synthesis.hdlist$i.cz" } 
109                    }
110                } @_ ], "$config{tmp}/.build_hdlist", 'depslist.ordered', 'provides', 'compss')
111    }, "building hdlist files" ],
112    [ "", "batch", 2, "<discs list> <batch file>", 
113    "batch mode to rebuilt discs from a previous session.",  \&batchMode, "Batch mode" ],
114    [ "c", "catto", 1, "<log file>", 
115    "Log file.", 
116    sub { 
117        $config{log} = pop @_; 
118        open $LOG, ">$config{log}" or die "unable to open $config{log}\n";
119        print $LOG, "command line: @ARGV\n"
120    }, "Log file" ],
121    [ "", "checkdeps", -1, "<RPMS dir 1> <RPMS dir 2> ... <RPMS dir n>", 
122    "Check coherency of a set of directories.", \&check_deps, "Checking dependencies" ],
123    [ "", "cpu", 1, "<cpu number>", 
124    "Force cpu number", 
125    sub { $config{cpu} = shift }, "Setting cpu number" ],
126    [ "", "listrpmsrate", 1, "<rpmsrate file>", 
127    "List the package in the rpmsrate file", \&packageOutOfRpmsrate, "Listing rpmsrate file" ],
128    [ "", "checkrpmsrate", -2, "<rpmsrate file> <rpms dir 1> <rpms dir 2> ... <rpms dir n>", 
129    "List the package in the rpmsrate file and not in the given repositories", \&check_rpmsrate, "Checking rpmsrate file" ],
130    [ "d", "depslist-creation", 0 , "", 
131    "rebuild the desplist.ordered file before checking the list.", 
132    sub { $config{deps} = 1 }, "Depslist creation switch" ],
133    [ "", "discsize", 1 , "<disc size in bytes>", 
134    "Select a custom disc size (default $config{discsize}).", 
135    sub { $config{discsize} = convert_size(pop, $config{discsize}, $config{LOG}) }, "Custom disc size selection" ],
136    [ "f", "fast", 0 , "", "fast mode.", sub { 
137        $config{fast} = 1;
138        $config{disc_building_tries} = 1;
139        $optimize = 0;
140        $config{optimize_space} = 0;
141        1
142    }, "Fast mode" ],
143    [ "", "getleaves", 1, "<depslist file>", 
144    "Getting leaves from a depslist.ordered file", \&getLeaves, "Getting leaves from a depslist.ordered" ],
145# FIXME function help should take 0 or one argument, but this is not possible with this structure
146    [ "h", "help", -1, "<path> <to> <the> <function>", 
147    "Display help, eg. mkcd -h installation fixed. Type mkcd -h config for configuration files options.", 
148    sub { 
149        my (@function) = @_; 
150        if (@function) { 
151            my $key = join '/', @function; 
152            if (ref $FUNCTIONS{$key}) {
153                usage($key, $FUNCTIONS{$key})
154            }
155        }
156        usage("mkcd", \@params);
157        }, "" ],
158    [ "", "check", -1, "<dir 1> <dir 2> ... <dir n>", 
159    "Check the hdlists, depslist and RPMS consistency.", 
160    sub { checkcds(@_) }, "Checking the hdlists, depslist and RPMs consistency" ],
161    [ "K", "checkdisc", 2, "<ISO mount point> <md5 file>", 
162    "Check the disc.", 
163    sub { check_discs(@_) }, "Checking the disc" ],
164    [ "i", "isodir", 1, "<iso dir>", 
165    "Where ISOs are built (default ./iso/product_name/).", 
166    sub { $config{isodir} = pop @_ }, "Setting the iso directory" ],
167    [ "l", "lists", 1 , "", 
168    "lists of discs taken into account.", 
169    sub { $config{lists} = getTracks(pop @_) }, "Using given disc list" ],
170    [ "m", "make", 1, "<cds number>", 
171    "Build the discs.", \&make , "Building the discs" ],
172    [ "", "nodeps", 0, "", 
173    "Do not include automatically dependencies of packages", 
174    sub { $config{nodeps} = 1 }, "Setting nodeps flag" ],
175    [ "", "nofork", 0, "", 
176    "Do not fork", 
177    sub { $config{nofork} = 1 }, "Setting nofork flag" ],
178    [ "", "nolive", 0, "", 
179    "Do not create live image of the discs.", 
180    sub { $config{nolive} = 1 }, "Setting nolive option" ],
181    [ "", "noiso", 0, "", 
182    "Do not create iso images of the discs.", 
183    sub { $config{noiso} = 1 }, "Setting noiso option" ],
184    [ "", "nosrcfit", 0, "", 
185    "Do not stop if sources discs are full", 
186    sub { $config{nosrcfit} = 1 }, "Setting nosrcfit option" ],
187    [ "", "nosrc", 0, "", 
188    "Do not include sources", 
189    sub { $config{nosrc} = 1 }, "Setting nosrc option" ],
190    [ "", "oem", -1, "<root of disc 1> <root of disc 2> ... <root of disc n>", 
191    "Build a OEM installation CD based on the given disc", \&oem, "Building oem disc" ],
192    [ "", "struct", 1 , "<struct>", 
193    "Build ISO with a specific structure", 
194    sub { $config{struct_version} = shift }, "Selecting the structure version" ],
195    [ "p", "printscript", 1, "<script file>", 
196    "Print the script that can be use to rebuild the discs", 
197    sub { $config{printscript} = shift }, "Printing script" ],
198    [ "", "printdiscsfiles", 1, "<file>", 
199    "Print the contains of each disc", 
200    sub { $config{print} = shift }, "Printing disc contains" ],
201    [ "", "pl", -1, "<hdlist 1> <hdlist 2> ... <hdlist n>", 
202    "Do a packdrake -l on the hdlists", 
203    sub { list_hdlist(\@_,1) }, "Printing hdlist contents" ],
204    [ "s", "spec", 1, "<config file>", 
205    "Configuration file", 
206    sub { config(shift, \%config, $functions, \%FUNCTIONS) } , "Loading configuration file" ],
207    [ "", "shell", 0, "", 
208    "Activate a mkcd shell to dynamically chose package to include", 
209    sub { $config{shell} = 1 ; $config{disc_building_tries}++ }, "Preparing mkcd shell" ],
210    [ "t", "topdir", 1, "<top dir>", 
211    "Where files are created (default current dir).", 
212    sub { $config{topdir} = pop @_; $config{tmp} = $ENV{TMPDIR} || "$config{$topdir}/tmp" }, "Setting the top directory" ],
213    [ "", "testlist", 3, "<config file> <list number> <rpmsrate_file>", 
214    "Perform a rapide resolution of the file list.", \&test_list, "Testing the file list" ],
215    [ "", "update-rpmsrate", -2, "<rpmsrate> <rpms directory 1> <rpms directory 2> ... <rpms directory n>", 
216    "Add major to libraries in rpmsrate", 
217        sub { 
218            my %rpm;
219            my $rpmsrate = shift @_;
220            foreach my $d (@_) { $rpm{$d} = [ map { s,$d/?(.*)\.rpm$,$1,; $_ } glob "$d/*.rpm" ] };
221            cleanrpmsrate($rpmsrate, 0, 0, \%rpm)
222        }, "Adding major to libraries in rpmsrate" ],
223    [ "", "verbose", 1 , "<log level>",
224    "Print more messages (the higher the more, 5 is the higher)",
225    sub { $config{verbose} = shift; 1 }, "Setting the verbose flag" ],
226    [ "v", "version", 0, "", "Print program version", 
227        sub {
228            print_fh($config{LOG}, "\nmkcd version $VERSION\n");
229            1 }, "" ],
230    [ "", "disc_building_tries", 1 , "<maximum number of iteration to build correct ISO size>",
231    "Set the number of iterations when trying to adjust ISO size",
232    sub { $config{disc_building_tries} = shift; $optimize = 1; 1 }, "Setting the disc_building_tries value" ],
233    [ "", "use_optimize_space", 1 , "<number of disc building tries>",
234    "Use optimize_space algorythm",
235    sub {
236        my $t = shift;
237        $config{disc_building_tries} = $t;
238        $optimize = 1;
239        $config{optimize_space} = $t
240        }, "Setting the disc_building_tries value" ],
241    [ "P", "Publisher", 1 , "<publisher name>",
242    "Set the publisher name for ISO header publisher_id (128 char max)",
243    sub { $config{Publisher} = substr shift, 0, 128 }, "Setting the publisher ID flag" ],
244#    [ "", "test", 0 , "", "Set the publisher name for ISO header publisher_id (128 char max)", sub { print "ARCH ", keys %{$config{ARCH}} , "\n\n" }, "Setting the publisher ID flag"],
245);
246
247# FIXME this permit to have specific help
248foreach (@params) {
249    $FUNCTIONS{$_->[1]} = ref($_->[2]) ? $_->[2] : [ $_ ]
250}
251
252$FUNCTIONS{mkcd} = \@params;
253foreach my $k (keys %$functions) {
254    $FUNCTIONS{$k} = $functions->{$k};
255    foreach (@{$functions->{$k}}) {
256        $FUNCTIONS{"$k/$_->[1]"} = ref($_->[2]) ? $_->[2] : [ $_ ]
257    }
258    push @{$FUNCTIONS{config}} , $functions->{$k}[0]
259}
260
261open($LOG, ">&STDERR");
262$config{LOG} = $LOG;
263
264my $todo = parseCommandLine("mkcd", \@ARGV, \@params);
265@ARGV and usage("mkcd", \@params, "@ARGV, too many arguments");
266foreach my $t (@$todo)  {
267    print $LOG "mkcd: $t->[2]\n";
268    &{$t->[0]}(@{$t->[1]}) or print $LOG "ERROR: $t->[2]\n";
269}
270
271# FIXME only to make perl_checker happy
272sub print_fh {
273    my ($fh, $text) = @_;
274    print $fh $text
275}
276
277sub batchMode {
278    my ($cds, $file) = @_;
279    config($file, \%config, $functions, \%FUNCTIONS);
280    my ($discsFiles, $cd) = readBatchFile($file);
281    (my $lists,$cds) = getDiscsList($cds);
282    my @mkisos;
283    my @size;
284    Mkcd::Disc::makeDiscs(0,$lists,$cds, \@size, \@mkisos,$discsFiles);
285    Mkcd::Disc::makeDiscs(1,$lists,$cds, \@size, \@mkisos,$discsFiles,$cd);
286}
287
288sub getDiscsList {
289    my ($cds) = @_;
290    $cds = getTracks($cds);
291    print $LOG "getDiscList: discs @$cds\n";
292    my %list;
293    $cds = [grep { if (ref $config{disc}[$_]) { $list{$_} = 2; push @{$config{lists}}, $_; 1 } else { print $LOG "WARNING: disc $_ not defined\n"; 0 } } @$cds];
294    $config{lists} ||= $cds;
295    $config{lists} = [ grep { $list{$_} or ref $config{disc}[$_] and $list{$_} = 1 or print $LOG "WARNING: disc $_ not defined\n" and 0 } @{$config{lists}}];
296    foreach (@{$config{virtual_disc}}) {
297        $list{$_} = 1;
298        push @{$config{lists}}, $_
299    }
300    return \%list,$cds
301}
302
303sub auto_mode {
304    my ($opt, $repository, @rpms) = @_;
305    $config{nolive} = 1;
306    $config{nosrcfit} = 1;
307    $config{deps} = 1;
308    if (!$optimize) {
309        $config{disc_building_tries} = 1;
310        $config{optimize_space} = 0;
311    }
312    my $struct_v = $config{struct_version};
313    my $install_dir = $config{struct}{$struct_v}{install};
314    my $media_dir = $config{struct}{$struct_v}{media_base};
315    -d "$repository/$media_dir" or print "ERROR: $repository/$media_dir does not exist\n" and return 0;
316    my $dir = "$repository/$media_dir";
317    opendir my $DIR, $dir;
318    foreach (readdir $DIR) {
319        -d "$dir/$_" or next;
320        m/^(media_info|\..*)$/ and next;
321        print $LOG "auto_mode: adding $dir/$_\n";
322        unshift @rpms, "$dir/$_"
323    }
324    my ($name, $tag);
325    if (-f "$repository/VERSION") {
326        open my $A, "$repository/VERSION";
327        local $_;
328        <$A> and /^Mandrakelinux (.*) \d{8} \d{2}:\d{2}$/ and ($name,$tag) = split ' ', $1;
329        close $A
330    }
331    $name ||= "Cooker-download";
332    $config{name} = $name;
333    foreach (keys %$opt) { $config{list}[1]{$_} = $opt->{$_} }
334    $config{list}[1]{auto} = 1;
335    my $media_info_dir = "$repository/$config{struct}{$struct_v}{media_info}";
336    if (-d $media_info_dir) {
337        opendir my $basedir, $media_info_dir;
338        foreach my $file (readdir $basedir) {
339            $file =~ /^pubkey/ or next;
340            push @{$config{list}[1]{keyfiles}}, "$media_info_dir/$file"
341        }
342        closedir $basedir
343    }
344    foreach (keys %{$config{list}[1]}) { print $LOG "auto_mode: list options $_ -> $config{list}[1]{$_}\n" }
345    foreach (@rpms) {
346        #       $size += du($_);
347        push @{$config{list}[1]{packages}}, { rpm => [ $_ ], srpm => \@rpms }
348    }
349    my %cd = (0 => 2);
350    my @cd = 1;
351    #print $LOG "Total RPMS $size\n";
352    $config{disc}[1]{size} = $config{discsize};
353    $config{disc}[1]{serial} = "${name}-disc1";
354    $config{disc}[1]{name} = 1;
355    $config{disc}[1]{longname} = "Mandrakelinux $name";
356    $config{disc}[1]{appname} = "Mandrakelinux $name disc 1";
357    $config{disc}[1]{label} = substr "$name-Disc1", 0, 32;
358    my $idx = 1;
359    my %idx;
360    &{$functions->{dir}[0][5]}(1,$idx, "rpms", $config{struct}{$struct_v}{media});
361    $idx++;
362    &{$functions->{generic}[0][5]}(1,$idx, "rpms",1);
363    &{$functions->{generic}[2][5]}(1,$idx);
364    $idx++;
365    $idx{installation} = $idx;
366    &{$functions->{installation}[0][5]}(1,$idx);
367    &{$functions->{installation}[5][5]}(1,$idx, $repository);
368    &{$functions->{installation}[10][5]}(1,$idx, $tag);
369    &{$functions->{installation}[14][5]}(1,$idx);
370    &{$functions->{installation}[18][5]}(1,$idx, "1/rpms");
371    $idx++;
372    &{$functions->{boot}[0][5]}(1,$idx);
373    my $isolinux_dir = $config{struct}{$struct_v}{isolinux};
374    my $images_dir = $config{struct}{$struct_v}{images};
375    if (-w "$repository/$isolinux_dir/isolinux.bin" && !$opt->{noisolinux}) {
376        &{$functions->{boot}[1][5]}(1,$idx, { isolinux => 1 });
377        &{$functions->{boot}[2][5]}(1,$idx, { bootimg => 1 }, "$isolinux_dir/isolinux.bin");
378        &{$functions->{boot}[3][5]}(1,$idx, { first => 1 }, "$repository/$isolinux_dir");
379        &{$functions->{boot}[3][5]}(1,$idx, { first => 1, dest => "$install_dir"}, "$repository/$images_dir");
380    } else {
381        my $bootimg = $config{arch} eq 'ia64' ? 'all.img' : "cdrom.img";
382        &{$functions->{boot}[2][5]}(1,$idx, { bootimg => 1, dir => "Boot" }, "$images_dir/$bootimg");
383        &{$functions->{boot}[3][5]}(1,$idx, { first => 1, dest => "$install_dir"}, "$repository/$images_dir");
384    }
385    if ($opt->{sources}) {
386        $config{nosrcfit} = 0;
387        if ($opt->{sources}{separate}) {
388            $config{disc}[2]{size} = $config{discsize};
389            $config{disc}[2]{serial} = "${name}-2-src";
390            $config{disc}[2]{name} = 2;
391            $config{disc}[2]{longname} = "Mandrakelinux $name sources";
392            $config{disc}[1]{appname} = "Mandrakelinux $name sources disc 2";
393            push @cd,2;
394            $cd{2} = 2;
395            &{$functions->{dir}[0][5]}(2,1, "srpms", $config{struct}{$struct_v}{srpm_media});
396            &{$functions->{generic}[0][5]}(2,2, "srpms",1);
397            &{$functions->{generic}[1][5]}(2,2, { source => 1 });
398            &{$functions->{installation}[17][5]}(1, $idx{installation}, "2/srpms")
399        } else {
400            $idx++;
401            &{$functions->{dir}[0][5]}(1,$idx, "srpms", $config{struct}{$struct_v}{srpm_media});
402            $idx++;
403            &{$functions->{generic}[0][5]}(1,$idx, "srpms",1);
404            &{$functions->{generic}[1][5]}(1,$idx, { source => 1 });
405            &{$functions->{installation}[17][5]}(1, $idx{installation}, "1/srpms")
406        }
407    } else {
408        &{$functions->{installation}[6][5]}(1,$idx)
409    }
410    printTable(\%config);
411    $config{group}->makeWithGroups(\%cd, \@cd);
412    1   
413}
414
415sub make {
416    my ($cds) = @_;
417    $config{group}->makeWithGroups(getDiscsList($cds));
418    1
419}               
420
421sub oem {
422    my (@cds) = @_;
423}
424
425sub check_discs {
426    my ($mntpt, $mdfile) = @_;
427    local *A; open A, $mdfile;
428    my %ignore;
429    my $sum;
430    local $_;
431    while (<A>) {
432        chomp;
433        last if ($sum) = /^(.*) - /;
434        my $t = "/$_";
435        $t =~ s,//+,/,g;
436        $ignore{$t} = 1
437    }
438    close A;
439    my $hexdigest = compute_md5([[ "/", $mntpt ]], \%ignore);
440    if ($hexdigest eq $sum) {
441        print "\nOK ($hexdigest)\n"
442    } else {
443        print "\nFAILED (computed $hexdigest <> expected $sum)\n";
444        return 0
445    }
446    1
447}
448
449sub check_deps {
450    my (@rep) = @_;
451    my %group;
452    my $tmpdir = "$config{tmp}/mkcd_check_deps";
453    -d $tmpdir or mkdir $tmpdir or die "FATAL: could not create $tmpdir";
454    foreach (@rep) { push @{$group{rep_pkg}{$_}}, grep { s/\.rpm$// } all $_  }
455    $group{urpm} = genDeps($tmpdir, $group{rep_pkg}, 0, $config{verbose}, $config{tmp});
456    $group{option} = {};
457    $group{rejected} = {};
458    Mkcd::List::reverseDepslist({}, \%group, {}, 1);
459    foreach my $rpm (sort keys %{$group{rejected}}) {
460        print "$rpm ", join (' ', map { map { $_->[1] } @$_ } values %{$group{rejected}{$rpm}}), "\n"
461    }
462}
463
464sub test_list {
465    my ($config_file, $list, $rpmsrate) = @_;
466    config($config_file, \%config, $functions, \%FUNCTIONS);
467    my $class = $config{group};
468    my $discs_files;
469    my $rpmlist;
470    my %group = (
471        list => {
472            $list => { },
473        },
474        orderedlist => { rpm => [ $list ] },
475    );
476    Mkcd::Group::getGroupReps(\%config, \%group, $discs_files);
477    # fake rpm list
478    foreach my $dir (keys %{$group{rep_pkg}{rpm}}) {
479        foreach my $rpm (@{$group{rep_pkg}{rpm}{$dir}}) {
480            $group{urpm}{rpm}{$rpm} = 1;
481            $group{size}{$rpm}{$list}[2] = 0;
482            push @{$group{listrpm}{$list}}, $rpm
483        }
484    }
485    ($group{filelist}, my $norpmsrate) = $class->{list}->getList(\%group, $discs_files);
486    $group{rpmsrate} = cleanrpmsrate($rpmsrate, "$config{tmp}/rpmsrate", $norpmsrate, $group{rep_pkg}{rpm}, $group{urpm});
487    $class->{list}->build_list(\%group, 1);
488    1
489}
Note: See TracBrowser for help on using the repository browser.