Hello list.

I'm trying to port febootstrap to mageia (I need libguestfs, and it's a mandatory dependency). I need to be able to resolve dependencies and download packages, without root privileges. I see two solutions here:

1) use 'urpmq --requires-recursive --sources' first to get the list of packages, then check against already installed packages, then use another tool (curl, wget, whatever) to download the missing ones.

2) modify urpmi to allow it to be used without root privileges to just download files.

I'm currently trying to achieve solution 2. The attached patch relax the process uid check when --no-install option is used, provided an explicit download directory is used, through --download-all option. However, I'm facing multiple issues here:

- first, --download-all doesn't just change download-directory, its main effect is to change urpmi behaviour from interleaved download/install steps to download everything first. It doesn't matter very much here, but distinct --download-all and --download-dir options would have been a clearer interface.

- second, --noclean seems to be useless when using something an alternative download directory

- last, the default downloader (aria, I presume) doesn't specify which files it is currently downloading, meaning I'll have to post-process download directory to retrieve the list of packages, whereas I'd prefered to just parse urpmi output. I had to use --downloader wget to get a more verbose output.

urpmi maintainer(s) opinion welcome here.
--
BOFH excuse #268:

Neutrino overload on the nameserver
Index: urpmi
===================================================================
--- urpmi	(révision 5344)
+++ urpmi	(copie de travail)
@@ -266,8 +266,19 @@
     urpm::set_env($urpm, $env);
 } else {
     if ($< != 0 && !$options{debug__do_not_install}) {
-	#- need to be root if binary rpms are to be installed
-	$auto_select || @names || @files and $urpm->{fatal}(1, N("Only superuser is allowed to install packages"));
+        if ($no_install) {
+            #- writable download directory needed
+            $urpm->{fatal}(
+                1,
+                N("Only superuser is allowed to use default download directory") 
+            ) if ! $urpm->{options}{'download-all'};
+        } else {
+            #- root privileges needed to install binary packages
+            $urpm->{fatal}(
+                1,
+                N("Only superuser is allowed to install packages")
+            ) if $auto_select || @names || @files;
+        }
     }
 }
 

Reply via email to