RPM Community Forums

Mailing List Message of <rpm-users>

Re: rpm-5.0.0 and ftp / http support

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 24 Jan 2008 - 18:12:31 CET
Message-Id: <9690523A-D9E5-4EDE-ACEF-DE5AC95DE74D@mac.com>

On Jan 24, 2008, at 11:57 AM, Stefan Westmeier wrote:

> Hi again,
>
> here with some more information about the topic.
>
> Using rpm 4.1 fetching packages directly via ftp works nicely. The  
> command below works fine.
>
> Exactly the same commands fails for rpm 5.0.0:
>
> $ rpm --ignoreos --dbpath /cygdrive/d/home/rpmroot/rpmdb -- 
> relocate /if=/cygdrive/d/home/rpmroot/if --relocate /sys=/cy
> gdrive/d/home/rpmroot/sys -i ftp://user:xxx@192.168.182.128:2666/ 
> CoC_sys/Most/Trunk/rpms/most_if-1.0-1.i686.rpm ftp:
> //user:qqq123@192.168.182.128:2666/CoC_sys/Most/Trunk/rpms/most- 
> bin-1.0-1.i686.rpm
> error: open of ftp://user:xxx@192.168.182.128:2666/CoC_sys/Most/ 
> Trunk/rpms/most_if-1.0-1.i686.rpm failed: No such fil
> e or directory
>
> Is this a bug or feature?
>

rpm5.org decided to do network access through external curl
rather than internal rpmio (as in rpm-4.1).

So network access was disabled in rpm-5.0.0.

I've added a patch in cvs already to permit opt-in re-enabling,
patch attached below.

Then "opt-in" to network access by doing

     echo "%_rpmgio        %{nil}" >> /etc/rpm/macros

The patch will be in rpm-5.0.1 Real Soon Now.

Note there may be a few more cases where Fopen needs the
same "opt-in" change, but the 3 cases in lib/rpmgi.c are the
most important because that is the most common case for
queries.

73 de Jeff

Index: rpmgi.c
===================================================================
RCS file: /v/rpm/cvs/rpm/lib/rpmgi.c,v
retrieving revision 2.47
retrieving revision 2.48
diff -u -b -B -w -p -r2.47 -r2.48
--- rpmgi.c     1 Dec 2007 17:54:30 -0000       2.47
+++ rpmgi.c     11 Jan 2008 23:05:33 -0000      2.48
@@ -115,7 +115,7 @@ static rpmRC rpmgiLoadManifest(rpmgi gi,
         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
         /*@modifies gi, rpmGlobalMacroContext, h_errno,  
internalState @*/
  {
-    FD_t fd = rpmgiOpen(path, "r.fdio");
+    FD_t fd = rpmgiOpen(path, "r%{?_rpmgio}");
      rpmRC rpmrc = RPMRC_FAIL;

      if (fd != NULL) {
@@ -136,7 +136,7 @@ static Header rpmgiReadHeader(rpmgi gi,
         /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
         /*@modifies gi, rpmGlobalMacroContext, h_errno,  
internalState @*/
  {
-    FD_t fd = rpmgiOpen(path, "r.fdio");
+    FD_t fd = rpmgiOpen(path, "r%{?_rpmgio}");
      Header h = NULL;

      if (fd != NULL) {
@@ -665,7 +665,7 @@ nextkey:
                 path = _free(path);
                 path = rpmExpand(_query_hdlist_path, NULL);
             }
-           gi->fd = rpmgiOpen(path, "rm.fdio");
+           gi->fd = rpmgiOpen(path, "rm%{?_rpmgio}");
             gi->active = 1;
             path = _free(path);
         }
Received on Thu Jan 24 18:12:57 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.