Jump to content

urpmi mini How To


Guest anon
 Share

Recommended Posts

Why did you say my name? It's not like I can move it or anything, so talk to one of the mods. And when I originally replied, the forum layout hadn't been changed. So there. :P

Link to comment
Share on other sites

  • 3 weeks later...
Guest DirtDart

I usually store the RPMs from the distro CDs, and a few others like Texstar's, on my local developement box, then use FTP to install new stuff.

 

Well, quickly found that I needed more-updated hdlist.cz files. To create them, I found a script called genhdlist which makes the hdlist.cz files. From what I've read, it used to be included with a few distros but not anymore for some strange reason.

 

Anyway, here is the script, for those that want it. NOTE: I did not write this and take no credit for doing anything execpt finding it on the 'net.

 

#!/usr/bin/perl

 

use strict;

use URPM;

use URPM::Build;

use File::Find;

use File::Path;

 

my $urpm = new URPM;

my $tmpdir = "/tmp/genhdlist";

my $index="hdlist.cz";

my $synthesis="synthesis.$index";

my $dir = @ARGV[0] or die "usage: genhdlist <dir>";

 

chdir $dir or die "can't chdir in directory $dir";

 

# get rpm list

my @rpms;

File::Find::find({wanted => &wanted}, ".");

sub wanted {

if (-f $_ && $_ =~ /^.*.rpm$/ ) {

print "$File::Find::namen";

push(@rpms, $File::Find::name);

}

}

if (!@rpms) {

print "no rpms found, abortingn";

exit(0);

}

 

# create index file

mkpath($tmpdir);

$urpm->parse_rpms_build_headers(dir => $tmpdir,

rpms => @rpms);

@{$urpm->{depslist}} > 0 or die "nothing read";

$urpm->build_hdlist(start => 0,

end => $#{$urpm->{depslist}},

dir => $tmpdir,

hdlist => $index,

ratio => 9);

rmtree($tmpdir);

 

# create synthesis file

$urpm->build_synthesis(start => 0,

end => $#{$urpm->{depslist}},

synthesis => $synthesis);

 

# create list file

open(LIST, "> list") or die "can't create list file list: $!";

foreach my $rpm (@rpms) { print LIST "$rpmn" };

close(LIST);

 

 

 

Hope this helps.

 

 

 

 

DirtDart

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...