Bug 1165242 - mock --sources can't handle symlinks
Summary: mock --sources can't handle symlinks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-18 15:42 UTC by Mikhail Campos
Modified: 2015-01-06 02:07 UTC (History)
6 users (show)

Fixed In Version: mock-1.2.3-1.el6
Clone Of:
Environment:
Last Closed: 2014-12-12 04:07:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
symlink in sources fix (1.06 KB, application/mbox)
2014-11-18 15:42 UTC, Mikhail Campos
no flags Details
new option --symlink-dereference used with --buildsrpm (3.25 KB, patch)
2014-11-18 23:27 UTC, Mikhail Campos
no flags Details | Diff

Description Mikhail Campos 2014-11-18 15:42:59 UTC
Created attachment 958638 [details]
symlink in sources fix

Description of problem:

If run mock --sources=directory_with_symlinks instead of original files, we are getting error that this sources does not exist in buildroot. Actually, that happens because symbolic links in the source tree are represented as symbolic links in the buildroot tree during copy process.

Version-Release number of selected component:
1.2.2-1

How reproducible:
always

Example:
1. create a symlink for mock-1.2.1.tar.xz in /home/plageat/test_pkg/mock/src
2. run: 
   mock --buildsrpm --spec /home/plageat/test_pkg/mock/mock.spec --sources /home/plageat/test_pkg/mock/src/

Actual results:

error: File /builddir/build/SOURCES/mock-1.2.1.tar.xz: No such file or directory
Building target platforms: x86_64
Building for target x86_64
Finish: rpmbuild -bs
Finish: buildsrpm
ERROR: Exception(/home/plageat/test_pkg/mock/mock.spec) Config(fedora-20-x86_64) 0 minutes 15 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-20-x86_64/result
ERROR: Command failed. See logs for output.
 # bash --login -c /usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/mock.spec

Expected results:
no errors

Proposed patch:
Patch attached

Comment 1 Miroslav Suchý 2014-11-18 17:01:19 UTC
This is problematic as it conflicts with behaviour implemented in bug 758781. And I'm more in favour of bug 758781 behaviour as this is what I would expect.

Comment 2 Miroslav Suchý 2014-11-18 17:05:08 UTC
I will be willing to accept patch which implement new command line option --symlink-dereference, which would set symlink=False.

Comment 3 Mikhail Campos 2014-11-18 23:27:46 UTC
Created attachment 958795 [details]
new option --symlink-dereference used with --buildsrpm

Implemented. New patch attached

Comment 4 Miroslav Suchý 2014-11-20 14:18:20 UTC
Committed as c4b0df8

add man page and bash completation in commit 4eb4eda

change semantics of options.symlink_dereference (because having options.symlink_dereference == True with meaning that symlink will not be dereferenced is weird) in commit 7c45263

Thanks for the contribution.

Comment 5 Fedora Update System 2014-12-04 12:06:31 UTC
mock-1.2.3-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc21

Comment 6 Fedora Update System 2014-12-04 12:10:02 UTC
mock-1.2.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.fc20

Comment 7 Fedora Update System 2014-12-04 12:10:58 UTC
mock-1.2.3-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el7

Comment 8 Fedora Update System 2014-12-04 12:12:27 UTC
mock-1.2.3-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.3-1.el6

Comment 9 Fedora Update System 2014-12-05 00:46:41 UTC
Package mock-1.2.3-1.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mock-1.2.3-1.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-16285/mock-1.2.3-1.fc21
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2014-12-12 04:07:24 UTC
mock-1.2.3-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-12-17 04:42:29 UTC
mock-1.2.3-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2015-01-06 02:06:12 UTC
mock-1.2.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2015-01-06 02:07:37 UTC
mock-1.2.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.


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