Bug 1251774 - [RFE] DNF should support custom variables for repo files (same as /etc/yum/vars)
[RFE] DNF should support custom variables for repo files (same as /etc/yum/vars)
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: rpm-software-management
Fedora Extras Quality Assurance
: Reopened
: 1211253 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-09 19:21 EDT by Henning Schmiedehausen
Modified: 2017-11-01 06:34 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-19 13:26:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sample repo file (601 bytes, text/plain)
2015-09-08 21:52 EDT, Henning Schmiedehausen
no flags Details

  None (edit)
Description Henning Schmiedehausen 2015-08-09 19:21:37 EDT
Description of problem:

yum supports custom variables by putting files into /etc/yum/vars

From the man page of yum.conf:

"As  of  3.2.28, any properly named file in /etc/yum/vars is turned into a variable named after the filename (or over‐rides any of the above variables). 
Filenames may contain only alphanumeric characters and underscores and be in lowercase."

This feature does not seem to exist in dnf.


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

1.0.1
  Installed: dnf-0:1.0.1-2.fc22.noarch at 2015-08-09 21:27
  Built    : Fedora Project at 2015-06-12 09:00

  Installed: rpm-0:4.12.0.1-12.fc22.x86_64 at 2015-08-09 21:26
  Built    : Fedora Project at 2015-06-29 10:36


How reproducible:

Always. It is a missing feature.
Comment 1 Honza Silhan 2015-08-11 10:31:51 EDT

*** This bug has been marked as a duplicate of bug 1211253 ***
Comment 2 Henning Schmiedehausen 2015-08-11 12:25:44 EDT
I disagree that this is a duplicate of #1211253. This bug is about overriding an existing variable from the command line.

What this bug is about is creating custom variables and storing their values on the file system. yum allows this by creating files in /etc/yum/vars. No such mechanism exists in dnf and the #1211253 does not talk about this.

Closing this bug as a duplicate means that this RFE will get lost. I would like to keep it open because it addresses a different problem.
Comment 3 Radek Holy 2015-08-12 06:48:18 EDT
BTW, can you please tell us what is your use case? Maybe some examples (the more the better)?
Comment 4 Henning Schmiedehausen 2015-09-08 21:52:57 EDT
Created attachment 1071539 [details]
sample repo file
Comment 5 Henning Schmiedehausen 2015-09-08 21:54:39 EDT
I attached a demo file which we use to share repo files between e.g. Fedora and RHEL / CentOS. We set a custom variable 'some-service_distro' to either "fedora" or "rhel" to select the main repo and drop this variable into /etc/yum/vars as part of our installation process. This allows us to maintain only a single repo file for all distribution flavors.
Comment 6 Travers Carter 2016-03-10 19:09:30 EST
I'd like to see this yum feature re-introduced to DNF too.

My primary use case is that we have some repos where we require HTTP auth for access from outside our company networks, by systems which other people may have access to (so we don't want a single set of shared credentials), so we set up these repos with a baseurl of

https://$our_auth@repo.example.com/path/to/repo/...

or some such then and then drop our_auth into /etc/yum/vars, this allows us to configure the auth across all the relevant repos in a single place.
Comment 7 Fedora Admin XMLRPC Client 2016-07-08 05:29:23 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 8 Fedora End Of Life 2016-07-19 13:26:08 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.
Comment 9 Igor Gnatenko 2016-07-19 18:18:27 EDT
Let's track in upstream: https://github.com/rpm-software-management/libhif/issues/170
Comment 10 Till Maas 2017-09-04 12:28:47 EDT
*** Bug 1211253 has been marked as a duplicate of this bug. ***

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