Re: Creating complete repository

Chris Kittlitz <[email protected]> Mon, 24 Jun 2013 11:15:07 -0400
Newsgroups gmane.linux.rpm.yum
Message-ID <CAD-XgHsXKMwtb3J7EBbL4V9CZDO24A6Br=HhnG9AeFvJBz3p=Q@mail.gmail.com>
I've created a perl script which does this somewhat.  It is rough - my
first stab at it.  And it doesn't handle more than one provider very well.

Here it is.

use strict;
use warnings;
#use List::MoreUtils;
#use Util::Any;

# Read in all the packages
my @packages = (@ARGV);

# Process each set of packages.
my $p=0;
while ($p <= $#packages ) {
    # Get the list of packages from p to the end.
    my $next = join(' ',@packages[$p..$#packages]);
    print "Processing packages $next ($p-$#packages)...\n";
    $p=$#packages + 1;
    open(DEPS, "yum deplist $next|") || die "Failed $! $next\n";
    chomp(my @lines = <DEPS>);
    my $count=0;
    while ($count <= $#lines) {
    if ($lines[$count] =~ /dependency: (.*)/ ) {
        my $dep=$1;
        $count++;
        my @providers = ();
        while ($count <= $#lines && $lines[$count] =~ /provider: (.*)
(.*)/) {
        push(@providers, $1);
        $count++;
        }
        foreach (@providers) {
        my $provider=$_;
        if ($provider !~ /i386/) {
            if (!grep {$_ eq $provider} @packages) {
            # Add it
            print "  Adding package $provider\n";
            push(@packages, $provider);
            }
            last;
        }
        }
    } else {
        $count++;
    }
    }
}

# Print the results
print "\nPackages:\n";
my @sorted = sort @packages;
foreach (@sorted) {
    print "\t$_\n";
}


On Mon, Jun 24, 2013 at 10:32 AM, Chris Kittlitz <[email protected]>wrote:

> That is pretty much exactly what I am doing, however, I need to know how
> to get the list of packages.
>
>
>
>
> On Mon, Jun 24, 2013 at 10:00 AM, Frank Murphy <[email protected]>wrote:
>
>> On Mon, 24 Jun 2013 09:51:50 -0400
>> Chris Kittlitz <[email protected]> wrote:
>>
>> > I suppose we could set up a system and then clone it, but we may be
>> > including packages we don't need or missing ones that we do need.
>> > I want create the minimal list and then test it.
>> >
>> > Thanks!
>> >
>>
>> Maybe modify to suit:
>>
>> http://www.howtoforge.com/how-to-create-a-kickstart-file-for-centos-fedora-redhat-rhel
>>
>>
>> --
>> Regards,
>> Frank  "When in doubt PANIC!"
>>  I check for new mail app. 20min
>> www.frankly3d.com
>> _______________________________________________
>> Yum mailing list
>> [email protected]
>> http://lists.baseurl.org/mailman/listinfo/yum
>>
>
>

_______________________________________________
Yum mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum