From 60002eef0eb1e4002135b6bf16c67d692c8dd746 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 31 Mar 2000 14:44:41 +0000 Subject: no_comment --- ChangeLog | 3 +++ Makefile | 4 ++-- autoirpm.update | 20 ++++++++++++----- rpme | 68 --------------------------------------------------------- rpmf | 23 ------------------- rpmf.8 | 58 ------------------------------------------------ urpmi | 2 +- urpmi.spec | 13 +++++++---- 8 files changed, 29 insertions(+), 162 deletions(-) delete mode 100644 rpme delete mode 100755 rpmf delete mode 100644 rpmf.8 diff --git a/ChangeLog b/ChangeLog index 99c2a79a..bb789a2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2000-03-26 Pixel + * autoirpm.update: adapted to new hdlist format. + use perl version of dirname and mkdir -p (for speed) + - urpmi can handle package files given on command line. It finds out the dependencies if possible. - don't try nodeps if file is missing diff --git a/Makefile b/Makefile index bb4e5a91..67cb70c2 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,10 @@ install: autoirpm.update-all $(MAKE) -C po $@ install -d $(BINDIR) $(SBINDIR) $(XBINDIR) $(URPMIDIR) $(URPMIDIR2) $(MANDIR)/man8 install -m 4755 urpmi $(BINDIR) - install _irpm rpm-find-leaves rpmf $(BINDIR) + install _irpm rpm-find-leaves urpmf $(BINDIR) install -m 644 autoirpm.deny $(URPMIDIR2) install -m 644 *.8 $(MANDIR)/man8 - install rpme urpmi.addmedia autoirpm.update autoirpm.uninstall $(SBINDIR) + install urpme urpmi.addmedia autoirpm.update autoirpm.uninstall $(SBINDIR) install -s autoirpm.update-all $(SBINDIR) ln -sf urpmi.addmedia $(SBINDIR)/urpmi.removemedia ln -sf urpmi.addmedia $(SBINDIR)/urpmi.update diff --git a/autoirpm.update b/autoirpm.update index 7be979ea..765aea6f 100644 --- a/autoirpm.update +++ b/autoirpm.update @@ -7,7 +7,7 @@ $BASE2 = "$DIR2/autoirpm"; $AUTO_INSTALL_BIN_LIST = "$BASE.binaries"; $INSTALL_SCRIPT_REP = "$BASE.scripts"; -system("gzip -dc $DIR/hdlist.*.gz | autoirpm.update-all $BASE2.allow $BASE2.deny - > $AUTO_INSTALL_BIN_LIST"); +system("bzip2 -dc $DIR/hdlist*.cz2 2>/dev/null | autoirpm.update-all $BASE2.allow $BASE2.deny - > $AUTO_INSTALL_BIN_LIST"); $? == 0 or die "autoirpm.upgrade-all failed\n"; open F, $AUTO_INSTALL_BIN_LIST or die; @@ -21,7 +21,7 @@ sub create_links_and_install_scripts($) { foreach (@progs) { lstat "/$_" and return } # verify that it's not installed foreach (@progs) { - make_dirname("/$_"); + mkdir_(dirname("/$_")); symlink $script, "/$_"; # or die "$rpm: /$_"; } @@ -31,8 +31,16 @@ sub create_links_and_install_scripts($) { chmod 0755, "$script"; } -sub make_dirname($) { - my $file = $_[0]; - my $dir = `dirname $file`; - `mkdir -p $dir 2>/dev/null`; +sub dirname { local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' } + +sub mkdir_ { + -d $_[0] and return; + + my $root = dirname $_[0]; + if (-e $root) { + -d $root or die "mkdir: error creating directory $_[0]: $root is a file and i won't delete it\n"; + } else { + mkdir_($root); + } + mkdir $_[0], 0755 or die "mkdir: error creating directory $_: $!\n"; } diff --git a/rpme b/rpme deleted file mode 100644 index a4a8cb99..00000000 --- a/rpme +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl - -local $_ = join '', @ARGV; - -/-h/ || @ARGV == 0 and die "usage: rpme [-a] [--auto] \n"; - -$matches = /-a/; -$auto = /-auto/; - -my $DIR = "/var/lib/urpmi"; - -@l = grep { !/^-/ } @ARGV; -if (!$matches) { - @m = map { chop; $_ } `rpm -q @l 2>&1`; - if ($?) { - $maymatch = "unknown package(s) " . join(", ", map { /package (\S+) is not installed/ ? $1 : () } @m) . "\n"; - $auto || @l > 1 and die $maymatch; - } -} -if ($matches || $maymatch) { - my $match = join "|", @l; - @m = grep { /$match/ } map { chop; $_ } `rpm -qa`; - - if ($maymatch) { - @m or die $maymatch; - print "Using $match as a substring, I found:\n@m\nRemove them all? (y/N) "; - =~ /y/i or exit 1; - } -} - -load_provides(); -my %toremove; @toremove{$_, @{$provides{$_} || []}} = () foreach @m; -my $changed = 1; while ($changed) { $changed = 0; - local *F; - open F, "rpm -e --test " . join(" ", keys %toremove) . " 2>&1 |"; - foreach () { - if (/package (\S+) is not installed/) { - delete $toremove{$1}; - } elsif (/is needed by (\S+)/ && ! exists $toremove{$1}) { - $toremove{$1} = 1; - $changed = 1; - } - } -} -my @toremove = keys %toremove or die "nothing to remove\n"; -if (@toremove > @l && !$auto) { - my $sum = 0; map { $sum += $_ } `rpm -q --queryformat "%{SIZE}\n" @toremove`; - print "To satisfy dependencies, the following packages are going to be removed"; - printf " (%d MB)", toMb($sum); - print ":\n@toremove\nIs it ok? (Y/n) "; - =~ /n/i and exit 0; -} -system("rpm", "-e", @toremove); - - -sub load_provides { - local *F; - open F, "$DIR/depslist" or return; - foreach () { - my ($p, $size, @l) = split; - $size{$p} = $size; - push @{$provides{$_}}, $p foreach @l; - } -} -sub toMb { - my $nb = $_[0] / 1024 / 1024; - int $nb + 0.5; -} diff --git a/rpmf b/rpmf deleted file mode 100755 index 235c4903..00000000 --- a/rpmf +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -if [ "$#" -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then - echo "usage: rpmf []" - exit 1 -fi - -dir="/var/lib/urpmi" - - -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 - diff --git a/rpmf.8 b/rpmf.8 deleted file mode 100644 index 3cf4998b..00000000 --- a/rpmf.8 +++ /dev/null @@ -1,58 +0,0 @@ -.TH rpmf 8 "29 Feb 2000" "Mandrakesoft" "Linux-Mandrake" -.IX rpmf -.SH NAME -rpmf \- RPMFind - Finds the RPM package providing the specified file -.SH SYNOPSIS -.B rpmf [<\fIFile\fP>] -.SH DESCRIPTION -rpmf outputs a list of packages providing the file specified as an argument. -.PP -<\fIFile\fP> is the name of the file you wish to know the package providing it. Note that you may type just a substring of the file you are looking for, \fBrpmf\fP will then print a list of matching files with their corresponding packages. -.PP -rpmf searches through installed and uninstalled packages. -.SH FILES -/usr/bin/rpmf -.br -The \fBrpmf\fP executable (perl script) -.PP -/var/lib/urpmi/list.* -.br -Contains the list of all packages known by urpmi and their location. There is one filelist per media(*). -.PP -/var/lib/urpmi/hdlist.* -.br -Contain information about all known packages, it's a summary of rpm headers. There is one filelist per media(*). -.PP -/etc/urpmi/urpmi.cfg -.br -Contains one line <\fIname\fP> <\fIurl\fP> per media. -.PP -/var/lib/urpmi/depslist -.br -A simple text file containing all dependencies of all known packages. -.PP -/var/lib/urpmi/depslist.html -.br -The same but in html format, user readable. -.SH "SEE ALSO" -urpmi(8), -urpmi.addmedia(8), -urpmi.update(8), -urpmi.removemedia(8), -autoirpm(8), -autoirpm-icons(8), -gurpmi(8), -rpmdrake(8) -.SH AUTHOR -Pascal Rigaux, Mandrakesoft -.br -pixel@mandrakesoft.com - - - - - - - - - diff --git a/urpmi b/urpmi index 616b4ccf..8d962214 100755 --- a/urpmi +++ b/urpmi @@ -206,7 +206,7 @@ sub closure_deps { $to_install->{$_} = undef; my @notfound; - my @d = @{$deps{$_}} or return $_; + my @d = @{$deps{$_}} or next; up: foreach (@d) { my %l; foreach (split '\|') { diff --git a/urpmi.spec b/urpmi.spec index b7da4a60..3e8100a6 100644 --- a/urpmi.spec +++ b/urpmi.spec @@ -2,7 +2,7 @@ Name: urpmi Version: 1.1 -Release: 3mdk +Release: 4mdk License: GPL Source0: %{name}.tar.bz2 Summary: User mode rpm install @@ -46,6 +46,8 @@ make PREFIX=$RPM_BUILD_ROOT install install -d $RPM_BUILD_ROOT/var/lib/urpmi/autoirpm.scripts install -m 644 autoirpm.deny $RPM_BUILD_ROOT/etc/urpmi +echo "Use urpmf instead" > $RPM_BUILD_ROOT/usr/bin/rpmf + cd $RPM_BUILD_ROOT/usr/bin ; mv -f rpm-find-leaves urpmi_rpm-find-leaves %clean @@ -65,11 +67,11 @@ autoirpm.uninstall %attr(4750, root, urpmi) /usr/bin/urpmi /usr/bin/urpmi_rpm-find-leaves /usr/bin/rpmf -/usr/sbin/rpme +/usr/bin/urpmf +/usr/sbin/urpme /usr/sbin/urpmi.* /usr/share/locale/*/LC_MESSAGES/urpmi.po -/usr/man/man*/urpmi* -/usr/man/man*/rpmf* +/usr/man/man*/urpm* %files -n gurpmi %defattr(-,root,root) @@ -86,6 +88,9 @@ autoirpm.uninstall %changelog +* Sun Mar 26 2000 Pixel 1.1-4mdk +- autoirpm.update: adapted to new hdlist format + * Sun Mar 26 2000 Pixel 1.1-3mdk - urpmi can handle package files given on command line. It finds out the dependencies if possible. -- cgit v1.2.1