Bug 402201 - tilde expansion nonfunctional in --resultdir
tilde expansion nonfunctional in --resultdir
Product: Fedora
Classification: Fedora
Component: mock (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-11-28 01:21 EST by Ralf Corsepius
Modified: 2013-01-09 20:44 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-11-29 20:55:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ralf Corsepius 2007-11-28 01:21:56 EST
Description of problem:

mock doesn't parse args to --resultdir correctly.
Seemingly tilde expansion doesn't work.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. mkdir tmp
2. cd tmp
3. mock -r <repoid> --resultdir=~/results rebuild <pkg>.src.rpm
Actual results:
Results are being put into ./~/results
instead of ~/results [$(HOME)/results]

Expected results:
mock to perform tilde expansions on command line args.
Comment 1 Michael E Brown 2007-11-28 10:51:19 EST
tilde expansion is a function of the shell, not the program being run.

Bash doesnt recognize '--something=~/...' as something it should expand. Leave
out the '=' to let bash perform tilde-expansion on this.
Comment 2 Ralf Corsepius 2007-11-28 11:02:56 EST
man 3 glob
Comment 3 Michael E Brown 2007-11-28 12:01:02 EST
it is complicated by the fact that $HOME is reset to /root because of the setuid
wrapper, so this isnt trivial to implement.

a call to os.path.expanduser() would theoretically fix this, but it would
require some pretty significant code rearrangements to accomplish due to the
setuid wrapper.
Comment 4 Michael E Brown 2007-11-28 12:02:12 EST
Additionally, this appears to have been broken for every released version of mock.
Comment 5 Ralf Corsepius 2007-11-28 12:20:27 EST
(In reply to comment #4)
> Additionally, this appears to have been broken for every released version of
> mock.
I know, it has been haunting and nagging me from the earliest days of mock, but
it's always a surprise to me being hit by it every couple months.

Comment 6 Michael E Brown 2007-11-29 20:55:38 EST
Fixed for $nextrelease.

Clark is preparing this release and will be releasing sometime in the next
couple days.

If you want to look at this before the official release, please check out the
upstream git repo.

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