| Summary: | rpmdev-extract fails for multiple relative-path rpms | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Josh Stone <jistone> |
| Component: | rpmdevtools | Assignee: | Ville Skyttä <ville.skytta> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 15 | CC: | a.badger, ville.skytta |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | rpmdevtools-8.2-1.fc16 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-11-14 22:25:44 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Thanks for the report. I chose the prenormalization approach "upstream": http://git.fedorahosted.org/git/?p=rpmdevtools.git;a=commitdiff;h=b7e6476fefd5e58425598ba7f6e41ad116f91618 rpmdevtools-8.2-1.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/rpmdevtools-8.2-1.fc16 Package rpmdevtools-8.2-1.fc16: * should fix your issue, * was pushed to the Fedora 16 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing rpmdevtools-8.2-1.fc16' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2011-15843 then log in and leave karma (feedback). rpmdevtools-8.2-1.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report. |
Description of problem: If you invoke rpmdev-extract on multiple rpms with only a relative path, then it will extract the first and then fail to find the rest. Version-Release number of selected component (if applicable): rpmdevtools-8.1-1.fc15.noarch How reproducible: 100% Steps to Reproduce: 1. rpmdev-extract [multiple relative rpms] Actual results: $ ls -s1 rpm*.rpm 976K rpm-4.9.0-9.fc15.x86_64.rpm 116K rpmdevtools-8.1-1.fc15.noarch.rpm $ rpmdev-extract -q rpm*.rpm Error: file does not exist: 'rpmdevtools-8.1-1.fc15.noarch.rpm' Expected results: All rpms extracted, as it works with full paths, e.g. $ rpmdev-extract -q $PWD/rpm*.rpm" Additional info: I believe the issue is simply that the original working directory is lost when unarch() opens an rpm. The chain of "cd" in that case is: cd "$2" # the output dir ($PWD or -Cdir) cd "$name" # the rpm package's name cd .. # back to the base output dir cd - >/dev/null 2>&1 # back to $OLDPWD, which is $name ! There are number of ways to solve this. You could normalize all the rpm paths ahead of time, so they're always found, but I think that's not quite enough to get the output in the right place too. You could explicitly remember and restore the starting path rather than relying on "cd -". Or you could invoke that function in a () subshell so the main working directory is not affected, e.g. (unarch "$file" "$dir")