Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 1006307 Details for
Bug 1156559
[rfe] use dnf instead of yum
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh90 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
yum to dnf migration
dnf.patch (text/plain), 6.42 KB, created by
Michael Mráka
on 2015-03-25 12:45:18 UTC
(
hide
)
Description:
yum to dnf migration
Filename:
MIME Type:
Creator:
Michael Mráka
Created:
2015-03-25 12:45:18 UTC
Size:
6.42 KB
patch
obsolete
>diff -ur tito-0.5.6.orig/hacking/titotest-fedora-rawhide/Dockerfile tito-0.5.6/hacking/titotest-fedora-rawhide/Dockerfile >--- tito-0.5.6.orig/hacking/titotest-fedora-rawhide/Dockerfile 2014-12-23 16:36:41.000000000 +0100 >+++ tito-0.5.6/hacking/titotest-fedora-rawhide/Dockerfile 2015-03-25 11:51:15.827927696 +0100 >@@ -9,9 +9,9 @@ > ADD tito.spec /tmp/tito.spec > > # Install build dependencies. >-RUN yum -y install yum-utils \ >- ; yum-builddep -y /tmp/tito.spec \ >- ; yum clean all >+RUN dnf -y install dnf-plugins-core \ >+ ; dnf builddep -y /tmp/tito.spec \ >+ ; dnf clean all > > RUN useradd sandbox > RUN git config --global user.email "sandbox@example.com" >diff -ur tito-0.5.6.orig/src/tito/builder/main.py tito-0.5.6/src/tito/builder/main.py >--- tito-0.5.6.orig/src/tito/builder/main.py 2014-12-23 16:36:41.000000000 +0100 >+++ tito-0.5.6/src/tito/builder/main.py 2015-03-25 12:08:23.670107279 +0100 >@@ -29,7 +29,8 @@ > find_spec_file, run_command, get_build_commit, get_relative_project_dir, \ > get_relative_project_dir_cwd, get_spec_version_and_release, \ > check_tag_exists, create_tgz, get_script_path, get_latest_commit, \ >- get_commit_count, find_gemspec_file, create_builder, compare_version >+ get_commit_count, find_gemspec_file, create_builder, compare_version, \ >+ package_manager > from tito.compat import getoutput, getstatusoutput > from tito.exception import RunCommandException > from tito.exception import TitoException >@@ -239,8 +240,12 @@ > err = sys.exc_info()[1] > msg = str(err) > if (re.search('Failed build dependencies', err.output)): >- msg = "Please run 'yum-builddep %s' as root." % \ >- find_spec_file(self.relative_project_dir) >+ if package_manager() == 'dnf' >+ builddep = 'dnf builddep' >+ else: >+ builddep = 'yum-builddep' >+ msg = "Please run '%s %s' as root." % \ >+ (builddep, find_spec_file(self.relative_project_dir)) > error_out('%s' % msg) > except Exception: > err = sys.exc_info()[1] >@@ -947,7 +952,7 @@ > """ > A special case builder which uses pre-existing Brew builds and > pulls down the resulting rpms locally. Useful in some cases when >- generating yum repositories during a release. >+ generating repositories during a release. > """ > REQUIRED_ARGS = ['disttag'] > >@@ -1013,7 +1018,7 @@ > > (status, output) = getstatusoutput("which git-annex") > if status != 0: >- msg = "Please run 'yum install git-annex' as root." >+ msg = "Please run '%s install git-annex' as root." % package_manager() > error_out('%s' % msg) > > run_command("git-annex lock") >diff -ur tito-0.5.6.orig/src/tito/cli.py tito-0.5.6/src/tito/cli.py >--- tito-0.5.6.orig/src/tito/cli.py 2014-12-23 16:36:41.000000000 +0100 >+++ tito-0.5.6/src/tito/cli.py 2015-03-25 12:09:13.721531662 +0100 >@@ -229,7 +229,7 @@ > print("Supported modules:") > print(" build - Build packages.") > print(" init - Initialize directory for use by tito.") >- print(" release - Build and release to yum repos") >+ print(" release - Build and release to yum/dnf repos") > print(" report - Display various reports on the repo.") > print(" tag - Tag package releases.") > >diff -ur tito-0.5.6.orig/src/tito/common.py tito-0.5.6/src/tito/common.py >--- tito-0.5.6.orig/src/tito/common.py 2014-12-23 16:36:41.000000000 +0100 >+++ tito-0.5.6/src/tito/common.py 2015-03-25 12:05:22.367192346 +0100 >@@ -782,3 +782,10 @@ > a = normalize(version1) > b = normalize(version2) > return (a > b) - (a < b) >+ >+def package_manager(): >+ if os.path.exists('/usr/bin/dnf'): >+ return 'dnf' >+ else: >+ return 'yum' >+ >diff -ur tito-0.5.6.orig/src/tito/release/main.py tito-0.5.6/src/tito/release/main.py >--- tito-0.5.6.orig/src/tito/release/main.py 2014-12-23 16:36:41.000000000 +0100 >+++ tito-0.5.6/src/tito/release/main.py 2015-03-25 13:40:59.088785193 +0100 >@@ -23,7 +23,7 @@ > import shutil > > from tito.common import create_builder, debug, \ >- run_command, get_project_name >+ run_command, get_project_name, package_manager > from tito.compat import PY2, dictionary_override > from tito.exception import TitoException > from tito.config_object import ConfigObject >@@ -355,7 +355,10 @@ > filetypes = ['rpm'] > > # By default run createrepo without any paramaters >- createrepo_command = "createrepo ." >+ if package_manager() == 'dnf': >+ createrepo_command = "createrepo_c ." >+ else: >+ createrepo_command = "createrepo ." > > def __init__(self, name=None, tag=None, build_dir=None, > config=None, user_config=None, >@@ -376,7 +379,7 @@ > > def process_packages(self, temp_dir): > self.prune_other_versions(temp_dir) >- print("Refreshing yum repodata...") >+ print("Refreshing repodata...") > if self.releaser_config.has_option(self.target, 'createrepo_command'): > self.createrepo_command = self.releaser_config.get(self.target, 'createrepo_command') > os.chdir(temp_dir) >@@ -388,7 +391,7 @@ > Cleanout any other version of the package we just built. > > Both older and newer packages will be removed (can be used >- to downgrade the contents of a yum repo). >+ to downgrade the contents of a repo). > """ > os.chdir(temp_dir) > rpm_ts = rpm.TransactionSet() >@@ -403,7 +406,7 @@ > > # Now cleanout any other version of the package we just built, > # both older or newer. (can be used to downgrade the contents >- # of a yum repo) >+ # of a repo) > for filename in os.listdir(temp_dir): > if not filename.endswith(".rpm"): > continue >diff -ur tito-0.5.6.orig/tito.spec tito-0.5.6/tito.spec >--- tito-0.5.6.orig/tito.spec 2014-12-23 16:36:41.000000000 +0100 >+++ tito-0.5.6/tito.spec 2015-03-25 12:14:57.958571188 +0100 >@@ -19,7 +19,11 @@ > BuildRequires: libxslt > BuildRequires: rpmdevtools > BuildRequires: rpm-build >+%if 0%{?fedora} >= 22 >+BuildRequires: createrepo_c >+%else > BuildRequires: createrepo >+%endif > BuildRequires: tar > BuildRequires: which > >@@ -46,7 +50,11 @@ > Requires: fedora-packager > Requires: rpmdevtools > Requires: rpm-python >+%if 0%{?fedora} >= 22 >+Requires: dnf-plugins-core >+%else > Requires: yum-utils >+%endif > > %description > Tito is a tool for managing tarballs, rpms, and builds for projects using
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1156559
:
996522
| 1006307