Re: Creating complete repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <ckittlitz@xxxxxxxxx> 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 <frankly3d@xxxxxxxxx> wrote:
On Mon, 24 Jun 2013 09:51:50 -0400
Chris Kittlitz <ckittlitz@xxxxxxxxx> 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
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum


_______________________________________________
Yum mailing list
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux