Bug 1476464 - dnf download broken if repository is file:/// (ie. local)
dnf download broken if repository is file:/// (ie. local)
Product: Fedora
Classification: Fedora
Component: dnf-plugins-core (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jaroslav Mracek
Fedora Extras Quality Assurance
: Regression
Depends On:
Blocks: TRACKER-bugs-affecting-libguestfs
  Show dependency treegraph
Reported: 2017-07-29 05:45 EDT by Richard W.M. Jones
Modified: 2017-08-09 11:59 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-08-09 11:59:59 EDT
Type: Bug
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 Richard W.M. Jones 2017-07-29 05:45:38 EDT
Description of problem:

dnf download is broken if the repository is file:///


$ grep baseurl yum.conf
$ ls repo/systemd-*
$ dnf download -c yum.conf --destdir tmp systemd
Last metadata expiration check: 0:08:42 ago on Sat 29 Jul 2017 10:33:42 BST.
$ ls tmp
[no output]

This worked in dnf 2.5 but broke in dnf 2.6.2.

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


How reproducible:


Steps to Reproduce:
1. Set up a local repo containing some RPMs.
2. Create a yum.conf file pointing to the local repo.
3. Try to dnf download the RPMs.
Comment 1 Richard W.M. Jones 2017-07-29 05:55:54 EDT
I couldn't work out how to run dnf from the build directory, otherwise
I'd try to bisect this for you.

The instructions in the README don't appear to work:

$ PYTHONPATH=/home/rjones/d/dnf /home/rjones/d/dnf/bin/dnf-2 download -c yum.conf --destdir tmp systemd
No such command: download. Please use /home/rjones/d/dnf/bin/dnf-2 --help
It could be a DNF plugin command, try: "dnf install 'dnf-command(download)'"

And I couldn't build dnf for python 3 at all because of weird
cmake errors, even though I have all the dependencies installed:

$ rpm -qf /usr/bin/python3
$ cmake .. '-DPYTHON_DESIRED="3"'
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version "3.0")
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonInterp: Found unsuitable version "2.7.13", but
  required is at least "3.0" (found /usr/bin/python)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:375 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindPythonInterp.cmake:149 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:18 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/home/rjones/d/dnf/build/CMakeFiles/CMakeOutput.log".
Comment 2 Richard W.M. Jones 2017-07-31 07:18:02 EDT
I reverted d1f583570f2c8f39be1ca3966d54c4e89b8bde63 in dnf-plugins-core
and that fixes the problem.

It's not quite a straightforward reversion because I had to keep the
removal of the ‘--destdir’ parameter from the plugin otherwise both
core dnf and the plugin define this parameter which causes a problem
for Python argparse.  Anyway after reverting the remainder of the
commit it fixed the problem, so I think this commit is to blame.
Comment 3 Jaroslav Mracek 2017-08-01 09:43:07 EDT
I created a patch (https://github.com/rpm-software-management/dnf/pull/879) that should solve the problem. But I am still confused with problem with --destdir option. We removed --destdir from plugin download, therefore there should be no conflict at all. DNF-plugins-core requires pythonX-dnf >= 2.6.1 and in case of dnf there is conflict with older conflict dnf-plugins-core < 2.1.3 . Anyway I hope that with the patch it is ok.
Comment 4 Richard W.M. Jones 2017-08-01 11:27:05 EDT
Yes these patches work.
Comment 5 Jaroslav Mracek 2017-08-01 13:30:41 EDT
Nice to hear it :-) .
Comment 6 Richard W.M. Jones 2017-08-03 13:33:48 EDT
I tested dnf-2.6.2-3.fc27 which contains the patch and it looks
like it fixes it.  Thanks for that.  Can we close this bug now?
Comment 7 Jaroslav Mracek 2017-08-04 03:14:49 EDT
The bug will be closed at the time of release (I will make the release on next Monday). Thanks for testing.
Comment 8 Fedora Update System 2017-08-07 08:50:54 EDT
dnf-2.6.3-1.fc26 dnf-plugins-extras-2.0.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4813633f96
Comment 9 Fedora Update System 2017-08-07 21:24:36 EDT
dnf-2.6.3-1.fc26, dnf-plugins-extras-2.0.2-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4813633f96
Comment 10 Fedora Update System 2017-08-09 11:59:59 EDT
dnf-2.6.3-1.fc26, dnf-plugins-extras-2.0.2-1.fc26 has been pushed to the Fedora 26 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.