diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-01-04 00:02:06 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-01-04 00:02:06 +0000 |
commit | f041fbb500d8d8e272e72a87feccb8d8843f1204 (patch) | |
tree | cdbf97b370fbdcfe58f300cc79e55b84100289f7 | |
parent | 02378b711e6754e6946fd9cf1e1706aaeb20e749 (diff) | |
download | urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar.gz urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar.bz2 urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar.xz urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.zip |
no_comment
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Makefile | 14 | ||||
-rwxr-xr-x | rpmf | 19 | ||||
-rwxr-xr-x | urpmf | 19 | ||||
-rwxr-xr-x | urpmi | 2 | ||||
-rwxr-xr-x | urpmi.addmedia | 13 | ||||
-rw-r--r-- | urpmi.spec | 143 |
7 files changed, 205 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 00000000..554d4e26 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4 @@ +2000-01-04 Pixel <pixel@mandrakesoft.com> + + * urpmi.addmedia: replaced hdlist2files by hdlist2names + @@ -7,14 +7,16 @@ URPMIDIR = $(PREFIX)/var/lib/urpmi URPMIDIR2 = $(PREFIX)/etc/urpmi LOCALEDIR = $(PREFIX)/usr/share/locale +NAME = urpmi +TAR = $(NAME).tar.bz2 -.PHONY: install clean +.PHONY: install clean rpm 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 $(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 urpmi.addmedia autoirpm.update autoirpm.uninstall $(SBINDIR) @@ -27,7 +29,13 @@ autoirpm.update-all: %: %.cc $(CXX) -I/usr/include/rpm -g $< -lrpm -ldb1 -lz -o $@ tar: clean - cd .. ; tar cfy urpmi.tar.bz2 urpmi + cd .. ; tar cfy $(TAR) urpmi + +rpm: tar + cp -f ../$(TAR) $(RPM)/SOURCES + cp -f $(NAME).spec $(RPM)/SPECS/ + -rpm -ba $(NAME).spec + rm -f ../$(TAR) po: $(MAKE) -C $@ @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ "$#" -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "usage: rpmf [<file>]" + exit 1 +fi + +hdlist="/var/lib/urpmi/hdlist.*.gz" + +if ! ls $hdlist >/dev/null 2>/dev/null; then + echo "urpmi is not installed" + exit 1 +fi + +if [ -z "$1" ]; then + gzip -dc $hdlist | hdlist2files - +else + gzip -dc $hdlist | hdlist2files - | grep $1 +fi @@ -0,0 +1,19 @@ +#!/bin/sh + +if [ "$#" -gt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then + echo "usage: rpmf [<file>]" + exit 1 +fi + +hdlist="/var/lib/urpmi/hdlist.*.gz" + +if ! ls $hdlist >/dev/null 2>/dev/null; then + echo "urpmi is not installed" + exit 1 +fi + +if [ -z "$1" ]; then + gzip -dc $hdlist | hdlist2files - +else + gzip -dc $hdlist | hdlist2files - | grep $1 +fi @@ -85,7 +85,7 @@ if (!$auto and difference2(\@to_install, \@packages)) { `gmessage -default $ok -buttons "$ok:0,$cancel:2" "$msg:\n$p\n\n$msg2"`; $? and exit 0; } else { - print SAVEOUT "$msg:\n@to_install\n$msg2 (y/n) "; + print SAVEOUT "$msg:\n@to_install\n$msg2 (y/N) "; <STDIN> =~ /y/i or exit 0; } } diff --git a/urpmi.addmedia b/urpmi.addmedia index b1bc5f5c..72ef3cd8 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -96,13 +96,16 @@ umask $mask; if (my ($prefix, $dir) = $url =~ m,^(removable_.*?|file):/(.*),) { my $hdlist = ''; my $flush = sub {}; - if (-e (my $f = "$dir/Mandrake/base/hdlist")) { - system("gzip -f $f > $HDLIST.gz"); + 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"); } else { $flush = sub { system("rpm2header $hdlist | gzip >> $HDLIST.gz") if $hdlist }; } print "scanning $dir..."; - open F, "find $dir -follow -name '*.rpm'|"; + my $realdir = readlink($dir) || $dir; + open F, "find '$realdir' -name '*.rpm'|"; foreach (<F>) { chomp; if (length "$hdlist $_" > 1500) { @@ -119,12 +122,12 @@ if (my ($prefix, $dir) = $url =~ m,^(removable_.*?|file):/(.*),) { } else { system("wget -O $HDLIST $url/$ftp_hdlist"); $? == 0 or die "wget of $url/$ftp_hdlist failed (maybe wget is missing?)"; - open F, "hdlist2files $HDLIST|"; + open F, "hdlist2names $HDLIST|"; foreach (<F>) { chomp; print LIST "$url/$_\n"; } - close F or die "hdlist2files failed"; + close F or die "hdlist2names failed"; } close LIST; diff --git a/urpmi.spec b/urpmi.spec new file mode 100644 index 00000000..0d5025cc --- /dev/null +++ b/urpmi.spec @@ -0,0 +1,143 @@ +%define group Utilities/System + +Name: urpmi +Version: 0.9 +Release: 33mdk +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 +BuildRoot: /tmp/%{name} + +Group: %{group} +%description +urpmi enable non-superuser install of rpms. In fact, it only authorizes +well-known rpms to be installed. + +You can compare rpm vs. urpmi with insmod vs. modprobe + +%changelog +* Mon Dec 27 1999 Pixel <pixel@mandrakesoft.com> +- fixed a bug in urpmi.addmedia + +* Fri Dec 24 1999 Pixel <pixel@mandrakesoft.com> +- more i18n + +* Wed Dec 22 1999 Pixel <pixel@mandrakesoft.com> +- added urpmi_rpm-find-leaves + +* Mon Dec 20 1999 Pixel <pixel@mandrakesoft.com> +- bug fix in autoirpm.update + +* Sun Dec 19 1999 Pixel <pixel@mandrakesoft.com> +- bug fix for autoirpm (bad directory) +- enhancement to urpmi (in place gzip'ing) +- small cute enhancements + +* Sat Dec 18 1999 Pixel <pixel@mandrakesoft.com> +- a lot of i18n added (thx2pablo) + +* Fri Dec 17 1999 Pixel <pixel@mandrakesoft.com> +- changed a message + +* Thu Dec 16 1999 Pixel <pixel@mandrakesoft.com> +- added -follow to the find (thanx2(ti){2}) + +* Wed Dec 15 1999 Pixel <pixel@mandrakesoft.com> +- fixed a bug in dependencies + +* Sat Dec 11 1999 Pixel <pixel@mandrakesoft.com> +- i18n using po-like style + +* Wed Dec 8 1999 Pixel <pixel@linux-mandrake.com> +- fixed a bug (gmessage called with no double quotes and i18n) + +* Thu Dec 2 1999 Pixel <pixel@linux-mandrake.com> +- better error output (both in /var/log/urpmi.* and stdout/stderr) + +* Fri Nov 26 1999 Pixel <pixel@linux-mandrake.com> +- some bug fixes + +* Tue Nov 23 1999 Pixel <pixel@linux-mandrake.com> +- include new man pages and doc from camille :) + +* Mon Nov 22 1999 Pixel <pixel@mandrakesoft.com> +- s|sbin|bin| in requires (again) (wow already monday!) + +* Sun Nov 21 1999 Pixel <pixel@mandrakesoft.com> +- autoirpm: added require gurpmi + +* Sat Nov 20 1999 Pixel <pixel@mandrakesoft.com> +- urpmi.addmedia modified + +* Wed Nov 17 1999 Pixel <pixel@mandrakesoft.com> +- corrected error in urpmi script +- replaced dependency perl by /usr/bin/suidperl + +* Mon Nov 15 1999 Pixel <pixel@linux-mandrake.com> +- changed the handling of urpmi, added urpmi.addmedia... + +%package -n gurpmi +Version: 0.4 +Summary: User mode rpm GUI install +Requires: urpmi grpmi gchooser gmessage +Group: %{group} +%description -n gurpmi +gurpmi enable non-superuser install of rpms. In fact, it only authorizes +well-known rpms to be installed. + +You can compare rpm vs. urpmi with insmod vs. modprobe + +%package -n autoirpm +Version: 0.2 +Summary: Auto install of rpm on demand +Requires: sh-utils urpmi gurpmi xtest gmessage gurpmi +Group: %{group} + +%description -n autoirpm +Auto install of rpm on demand + + +%prep +%setup -n %{name} + +%install +rm -rf $RPM_BUILD_ROOT +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 + +cd $RPM_BUILD_ROOT/usr/bin ; mv -f rpm-find-leaves urpmi_rpm-find-leaves + +%clean +rm -rf $RPM_BUILD_ROOT +rm -rf $RPM_BUILD_DIR/$RPM_PACKAGE_NAME + +%pre +groupadd -r -f urpmi + +%preun -n autoirpm +autoirpm.uninstall + +%files +%defattr(-,root,root) +%attr(0755, root, urpmi) %dir /etc/urpmi +%attr(0755, root, urpmi) %dir /var/lib/urpmi +%attr(4750, root, urpmi) /usr/bin/urpmi +/usr/bin/urpmi_rpm-find-leaves +/usr/bin/rpmf +/usr/sbin/urpmi.* +/usr/share/locale/*/LC_MESSAGES/urpmi.po +%doc /usr/man/man*/urpmi* + +%files -n gurpmi +%defattr(-,root,root) +/usr/X11R6/bin/gurpmi + +%files -n autoirpm +%defattr(-,root,root) +%dir /var/lib/urpmi/autoirpm.scripts +/etc/urpmi/autoirpm.deny +/usr/sbin/autoirpm.* +/usr/bin/_irpm +%doc README-autoirpm-icons autoirpm.README |