Bug 143886 - RFE: rpm fails to install rpms from stdin
Summary: RFE: rpm fails to install rpms from stdin
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rpm
Version: 4.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Panu Matilainen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-12-31 17:25 UTC by Jason Pyeron
Modified: 2008-09-24 13:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-24 10:04:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log from stdin (2.06 KB, text/plain)
2004-12-31 17:25 UTC, Jason Pyeron
no flags Details
log from temp file (3.71 KB, text/plain)
2004-12-31 17:26 UTC, Jason Pyeron
no flags Details
log from http (3.91 KB, text/plain)
2007-10-21 02:35 UTC, Jason Pyeron
no flags Details

Description Jason Pyeron 2004-12-31 17:25:04 UTC
[root@testserver tmp]# curl -s \
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=109200 |\
rpm -ivv -- - 2> logstdin.txt
[root@testserver tmp]# rpm -q rpmbug143885
package rpmbug143885 is not installed
[root@testserver tmp]# curl -s \
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=109200 >\
test.rpm &&\
rpm -ivv test.rpm 2> log.txt
[root@testserver tmp]# diff -u logstdin.txt log.txt
--- logstdin.txt        2004-12-31 12:20:20.000000000 -0500
+++ log.txt     2004-12-31 12:16:35.000000000 -0500
@@ -1,7 +1,7 @@
-D: ============== -
+D: ============== test.rpm
 D: Expected size:         1543 = lead(96)+sigs(180)+pad(4)+data(1263)
-D:   Actual size:            0
-D: -: MD5 digest: OK (17b3fe7d063fb8b090d61733a9ce9a6b)
+D:   Actual size:         1543
+D: test.rpm: MD5 digest: OK (17b3fe7d063fb8b090d61733a9ce9a6b)
 D:     added binary package [0]
 D: found 0 source and 1 binary packages
 D: opening  db environment /var/lib/rpm/Packages joinenv
@@ -36,6 +36,36 @@
 D: computing 0 file fingerprints
 D: computing file dispositions
 D: ========== +++ rpmbug143885-1-0 noarch-linux 0x0
+D: Expected size:         1543 = lead(96)+sigs(180)+pad(4)+data(1263)
+D:   Actual size:         1543
+D:   install: rpmbug143885-1-0 has 0 files, test = 0
+D:   +++ h#     915 Header SHA1 digest: OK 
(52e352e9f37eb4fa64117470f64fe77f50a88ce9)
+D: adding "rpmbug143885" to Name index.
+D: opening  db index       /var/lib/rpm/Group create mode=0x42
+D: adding "N/A" to Group index.
+D: opening  db index       /var/lib/rpm/Requirename create mode=0x42
+D: opening  db index       /var/lib/rpm/Providename create mode=0x42
+D: adding "rpmbug143885" to Providename index.
+D: opening  db index       /var/lib/rpm/Requireversion create 
mode=0x42
+D: adding 2 entries to Requireversion index.
+D: opening  db index       /var/lib/rpm/Provideversion create 
mode=0x42
+D: adding "1-0" to Provideversion index.
+D: opening  db index       /var/lib/rpm/Installtid create mode=0x42
+D: adding 1 entries to Installtid index.
+D: opening  db index       /var/lib/rpm/Sigmd5 create mode=0x42
+D: adding 1 entries to Sigmd5 index.
+D: opening  db index       /var/lib/rpm/Sha1header create mode=0x42
+D: adding "52e352e9f37eb4fa64117470f64fe77f50a88ce9" to Sha1header 
index.
+D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
+D: closed   db index       /var/lib/rpm/Sha1header
+D: closed   db index       /var/lib/rpm/Sigmd5
+D: closed   db index       /var/lib/rpm/Installtid
+D: closed   db index       /var/lib/rpm/Provideversion
+D: closed   db index       /var/lib/rpm/Requireversion
+D: closed   db index       /var/lib/rpm/Triggername
+D: closed   db index       /var/lib/rpm/Providename
+D: closed   db index       /var/lib/rpm/Requirename
+D: closed   db index       /var/lib/rpm/Group
 D: closed   db index       /var/lib/rpm/Name
 D: closed   db index       /var/lib/rpm/Packages
 D: closed   db environment /var/lib/rpm/Packages

Comment 1 Jason Pyeron 2004-12-31 17:25:52 UTC
Created attachment 109201 [details]
log from stdin

Comment 2 Jason Pyeron 2004-12-31 17:26:30 UTC
Created attachment 109202 [details]
log from temp file

Comment 3 Jason Pyeron 2004-12-31 17:29:49 UTC
rpm is supposed to support the - package file.
it even tries to use it, but just fails to follow through?

does it not cache it?

Comment 4 Jason Pyeron 2004-12-31 17:50:19 UTC
a disgusting workaround.

[root@testserver tmp]# TMPFILE=`mktemp $$.XXXXXX` && curl -s \
'https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=109200' >\
$TMPFILE && rpm -ivh $TMPFILE; rm -f $TMPFILE
Preparing...                
########################################### [100%]
   1:rpmbug143885           
########################################### [100%]


Comment 5 Jeff Johnson 2005-02-07 19:45:23 UTC
FWIW, rpm has not permitted install from stdin
for quite some time, and certainly has never permitted
stdin installs in RHEL3 and later.

Nor is it likely to be possible to permit stdin installs
with the current rpm implementation, as each package is
read twice because of the reopen during a progress callback,
and changing that scheme introduces major incompatibilities
with existing applications that use rpmlib.

Marking as RFE ...

Comment 6 Suzanne Hillman 2005-02-08 19:21:16 UTC
Internal RFE bug #147521 entered; will be considered for future releases.

Comment 7 Jason Pyeron 2005-02-08 21:07:00 UTC
then shouldn't URL_IS_DASH be treated as URL_IS_HTTP?

that is make a temp file for the 'transfer' then open it.

As far as "rpm has not permitted install from stdin for quite some 
time" it should be [more] clearly noted in the docs.

Comment 8 Jason Pyeron 2006-10-09 22:23:53 UTC
any updates on this?

Comment 9 RHEL Program Management 2007-10-19 19:10:18 UTC
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

Comment 10 Jason Pyeron 2007-10-19 21:28:42 UTC
Still an issue in RHEL 4.x

Comment 11 Jeff Johnson 2007-10-19 23:58:08 UTC
This issue cannot be fixed without changing the progress bar callback
(which can't be changed until yum, and anaconda, and ... change) because
rpm opens every package twice, and cannot reliably store stdin in, say, /tmp
because /tmp may not exist.

Comment 12 Jason Pyeron 2007-10-21 02:34:11 UTC
no that is not an issue, as rpm supports install from stream such as ftp or 
http. see comment #7


proof is in the pudding


[root@statics23 ~]# rpm -ivv http://client.pdinc.us/rpmbug143885.rpm 2> http-
log.txt
Retrieving http://client.pdinc.us/rpmbug143885.rpm
Preparing packages for installation...
rpmbug143885-1-0
[root@statics23 ~]#

Comment 13 Jason Pyeron 2007-10-21 02:35:11 UTC
Created attachment 233581 [details]
log from http

Comment 14 Jeff Johnson 2007-10-21 03:34:53 UTC
There are different program paths being talked about.

For URL's, the file is downloaded and the install proceeds from there.

During install, the package file is opened twice.

(aside) What really needs doing in rpm is a one pass streaming install

If all you want is copying to temp file from stdin, and then installing the temp copy,
that's likely doable in under 10 lines of code.

But if you can type
   cat foo*.rpm | rpm -Uvh -
then surely you can also arrange to copy the file and invoke rpm on the copy.

Which is basically why an install from stdin has never been implemented ...

Comment 15 Jason Pyeron 2007-10-21 04:42:58 UTC
One would assume that more than one rpm at a time would not be permissible via 
stdin as there is no way to split the stream.

so "cat foo*.rpm | rpm -Uvh -" would still be invalid 
but "cat foo.rpm | rpm -ivh -" would be ok.


Comment 16 Panu Matilainen 2008-09-24 10:04:06 UTC
WONTFIX for RHEL 4, whether upstream implements it someday is another issue.

Comment 17 Jason Pyeron 2008-09-24 13:46:47 UTC
What/where is the upstream QA process or site?


Note You need to log in before you can comment on or make changes to this bug.