From 7ae5fce08dd4a02652e48d689d19b91a6fa6954a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 7 Mar 2000 23:25:41 +0000 Subject: no_comment --- Makefile | 2 +- rpmf | 18 +++++++++++------- urpmf | 18 +++++++++++------- urpmi.addmedia | 59 ++++++++++++++++++---------------------------------------- urpmi.spec | 14 ++++++++++---- 5 files changed, 51 insertions(+), 60 deletions(-) diff --git a/Makefile b/Makefile index 9f3eeb12..01c0dbde 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ install: autoirpm.update-all install -m 4755 urpmi $(BINDIR) install _irpm rpm-find-leaves rpmf $(BINDIR) install -m 644 autoirpm.deny $(URPMIDIR2) - for i in *.8; do bzip2 -c $$i > $(MANDIR)/man8/$$i.bz2 ; done + install -m 644 *.8 $(MANDIR)/man8 install urpmi.addmedia autoirpm.update autoirpm.uninstall $(SBINDIR) install -s autoirpm.update-all $(SBINDIR) ln -sf urpmi.addmedia $(SBINDIR)/urpmi.removemedia diff --git a/rpmf b/rpmf index d42f07bb..235c4903 100755 --- a/rpmf +++ b/rpmf @@ -5,15 +5,19 @@ if [ "$#" -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then exit 1 fi -hdlist="/var/lib/urpmi/hdlist.*.gz" +dir="/var/lib/urpmi" -if ! ls $hdlist >/dev/null 2>/dev/null; then + +if ls $dir/hdlist.*.gz >/dev/null 2>/dev/null; then + found=1 + gzip -dc $dir/hdlist.*.gz | hdlist2files - | grep -E "$1" +fi +if ls $dir/hdlist.*.cz2 >/dev/null 2>/dev/null; then + found=1 + bzip2 -dc $dir/hdlist.*.cz2 2>/dev/null | hdlist2files - | grep -E "$1" +fi +if [ "$found" != "1" ]; then echo "urpmi is not installed" exit 1 fi -if [ -z "$1" ]; then - gzip -dc $hdlist | hdlist2files - -else - gzip -dc $hdlist | hdlist2files - | grep -E $1 -fi diff --git a/urpmf b/urpmf index d42f07bb..235c4903 100755 --- a/urpmf +++ b/urpmf @@ -5,15 +5,19 @@ if [ "$#" -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then exit 1 fi -hdlist="/var/lib/urpmi/hdlist.*.gz" +dir="/var/lib/urpmi" -if ! ls $hdlist >/dev/null 2>/dev/null; then + +if ls $dir/hdlist.*.gz >/dev/null 2>/dev/null; then + found=1 + gzip -dc $dir/hdlist.*.gz | hdlist2files - | grep -E "$1" +fi +if ls $dir/hdlist.*.cz2 >/dev/null 2>/dev/null; then + found=1 + bzip2 -dc $dir/hdlist.*.cz2 2>/dev/null | hdlist2files - | grep -E "$1" +fi +if [ "$found" != "1" ]; then echo "urpmi is not installed" exit 1 fi -if [ -z "$1" ]; then - gzip -dc $hdlist | hdlist2files - -else - gzip -dc $hdlist | hdlist2files - | grep -E $1 -fi diff --git a/urpmi.addmedia b/urpmi.addmedia index 0d8823f9..468e675d 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -24,8 +24,8 @@ if ($0 =~ /removemedia/) { die "nothing to remove (use urpmi.addmedia to add a media)\n"; foreach $e (/^--?a/ ? @entries : @ARGV) { my $f; - $f = "$DIR/hdlist.$e"; unlink($f) || unlink("$f.gz") or warn "failed to remove $f"; - $f = "$DIR/list.$e"; unlink($f) or warn "failed to remove $f"; + $f = "$DIR/hdlist.$e"; unlink("$f.cz2") or warn "failed to remove $f"; + $f = "$DIR/list.$e"; unlink($f) or warn "failed to remove $f"; substInFile { s/^/\#/ if /^$e\s/ } $CFG; } system("urpmi.update"); @@ -37,11 +37,8 @@ if ($0 =~ /removemedia/) { } if (glob("$DIR/hdlist.*")) { print "generating dependencies list\n"; - system("gzip -f $DIR/hdlist.* 2>/dev/null"); # gzip - system("gzip -dc $DIR/hdlist.* | gendepslist -h $DEPSLIST -"); + system("gendepslist2 $DIR/hdlist.* > $DEPSLIST"); system("autoirpm.update"); - } else { - unlink $DEPSLIST, "$DEPSLIST.html"; } exit 0; } @@ -82,53 +79,33 @@ substInFile { } $CFG; -my $HDLIST = "$DIR/hdlist.$name"; +my $HDLIST = "$DIR/hdlist.$name.cz2"; my $RPMLIST = "$DIR/list.$name"; -e $DIR || mkdir $DIR, 0755 or die "can't create $DIR"; !-e $HDLIST || unlink $HDLIST or die "can't remove $HDLIST"; -!-e "$HDLIST.gz" || unlink "$HDLIST.gz" or die "can't remove $HDLIST.gz"; - -my $mask = umask 077; -open LIST, ">$RPMLIST" or die "can't output $RPMLIST"; -umask $mask; if (my ($prefix, $dir) = $url =~ m,^(removable_.*?|file):/(.*),) { - my $hdlist = ''; - my $flush = sub {}; - if (-e (my $f = "$dir/Mandrake/base/hdlist.gz")) { - system("cp -f $f $HDLIST.gz"); - } elsif (-e (my $f = "$dir/Mandrake/base/hdlist")) { - system("gzip -cf $f > $HDLIST.gz"); + if (-e (my $f = "$dir/Mandrake/base/hdlist.cz2")) { + system("cp -f $f $HDLIST"); } else { - $flush = sub { system("rpm2header $hdlist | gzip >> $HDLIST.gz") if $hdlist }; - } - print "scanning $dir..."; - my $realdir = readlink($dir) || $dir; - open F, "find '$realdir' -name '*.rpm'|"; - foreach () { - chomp; - if (length "$hdlist $_" > 1500) { - &$flush(); - $hdlist = ''; - } - $hdlist .= " $_"; - print LIST "$prefix:/$_\n"; + system("genhdlist_cz2 -o $HDLIST $dir"); } - $hdlist or die "no rpms found in $dir"; - &$flush(); - close F or die "searching for rpms failed"; - print "\n"; } else { system("wget -O $HDLIST $url/$ftp_hdlist"); $? == 0 or die "wget of $url/$ftp_hdlist failed (maybe wget is missing?)"; - open F, "hdlist2names $HDLIST|"; - foreach () { - chomp; - print LIST "$url/$_\n"; - } - close F or die "hdlist2names failed"; } + +my $mask = umask 077; +open LIST, ">$RPMLIST" or die "can't output $RPMLIST"; +umask $mask; + +open F, "bzip2 -dc $HDLIST 2>/dev/null | hdlist2names - |"; +foreach () { + chomp; + print LIST "$url/$_\n"; +} +close F or die "hdlist2names failed"; close LIST; system("urpmi.update") unless $noupdate; diff --git a/urpmi.spec b/urpmi.spec index ee8e74b8..6700a0b7 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -1,12 +1,12 @@ %define group Utilities/System Name: urpmi -Version: 1.0 -Release: 2mdk +Version: 1.1 +Release: 1mdk License: GPL Source0: %{name}.tar.bz2 Summary: User mode rpm install -Requires: /usr/bin/suidperl /usr/bin/rpm2header /usr/bin/hdlist2files /usr/bin/hdlist2names /usr/bin/gendepslist eject +Requires: /usr/bin/suidperl, rpmtools >= 1.1, eject BuildRoot: /tmp/%{name} Group: %{group} @@ -17,6 +17,10 @@ well-known rpms to be installed. You can compare rpm vs. urpmi with insmod vs. modprobe %changelog +* Tue Mar 7 2000 Pixel 1.1-1mdk +- new version, compatible with new DrakX and new rpmtools +- add man page for rpmf + * Mon Feb 28 2000 Pixel 1.0-2mdk - unset $BASH_ENV @@ -160,7 +164,8 @@ autoirpm.uninstall /usr/bin/rpmf /usr/sbin/urpmi.* /usr/share/locale/*/LC_MESSAGES/urpmi.po -%doc /usr/man/man*/urpmi* +/usr/man/man*/urpmi* +/usr/man/man*/rpmf %files -n gurpmi %defattr(-,root,root) @@ -171,5 +176,6 @@ autoirpm.uninstall %dir /var/lib/urpmi/autoirpm.scripts /etc/urpmi/autoirpm.deny /usr/sbin/autoirpm.* +/usr/man/man*/autoirpm* /usr/bin/_irpm %doc README-autoirpm-icons autoirpm.README -- cgit v1.2.1