Compare commits

...

6 Commits
master ... f21

Author SHA1 Message Date
Michal Luscon 748b4bf32d Update to 0.6.4-7 2015-09-23 16:27:08 +02:00
Michal Luscon dfbd3a21db Update to 0.6.4-6 2015-08-26 15:27:50 +02:00
Michal Luscon e5dee8237f Update to 0.6.4-5 2015-04-16 10:18:52 +02:00
Michal Luscon b0e1691046 Fix sources (dnf-0.6.4) 2015-04-13 15:56:05 +02:00
Michal Luscon 238a4a2e46 Update dnf to 0.6.4-3 2015-04-13 14:42:12 +02:00
Michal Luscon 3f9d81b351 Update dnf to 0.6.4-2 2015-04-13 14:05:42 +02:00
9 changed files with 73298 additions and 9 deletions

1
.gitignore vendored
View File

@ -72,3 +72,4 @@
/dnf-a7e0aa1.tar.xz
/dnf-13dce34.tar.xz
/dnf-3a22891.tar.xz
/dnf-0.6.4.tar.gz

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,85 @@
diff --git a/dnf.spec b/dnf.spec
index 66544a7..4d98f57 100644
--- a/dnf.spec
+++ b/dnf.spec
@@ -11,7 +11,7 @@
Name: dnf
Version: 0.6.4
-Release: 2%{?snapshot}%{?dist}
+Release: 3%{?snapshot}%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@@ -197,6 +197,9 @@ popd
%systemd_postun_with_restart dnf-automatic.timer
%changelog
+* Mon Apr 13 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-3
+- rel-eng: use distro releaser
+
* Fri Apr 10 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-2
- spec: fix prep section (Michal Luscon)
- subject: expand every glob name only once (RhBug:1203151) (Michal Luscon)
@@ -237,25 +240,25 @@ popd
- api: exposed Repo.skip_if_unavailable config (RhBug:1189083) (Jan Silhan)
- updated documentation for 'dnf list autoremove' (Michael Mraka)
- reuse list_autoremove() in autoremove command (Michael Mraka)
-- function for autoremove package list (Michael Mraka)
-- implemented dnf list autoremove (Michael Mraka)
-- exclude not documented history subcommands (RhBug:1193914,1193915) (Jan Silhan)
-- better file pattern recognition (RhBug:1195385) (Jan Silhan)
-- remove boot only constraint and add missing download lock (Michal Luscon)
-- util: remove unused user_run_dir() function (Michal Luscon)
+- function for autoremove package list (Michael Mraka)
+- implemented dnf list autoremove (Michael Mraka)
+- exclude not documented history subcommands (RhBug:1193914,1193915) (Jan Silhan)
+- better file pattern recognition (RhBug:1195385) (Jan Silhan)
+- remove boot only constraint and add missing download lock (Michal Luscon)
+- util: remove unused user_run_dir() function (Michal Luscon)
- lock: change the destination folder of locks to allow suided programs work properly (RhBug:1195661) (Michal Luscon)
-- fixed unicode Download error (RhBug:1190458) (Jan Silhan)
-- log: print metadata age along with timestamp (Petr Spacek)
-- cli: fix double expansion of cachedir (RhBug:1194685) (Michal Luscon)
-- removed unused dnf-makecache.cron (Jan Silhan)
-- renamed erase command to remove (RhBug:1160806) (Jan Silhan)
-- AUTHORS: changed email address (Jan Silhan)
-- doc: improve the documentation of the "install" command (Radek Holy)
-- "dnf install non-existent" should fail (Radek Holy)
-- tests: add some tests of Base.install (Radek Holy)
-- tests: add some tests of Base.package_install (Radek Holy)
-- Revert "doesn't upgrade packages by installing local packages" (RhBug:1160950) (Radek Holy)
-- lint: fix all Pylint errors in test_install (Radek Holy)
+- fixed unicode Download error (RhBug:1190458) (Jan Silhan)
+- log: print metadata age along with timestamp (Petr Spacek)
+- cli: fix double expansion of cachedir (RhBug:1194685) (Michal Luscon)
+- removed unused dnf-makecache.cron (Jan Silhan)
+- renamed erase command to remove (RhBug:1160806) (Jan Silhan)
+- AUTHORS: changed email address (Jan Silhan)
+- doc: improve the documentation of the "install" command (Radek Holy)
+- "dnf install non-existent" should fail (Radek Holy)
+- tests: add some tests of Base.install (Radek Holy)
+- tests: add some tests of Base.package_install (Radek Holy)
+- Revert "doesn't upgrade packages by installing local packages" (RhBug:1160950) (Radek Holy)
+- lint: fix all Pylint errors in test_install (Radek Holy)
- tests: add some tests to test_install (Radek Holy)
- tests: improve some tests in test_install (Radek Holy)
- cosmetic: reorder tests in test_install (Radek Holy)
diff --git a/rel-eng/packages/dnf b/rel-eng/packages/dnf
index 18bb0ab..3de8ca7 100644
--- a/rel-eng/packages/dnf
+++ b/rel-eng/packages/dnf
@@ -1 +1 @@
-0.6.4-2 ./
+0.6.4-3 ./
diff --git a/rel-eng/tito.props b/rel-eng/tito.props
index 1283cc1..f711d7f 100644
--- a/rel-eng/tito.props
+++ b/rel-eng/tito.props
@@ -1,5 +1,5 @@
[buildconfig]
-builder = tito.builder.Builder
+builder = tito.distributionbuilder.DistributionBuilder
tagger = tito.tagger.ReleaseTagger
changelog_do_not_remove_cherrypick = 1
changelog_format = %s (%a)

View File

@ -0,0 +1,30 @@
diff --git a/dnf.spec b/dnf.spec
index 4d98f57..12f3e77 100644
--- a/dnf.spec
+++ b/dnf.spec
@@ -11,7 +11,7 @@
Name: dnf
Version: 0.6.4
-Release: 3%{?snapshot}%{?dist}
+Release: 4%{?snapshot}%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@@ -197,6 +197,9 @@ popd
%systemd_postun_with_restart dnf-automatic.timer
%changelog
+* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-4
+- upload correct source archive 0.6.4
+
* Mon Apr 13 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-3
- rel-eng: use distro releaser
diff --git a/rel-eng/packages/dnf b/rel-eng/packages/dnf
index 3de8ca7..cf457e0 100644
--- a/rel-eng/packages/dnf
+++ b/rel-eng/packages/dnf
@@ -1 +1 @@
-0.6.4-3 ./
+0.6.4-4 ./

View File

@ -0,0 +1,80 @@
diff --git a/dnf.spec b/dnf.spec
index 12f3e77..2deea95 100644
--- a/dnf.spec
+++ b/dnf.spec
@@ -11,7 +11,7 @@
Name: dnf
Version: 0.6.4
-Release: 4%{?snapshot}%{?dist}
+Release: 5%{?snapshot}%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@@ -197,6 +197,10 @@ popd
%systemd_postun_with_restart dnf-automatic.timer
%changelog
+* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-5
+- Revert "completion: work with just python(3)-dnf"
+- Revert "bash-completion: use python method to get commands (RhBug:1187579)"
+
* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-4
- upload correct source archive 0.6.4
diff --git a/etc/bash_completion.d/dnf-completion.bash b/etc/bash_completion.d/dnf-completion.bash
index 62f0cf1..4538607 100644
--- a/etc/bash_completion.d/dnf-completion.bash
+++ b/etc/bash_completion.d/dnf-completion.bash
@@ -20,12 +20,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
-if [ -e /usr/bin/dnf-2 ]; then
- alias dnf="dnf-2"
-else
- alias dnf="dnf-3"
-fi
-
_dnf_help_command()
{
local cmd=$( dnf help $1 | grep -E "^$1" | tr "|" " " )
@@ -35,15 +29,7 @@ _dnf_help_command()
_dnf()
{
- local commandlist="$( compgen -W '$( python << END
-import dnf.cli
-b = dnf.cli.cli.BaseCli()
-c = dnf.cli.Cli(b)
-c.configure(["help"])
-for cmd in c.cli_commands:
- print(cmd)
-END
-)' )"
+ local commandlist="$( compgen -W '$( LANG=C dnf help | cut -d" " -s -f1 | LANG=C sed -e "/^[A-Z]/d" -e "/:/d" )' )"
local cur prev words cword
_init_completion -s || return
@@ -85,7 +71,7 @@ END
if [[ $command ]]; then
case $command in
- install|update|upgrade|info)
+ install|update|info)
if [[ "$cur" == \.* ]] || [[ "$cur" == \/* ]]; then
[[ $command != "info" ]] && ext='@(rpm)' || ext=''
else
@@ -196,4 +182,4 @@ END
[[ $prev != -* ]] && COMPREPLY=( $( compgen -W '$( echo $commandlist )' -- "$cur" ) )
fi
} &&
-complete -F _dnf dnf dnf-2 dnf-3
+complete -F _dnf dnf
diff --git a/rel-eng/packages/dnf b/rel-eng/packages/dnf
index cf457e0..126e3e7 100644
--- a/rel-eng/packages/dnf
+++ b/rel-eng/packages/dnf
@@ -1 +1 @@
-0.6.4-4 ./
+0.6.4-5 ./

View File

@ -0,0 +1,363 @@
diff --git a/dnf.spec b/dnf.spec
index 2deea95..00025db 100644
--- a/dnf.spec
+++ b/dnf.spec
@@ -11,7 +11,7 @@
Name: dnf
Version: 0.6.4
-Release: 5%{?snapshot}%{?dist}
+Release: 6%{?snapshot}%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@@ -125,6 +125,7 @@ mkdir -p $RPM_BUILD_ROOT%{pluginconfpath}
mkdir -p $RPM_BUILD_ROOT%{py2pluginpath}
mkdir -p $RPM_BUILD_ROOT%{py3pluginpath}/__pycache__
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
+mkdir -p $RPM_BUILD_ROOT%{_var}/cache/dnf
touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
ln -sr $RPM_BUILD_ROOT%{_bindir}/dnf $RPM_BUILD_ROOT%{_bindir}/yum
@@ -152,6 +153,7 @@ popd
%{_mandir}/man5/dnf.conf.5.gz
%{_unitdir}/dnf-makecache.service
%{_unitdir}/dnf-makecache.timer
+%{_var}/cache/dnf
%{_tmpfilesdir}/dnf.conf
%exclude %{python_sitelib}/dnf/automatic
%{python_sitelib}/dnf/
@@ -187,6 +189,13 @@ popd
%postun
%systemd_postun_with_restart dnf-makecache.timer
+%posttrans
+# cleanup pre-1.0.2 style cache
+for arch in armv7hl i686 x86_64 ; do
+ rm -rf /var/cache/dnf/$arch
+done
+exit 0
+
%post automatic
%systemd_post dnf-automatic.timer
@@ -197,12 +206,19 @@ popd
%systemd_postun_with_restart dnf-automatic.timer
%changelog
+* Wed Aug 26 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-6
+- test: don't compute hash from absolute local file path (introduced in
+ 10518b6)
+- cleanup old cache in posttrans
+- include /var/cache/dnf into rpm
+- do not use releasever in cache path (related to RhBug:1173107)
+
* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-5
- Revert "completion: work with just python(3)-dnf"
- Revert "bash-completion: use python method to get commands (RhBug:1187579)"
* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-4
-- upload correct source archive 0.6.4
+- upload correct source archive 0.6.4
* Mon Apr 13 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-3
- rel-eng: use distro releaser
diff --git a/dnf/base.py b/dnf/base.py
index 725937b..f3df45c 100644
--- a/dnf/base.py
+++ b/dnf/base.py
@@ -127,9 +127,8 @@ class Base(object):
subst = conf.substitutions
if 'releasever' not in subst:
subst['releasever'] = \
- dnf.rpm.detect_releasever(conf.installroot) or ''
- suffix = dnf.conf.parser.substitute(dnf.const.CACHEDIR_SUFFIX, subst)
- cache_dirs = dnf.conf.CliCache(conf.cachedir, suffix)
+ dnf.rpm.detect_releasever(conf.installroot)
+ cache_dirs = dnf.conf.CliCache(conf.cachedir)
conf.cachedir = cache_dirs.cachedir
return conf
diff --git a/dnf/cli/cli.py b/dnf/cli/cli.py
index 2c6c40e..0bbd337 100644
--- a/dnf/cli/cli.py
+++ b/dnf/cli/cli.py
@@ -101,9 +101,7 @@ def _list_cmd_calc_columns(output, ypl):
def cachedir_fit(conf):
- subst = conf.substitutions
- suffix = dnf.conf.parser.substitute(dnf.const.CACHEDIR_SUFFIX, subst)
- cli_cache = dnf.conf.CliCache(conf.cachedir, suffix)
+ cli_cache = dnf.conf.CliCache(conf.cachedir)
return cli_cache.cachedir, cli_cache.system_cachedir
@@ -1021,10 +1019,6 @@ class Cli(object):
conf.read(path)
if releasever is None:
releasever = dnf.rpm.detect_releasever(root)
- if releasever is None:
- msg = _('releasever not given and can not be detected '
- 'from the installroot.')
- raise dnf.exceptions.ConfigError(msg)
conf.releasever = releasever
subst = conf.substitutions
subst.update_from_etc(root)
@@ -1039,12 +1033,6 @@ class Cli(object):
self.base.logging.setup_from_dnf_conf(conf)
- # repos are ver/arch specific so add $basearch/$releasever
- conf._repos_persistdir = os.path.normpath(
- '%s/repos/%s/%s/' % (conf.persistdir,
- subst.get('basearch', '$basearch'),
- subst.get('releasever', '$releasever')))
-
timer()
return conf
diff --git a/dnf/conf/__init__.py b/dnf/conf/__init__.py
index f26f81b..ec03229 100644
--- a/dnf/conf/__init__.py
+++ b/dnf/conf/__init__.py
@@ -49,10 +49,9 @@ logger = logging.getLogger('dnf')
class CliCache(object):
- def __init__(self, prefix, suffix):
+ def __init__(self, prefix):
# set from the client, at most once:
self.prefix = prefix
- self.suffix = suffix
# internal:
self._ready = False
self._cachedir = None
@@ -63,19 +62,16 @@ class CliCache(object):
return
self._ready = True
- self._system_cachedir = self._retdir(self.prefix)
+ self._system_cachedir = self.prefix
if util.am_i_root():
self._cachedir = self._system_cachedir
else:
try:
user_prefix = misc.getCacheDir()
- self._cachedir = self._retdir(user_prefix)
+ self._cachedir = user_prefix
except (IOError, OSError) as e:
logger.critical(_('Could not set cachedir: %s'), ucd(e))
- def _retdir(self, dir):
- return os.path.join(dir, self.suffix)
-
@property
def cachedir(self):
self._make_ready()
diff --git a/dnf/const.py.in b/dnf/const.py.in
index 3c498c9..652ec62 100644
--- a/dnf/const.py.in
+++ b/dnf/const.py.in
@@ -21,7 +21,6 @@
from __future__ import unicode_literals
import distutils.sysconfig
-CACHEDIR_SUFFIX='$basearch/$releasever'
CONF_FILENAME='/etc/dnf/dnf.conf' # :api
CONF_AUTOMATIC_FILENAME='/etc/dnf/automatic.conf'
DISTROVERPKG=('system-release(releasever)', 'redhat-release')
diff --git a/dnf/repo.py b/dnf/repo.py
index 5b9bddf..d0c6f33 100644
--- a/dnf/repo.py
+++ b/dnf/repo.py
@@ -33,6 +33,7 @@ import dnf.util
import dnf.yum.config
import dnf.yum.misc
import functools
+import hashlib
import hawkey
import logging
import librepo
@@ -447,7 +448,14 @@ class Repo(dnf.yum.config.RepoConf):
@property
def cachedir(self):
- return os.path.join(self.basecachedir, self.id)
+ url = self.metalink or self.mirrorlist \
+ or (self.baseurl and self.baseurl[0])
+ if url:
+ digest = hashlib.sha256(url.encode('utf8')).hexdigest()[:16]
+ repodir = "%s-%s" % (self.id, digest)
+ else:
+ repodir = self.id
+ return os.path.join(self.basecachedir, repodir)
@property
def filelists_fn(self):
diff --git a/rel-eng/packages/dnf b/rel-eng/packages/dnf
index 126e3e7..40ad0fa 100644
--- a/rel-eng/packages/dnf
+++ b/rel-eng/packages/dnf
@@ -1 +1 @@
-0.6.4-5 ./
+0.6.4-6 ./
diff --git a/tests/test_base.py b/tests/test_base.py
index 4014c95..c56f94f 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -42,7 +42,7 @@ class BaseTest(support.TestCase):
base = dnf.Base()
self.assertIsNotNone(base.conf)
self.assertIsNotNone(base.conf.cachedir)
- reg = re.compile('/var/cache/dnf/[a-zA-Z0-9_]+/x')
+ reg = re.compile('/var/cache/dnf')
self.assertIsNotNone(reg.match(base.conf.cachedir))
@mock.patch('dnf.rpm.detect_releasever', lambda x: 'x')
@@ -51,7 +51,7 @@ class BaseTest(support.TestCase):
base = dnf.Base()
self.assertIsNotNone(base.conf)
self.assertIsNotNone(base.conf.cachedir)
- reg = re.compile('/var/tmp/dnf-[a-zA-Z0-9_-]+/[a-zA-Z0-9_]+/x')
+ reg = re.compile('/var/tmp/dnf-[a-zA-Z0-9_-]+')
self.assertIsNotNone(reg.match(base.conf.cachedir))
def test_reset(self):
diff --git a/tests/test_cli.py b/tests/test_cli.py
index b51a64f..34409da 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -194,7 +194,7 @@ class ConfigureTest(TestCase):
def test_configure_user(self):
""" Test Cli.configure as user."""
self.cli.configure(['update', '-c', self.conffile])
- reg = re.compile('^/var/tmp/dnf-[a-zA-Z0-9_-]+/[a-zA-Z0-9_]+/[0-9]+$')
+ reg = re.compile('^/var/tmp/dnf-[a-zA-Z0-9_-]+$')
self.assertIsNotNone(reg.match(self.base.conf.cachedir))
self.assertEqual(self.cli.cmdstring, "dnf update -c %s " % self.conffile)
@@ -202,7 +202,7 @@ class ConfigureTest(TestCase):
def test_configure_root(self):
""" Test Cli.configure as root."""
self.cli.configure(['update', '-c', self.conffile])
- reg = re.compile('^/var/cache/dnf/[a-zA-Z0-9_]+/[0-9]+$')
+ reg = re.compile('^/var/cache/dnf$')
self.assertIsNotNone(reg.match(self.base.conf.cachedir))
self.assertEqual(self.cli.cmdstring, "dnf update -c %s " % self.conffile)
diff --git a/tests/test_config.py b/tests/test_config.py
index 7f8d380..c59270e 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -39,23 +39,26 @@ class OptionTest(unittest.TestCase):
self.fail("option should be deleted now.")
class CacheTest(TestCase):
- @mock.patch('dnf.util.am_i_root', return_value=True)
- def test_root(self, unused_am_i_root):
- cache = CliCache('/var/lib/spinning', 'i286/20')
- self.assertEqual(cache.system_cachedir, '/var/lib/spinning/i286/20')
- self.assertEqual(cache.cachedir, '/var/lib/spinning/i286/20')
- @mock.patch('dnf.yum.misc.getCacheDir', return_value="/notmp/dnf-walr-yeAH")
- @mock.patch('dnf.util.am_i_root', return_value=False)
- def test_noroot(self, fn_root, fn_getcachedir):
- cache = CliCache('/var/lib/spinning', 'i286/20')
- self.assertEqual(fn_getcachedir.call_count, 0)
- self.assertEqual(cache.cachedir, '/notmp/dnf-walr-yeAH/i286/20')
- self.assertEqual(fn_getcachedir.call_count, 1)
+ @mock.patch('dnf.util.am_i_root', return_value=True)
+ def test_root(self, unused_am_i_root):
+ cache = CliCache('/var/lib/spinning')
+ self.assertEqual(cache.system_cachedir, '/var/lib/spinning')
+ self.assertEqual(cache.cachedir, '/var/lib/spinning')
+
+ @mock.patch('dnf.yum.misc.getCacheDir',
+ return_value="/notmp/dnf-walr-yeAH")
+ @mock.patch('dnf.util.am_i_root', return_value=False)
+ def test_noroot(self, fn_root, fn_getcachedir):
+ cache = CliCache('/var/lib/spinning')
+ self.assertEqual(fn_getcachedir.call_count, 0)
+ self.assertEqual(cache.cachedir, '/notmp/dnf-walr-yeAH')
+ self.assertEqual(fn_getcachedir.call_count, 1)
+
+ # the cachedirs are cached now, getCacheDir is not called again:
+ self.assertEqual(cache.cachedir, '/notmp/dnf-walr-yeAH')
+ self.assertEqual(fn_getcachedir.call_count, 1)
- # the cachedirs are cached now, getCacheDir is not called again:
- self.assertEqual(cache.cachedir, '/notmp/dnf-walr-yeAH/i286/20')
- self.assertEqual(fn_getcachedir.call_count, 1)
class YumConfTest(TestCase):
def test_bugtracker(self):
diff --git a/tests/test_package.py b/tests/test_package.py
index e30a2e5..225749c 100644
--- a/tests/test_package.py
+++ b/tests/test_package.py
@@ -74,7 +74,8 @@ class PackageTest(support.TestCase):
self.assertEquals(self.pkg.localPkg(), '/mnt/cd/f/foo.rpm')
self.pkg.repo.baseurl = ['http://remote']
self.assertFalse(self.pkg.repo.local)
- self.assertEquals(self.pkg.localPkg(), '/cachedir/main/packages/foo.rpm')
+ self.assertEquals(self.pkg.localPkg(),
+ self.pkg.repo.cachedir + '/packages/foo.rpm')
def test_verify(self):
with mock.patch.object(self.pkg, 'localPkg',
diff --git a/tests/test_repo.py b/tests/test_repo.py
index 5677ea9..a9bd4fc 100644
--- a/tests/test_repo.py
+++ b/tests/test_repo.py
@@ -142,9 +142,13 @@ class RepoTest(RepoTestMixin, support.TestCase):
def setUp(self):
self.repo = self.build_repo('r', 'r for riot')
+ def tearDown(self):
+ dnf.util.rm_rf(self.repo.cachedir)
+
def test_cachedir(self):
+ self.repo.baseurl = ["http://download.repo.org/r"]
self.assertEqual(self.repo.cachedir,
- os.path.join(self.TMP_CACHEDIR, self.repo.id))
+ os.path.join(self.TMP_CACHEDIR, 'r-0824b1db602c8695'))
def test_dump(self):
dump = self.repo.dump()
@@ -198,6 +202,7 @@ class RepoTest(RepoTestMixin, support.TestCase):
# the second time we only hit the cache:
del self.repo
self.repo = dnf.repo.Repo("r", self.TMP_CACHEDIR)
+ self.repo.baseurl = [BASEURL]
self.assertFalse(self.repo.load())
self.assertIsNotNone(self.repo.metadata)
@@ -206,7 +211,7 @@ class RepoTest(RepoTestMixin, support.TestCase):
self.assertIsNone(repo.metadata)
self.assertTrue(repo.load())
self.assertIsNotNone(repo.metadata)
- repomd = os.path.join(self.TMP_CACHEDIR, "r/repodata/repomd.xml")
+ repomd = os.path.join(self.repo.cachedir, "repodata/repomd.xml")
self.assertTrue(os.path.isfile(repomd))
self.assertTrue(repo.metadata.fresh)
@@ -339,7 +344,8 @@ class LocalRepoTest(support.TestCase):
('sha1', 'd5f18c856e765cd88a50dbf1bfaea51de3b5e516'),
('sha256', 'ead48d5c448a481bd66a4413d7be28bd44ce5de1ee59ecb723c78dcf4e441696'),
('sha512', '9a3131485c0c0a3f65bb5f25155e89d2d6b09e74ffdaa1c3339d3874885d160d8b4667a4a83dbd7d2702a5d41a4e1bc5622c4783b77dcf1f69626c68975202ce')]}
- self.assertTrue(self.repo.load())
+ with mock.patch('dnf.repo.Repo.cachedir', REPOS + "/rpm"):
+ self.assertTrue(self.repo.load())
self.assertTrue(remote_handle_m.fetchmirrors)
self.assertFalse(self.repo._expired)
reset_age_m.assert_called()
@@ -422,7 +428,7 @@ class DownloadPayloadsTest(RepoTestMixin, support.TestCase):
errs = dnf.repo.download_payloads([pload], drpm)
self.assertEmpty(errs.recoverable)
self.assertEmpty(errs.irrecoverable)
- path = os.path.join(self.TMP_CACHEDIR, 'r/packages/tour-4-4.noarch.rpm')
+ path = os.path.join(repo.cachedir, 'packages/tour-4-4.noarch.rpm')
self.assertFile(path)

View File

@ -0,0 +1,93 @@
---
dnf/yum/config.py | 2 +-
doc/conf_ref.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dnf/yum/config.py b/dnf/yum/config.py
index 2d8e1f5..6f1816b 100644
--- a/dnf/yum/config.py
+++ b/dnf/yum/config.py
@@ -772,7 +772,7 @@ class YumConf(BaseConfig):
enablegroups = BoolOption(True)
bandwidth = BytesOption(0)
- minrate = BytesOption(0)
+ minrate = BytesOption(1000)
ip_resolve = CaselessSelectionOption(
allowed=('ipv4', 'ipv6', 'whatever'),
mapper={'4': 'ipv4', '6': 'ipv6'})
diff --git a/doc/conf_ref.rst b/doc/conf_ref.rst
index 865cfe8..3b85cef 100644
--- a/doc/conf_ref.rst
+++ b/doc/conf_ref.rst
@@ -224,7 +224,7 @@ configuration.
``minrate``
storage size
- This sets the low speed threshold in bytes per second. If the server is sending data at the same or slower speed than this value for at least :ref:`timeout option <timeout-label>` seconds, DNF aborts the connection. The default is 0. Valid units are 'k', 'M', 'G'.
+ This sets the low speed threshold in bytes per second. If the server is sending data at the same or slower speed than this value for at least :ref:`timeout option <timeout-label>` seconds, DNF aborts the connection. The default is 1000. Valid units are 'k', 'M', 'G'.
``proxy``
string
--
2.4.3
---
dnf/yum/rpmsack.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dnf/yum/rpmsack.py b/dnf/yum/rpmsack.py
index 840168f..dcfdced 100644
--- a/dnf/yum/rpmsack.py
+++ b/dnf/yum/rpmsack.py
@@ -292,7 +292,8 @@ class RPMDBAdditionalDataPackage(object):
def __setattr__(self, attr, value):
if not attr.startswith('_'):
- self._write(attr, value)
+ if value is not None:
+ self._write(attr, value)
else:
object.__setattr__(self, attr, value)
--
2.4.3
---
dnf.spec | 6 +++++-
rel-eng/packages/dnf | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dnf.spec b/dnf.spec
index 00025db..8b4a748 100644
--- a/dnf.spec
+++ b/dnf.spec
@@ -11,7 +11,7 @@
Name: dnf
Version: 0.6.4
-Release: 6%{?snapshot}%{?dist}
+Release: 7%{?snapshot}%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@@ -206,6 +206,10 @@ exit 0
%systemd_postun_with_restart dnf-automatic.timer
%changelog
+* Wed Sep 23 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-7
+- don't store empty attributes (RhBug:1246928)
+- conf: change minrate threshold to librepo default (RhBug:1212320)
+
* Wed Aug 26 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-6
- test: don't compute hash from absolute local file path (introduced in
10518b6)
diff --git a/rel-eng/packages/dnf b/rel-eng/packages/dnf
index 40ad0fa..85e0f81 100644
--- a/rel-eng/packages/dnf
+++ b/rel-eng/packages/dnf
@@ -1 +1 @@
-0.6.4-6 ./
+0.6.4-7 ./
--
2.4.3

134
dnf.spec
View File

@ -1,8 +1,7 @@
%{!?gitrev: %global gitrev 3a22891}
%{!?hawkey_version: %global hawkey_version 0.5.3}
%{!?librepo_version: %global librepo_version 1.7.5}
%{!?libcomps_version: %global libcomps_version 0.1.6}
%{!?rpm_version: %global rpm_version 4.12.0}
%global hawkey_version 0.5.3
%global librepo_version 1.7.5
%global libcomps_version 0.1.6
%global rpm_version 4.12.0
%global confdir %{_sysconfdir}/dnf
@ -12,7 +11,7 @@
Name: dnf
Version: 0.6.4
Release: 1%{?snapshot}%{?dist}
Release: 7%{?snapshot}%{?dist}
Summary: Package manager forked from Yum, using libsolv as a dependency resolver
# For a breakdown of the licensing, see PACKAGE-LICENSING
License: GPLv2+ and GPLv2 and GPL
@ -22,7 +21,13 @@ URL: https://github.com/rpm-software-management/dnf
# cd dnf/package
# ./archive
# tarball will be generated in $HOME/rpmbuild/sources/
Source0: http://rpm-software-management.fedorapeople.org/dnf-%{gitrev}.tar.xz
Source0: http://rpm-software-management.fedorapeople.org/dnf-%{version}.tar.gz
Patch0: dnf-0.6.4-1-to-dnf-0.6.4-2.patch
Patch1: dnf-0.6.4-2-to-dnf-0.6.4-3.patch
Patch2: dnf-0.6.4-3-to-dnf-0.6.4-4.patch
Patch3: dnf-0.6.4-4-to-dnf-0.6.4-5.patch
Patch4: dnf-0.6.4-5-to-dnf-0.6.4-6.patch
Patch5: dnf-0.6.4-6-to-dnf-0.6.4-7.patch
BuildArch: noarch
BuildRequires: cmake
BuildRequires: pygpgme
@ -100,7 +105,13 @@ Requires(postun): systemd
Alternative CLI to "dnf upgrade" suitable for automatic, regular execution.
%prep
%setup -q -n dnf
%setup -q -n dnf-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
rm -rf py3
mkdir ../py3
cp -a . ../py3/
@ -126,6 +137,7 @@ mkdir -p $RPM_BUILD_ROOT%{pluginconfpath}
mkdir -p $RPM_BUILD_ROOT%{py2pluginpath}
mkdir -p $RPM_BUILD_ROOT%{py3pluginpath}/__pycache__
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
mkdir -p $RPM_BUILD_ROOT%{_var}/cache/dnf
touch $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}.log
ln -sr $RPM_BUILD_ROOT%{_bindir}/dnf $RPM_BUILD_ROOT%{_bindir}/yum
@ -188,6 +200,13 @@ popd
%postun
%systemd_postun_with_restart dnf-makecache.timer
%posttrans
# cleanup pre-1.0.2 style cache
for arch in armv7hl i686 x86_64 ; do
rm -rf /var/cache/dnf/$arch
done
exit 0
%post automatic
%systemd_post dnf-automatic.timer
@ -198,6 +217,105 @@ popd
%systemd_postun_with_restart dnf-automatic.timer
%changelog
* Wed Sep 23 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-7
- don't store empty attributes (RhBug:1246928)
- conf: change minrate threshold to librepo default (RhBug:1212320)
* Wed Aug 26 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-6
- cleanup old cache in posttrans (Michael Mraka)
- include /var/cache/dnf into rpm (Michael Mraka)
- do not use releasever in cache path (related to RhBug:1173107) (Michael Mraka)
* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-5
- Revert "completion: work with just python(3)-dnf"
- Revert "bash-completion: use python method to get commands (RhBug:1187579)"
* Thu Apr 16 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-4
- upload correct source archive 0.6.4
* Mon Apr 13 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-3
- rel-eng: use distro releaser
* Fri Apr 10 2015 Michal Luscon <mluscon@redhat.com> 0.6.4-2
- spec: fix prep section (Michal Luscon)
- subject: expand every glob name only once (RhBug:1203151) (Michal Luscon)
- group mark: skips already installed groups (Jan Silhan)
- fixed double set of demand from 0e4276f (Jan Silhan)
- group: remove cmd don't load available_repos, see 04da412 (Jan Silhan)
- Add release instructions (Michal Luscon)
- setup tito to bump version in VERSION.cmake (Michal Luscon)
- initialize to use tito (Michal Luscon)
- prepare repo for tito build system (Michal Luscon)
- completion: work with just python(3)-dnf (Jan Silhan)
- bash-completion: use python method to get commands (RhBug:1187579) (Igor Gnatenko)
- api: exposed pluginconfpath main config (RhBug:1195325) (Jan Silhan)
- updated AUTHORS (Jan Silhan)
- add reinstall to bash_completion (Alberto Ruiz)
- added new packages to @System for duplicated query test (Michael Mraka)
- test for duplicated, installonly and latest_limit pkgs (Michael Mraka)
- tests for autoremove, extras and recent pkgs (Michael Mraka)
- moved push_userinstalled from base to goal (Michael Mraka)
- filter or skip 'n' latest packages (Michael Mraka)
- moved recent to query (Michael Mraka)
- moved autoremove to query (Michael Mraka)
- moved extras list to query (Michael Mraka)
- create query for installonly packages (Michael Mraka)
- create query for duplicated packages (Michael Mraka)
- cosmetic: base: fixed pylint warnings (Jan Silhan)
- do transaction cleanup after plugin hook (RhBug:1185977) (Michal Luscon)
- base: extend download lock (RhBug:1157233) (Michal Luscon)
- lock: output meaningful error for malformed lock file (Michal Luscon)
- util: fix race condition in ensure_dir() (Michal Luscon)
- lock: switch metadata lock to blocking mode (Michal Luscon)
- remove command deletes whole dependency tree (RhBug:1154202) (Jan Silhan)
- cmd list takes <package-name-specs> as parameter, revert of 526e674 (Jan Silhan)
- transifex update (Jan Silhan)
- doc: fixed systemd execution of dnf-automatic (Jan Silhan)
- doc: how to run dnf-automatic (RhBug:1195240) (Jan Silhan)
- cosmetic: added forgotten :api mark from 05b03fc (Jan Silhan)
- api: exposed Repo.skip_if_unavailable config (RhBug:1189083) (Jan Silhan)
- updated documentation for 'dnf list autoremove' (Michael Mraka)
- reuse list_autoremove() in autoremove command (Michael Mraka)
- function for autoremove package list (Michael Mraka)
- implemented dnf list autoremove (Michael Mraka)
- exclude not documented history subcommands (RhBug:1193914,1193915) (Jan Silhan)
- better file pattern recognition (RhBug:1195385) (Jan Silhan)
- remove boot only constraint and add missing download lock (Michal Luscon)
- util: remove unused user_run_dir() function (Michal Luscon)
- lock: change the destination folder of locks to allow suided programs work properly (RhBug:1195661) (Michal Luscon)
- fixed unicode Download error (RhBug:1190458) (Jan Silhan)
- log: print metadata age along with timestamp (Petr Spacek)
- cli: fix double expansion of cachedir (RhBug:1194685) (Michal Luscon)
- removed unused dnf-makecache.cron (Jan Silhan)
- renamed erase command to remove (RhBug:1160806) (Jan Silhan)
- AUTHORS: changed email address (Jan Silhan)
- doc: improve the documentation of the "install" command (Radek Holy)
- "dnf install non-existent" should fail (Radek Holy)
- tests: add some tests of Base.install (Radek Holy)
- tests: add some tests of Base.package_install (Radek Holy)
- Revert "doesn't upgrade packages by installing local packages" (RhBug:1160950) (Radek Holy)
- lint: fix all Pylint errors in test_install (Radek Holy)
- tests: add some tests to test_install (Radek Holy)
- tests: improve some tests in test_install (Radek Holy)
- cosmetic: reorder tests in test_install (Radek Holy)
- cosmetic: rename some tests in test_install and add some docstrings (Radek Holy)
- AUTHORS: updated (Jan Silhan)
- Add support for armv6hl (Peter Hjalmarsson)
- doc: subject.__init__(): what is pkg_spec (Jan Silhan)
- doc: mentioning raising IOError from Base.fill_sack() (Jan Silhan)
- option_parser: fixed splitting multiple values (RhBug:1186710) (Jan Silhan)
- AUTHORS: updated (Jan Silhan)
- Standardize words describing boolean data type (Christopher Meng)
- build 0.6.4-1 (Jan Silhan)
- Adapt to librepo-1.7.13, metalink and mirrorlist are not loaded anymore when the repo is local. (Radek Holy)
- not raises value error when no metadata exist (Jan Silhan)
- README: fixed formating 2 (Jan Silhan)
- README: fixed formating (Jan Silhan)
- README: expanded DNF installation options (Jan Silhan)
- allow snapshot versions (Michael Mraka)
- simple script to build test package (Michael Mraka)
- more standard way to find out latest commit (Michael Mraka)
- let package version be specified on commandline (Michael Mraka)
* Wed Feb 4 2015 Jan Silhan <jsilhan@redhat.com> - 0.6.4-1
- Adapt to librepo-1.7.13, metalink and mirrorlist are not loaded anymore when the repo is local. (Radek Holy)

View File

@ -1 +1 @@
a69d37c96b24db9e35e09148372dbc37 dnf-3a22891.tar.xz
d308ae867a4a7b496d3dc99be964b54f dnf-0.6.4.tar.gz