rpms/smart/F-10 839_856.diff, NONE, 1.1 smart.spec, 1.38, 1.39 839_854.diff, 1.2, NONE
Axel Thimm
athimm at fedoraproject.org
Sat Feb 14 10:56:49 UTC 2009
Author: athimm
Update of /cvs/extras/rpms/smart/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4951/F-10
Modified Files:
smart.spec
Added Files:
839_856.diff
Removed Files:
839_854.diff
Log Message:
Bugfix update solving for example bug #476808
839_856.diff:
--- NEW FILE 839_856.diff ---
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2008-10-08 15:59:14 +0000
+++ MANIFEST.in 2006-06-16 18:41:10 +0000
@@ -4,7 +4,7 @@
recursive-include tests *.py *.txt
recursive-include tests/data *
-include test
+include test.py
recursive-include contrib/ksmarttray *.png *.cc *.h *.am *.in.in
recursive-include contrib/ksmarttray LICENSE eventsrc
=== modified file 'Makefile'
--- Makefile 2008-10-06 20:03:37 +0000
+++ Makefile 2006-12-03 16:42:10 +0000
@@ -46,7 +46,7 @@
test:
./setup.py build_ext -i
- LANG=C ./test $(TEST)
+ LANG=C ./test.py $(TEST)
.PHONY: clean smart.pot update-po check-po test
=== modified file 'contrib/ksmarttray/src/ksmarttray.cc'
--- contrib/ksmarttray/src/ksmarttray.cc 2008-11-16 00:37:11 +0000
+++ contrib/ksmarttray/src/ksmarttray.cc 2005-03-04 22:21:46 +0000
@@ -48,7 +48,6 @@
{
hasActions = false;
checkAction.setText("Check");
- startSmartAction.setText("Start Smart...");
stopAction.setText("Stop");
stopAction.setIcon("stop");
stopAction.setEnabled(false);
@@ -59,7 +58,6 @@
if (!hasActions) {
hasActions = true;
checkAction.plug(menu, 1);
- startSmartAction.plug(menu, 2);
//stopAction.plug(menu, 2);
}
}
@@ -96,8 +94,6 @@
connect(&sysTray.checkAction, SIGNAL(activated()),
this, SLOT(manualCheckUpgrades()));
- connect(&sysTray.startSmartAction, SIGNAL(activated()),
- this, SLOT(startSmart()));
connect(&sysTray.stopAction, SIGNAL(activated()),
this, SLOT(stopChecking()));
connect(&sysTray, SIGNAL(quitSelected()),
@@ -116,7 +112,6 @@
return;
if (state == StateWaiting) {
sysTray.checkAction.setEnabled(false);
- sysTray.startSmartAction.setEnabled(false);
sysTray.stopAction.setEnabled(true);
process.resetAll();
if (manual)
@@ -150,7 +145,6 @@
"There is a running process.");
} else {
sysTray.checkAction.setEnabled(false);
- sysTray.startSmartAction.setEnabled(false);
sysTray.stopAction.setEnabled(false);
process.resetAll();
process << "kdesu" << "-d" << "-c" << "smart --gui upgrade";
@@ -165,28 +159,6 @@
}
}
-void KSmartTray::startSmart()
-{
- if (state != StateWaiting) {
- KNotifyClient::event(sysTray.winId(), "fatalerror",
- "There is a running process.");
- } else {
- sysTray.checkAction.setEnabled(false);
- sysTray.startSmartAction.setEnabled(false);
- sysTray.stopAction.setEnabled(false);
- process.resetAll();
- process << "kdesu" << "-d" << "-c" << "smart --gui";
- if (!process.start()) {
- KNotifyClient::event(sysTray.winId(), "fatalerror",
- "Couldn't run 'smart'.");
- } else {
- state = StateRunningSmart;
- QToolTip::remove(&sysTray);
- QToolTip::add(&sysTray, "Running Smart Package Manager...");
- }
- }
-}
-
void KSmartTray::stopChecking()
{
process.kill();
@@ -251,11 +223,6 @@
lastKnownStatus = "";
break;
- case StateRunningSmart:
- state = StateWaiting;
- lastKnownStatus = "";
- break;
-
default:
/* Error! */
break;
@@ -264,7 +231,6 @@
if (state == StateWaiting) {
updateFailed = false;
sysTray.checkAction.setEnabled(true);
- sysTray.startSmartAction.setEnabled(true);
sysTray.stopAction.setEnabled(false);
if (!lastKnownStatus.isEmpty())
{
=== modified file 'contrib/ksmarttray/src/ksmarttray.h'
--- contrib/ksmarttray/src/ksmarttray.h 2008-11-16 00:37:11 +0000
+++ contrib/ksmarttray/src/ksmarttray.h 2006-06-13 16:24:24 +0000
@@ -43,7 +43,6 @@
KAction checkAction;
KAction stopAction;
- KAction startSmartAction;
protected:
@@ -70,7 +69,6 @@
StateUpdating,
StateChecking,
StateUpgrading,
- StateRunningSmart,
};
State state;
@@ -107,7 +105,6 @@
void checkUpgrades();
void manualCheckUpgrades();
void runUpgrades();
- void startSmart();
public:
=== modified file 'smart/__init__.py'
--- smart/__init__.py 2008-11-26 17:10:15 +0000
+++ smart/__init__.py 2007-08-14 22:44:45 +0000
@@ -180,6 +180,9 @@
from smart import plugins
from smart import backends
pluginsdir = os.path.dirname(plugins.__file__)
+ entries = os.listdir(pluginsdir)
+ if os.path.isdir(PLUGINSDIR):
+ entries.extend(os.listdir(PLUGINSDIR))
for entry in os.listdir(pluginsdir):
if entry != "__init__.py" and entry.endswith(".py"):
__import__("smart.plugins."+entry[:-3])
@@ -189,10 +192,6 @@
initpath = os.path.join(entrypath, "__init__.py")
if os.path.isfile(initpath):
__import__("smart.plugins."+entry)
- if os.path.isdir(PLUGINSDIR):
- for entry in os.listdir(PLUGINSDIR):
- entrypath = os.path.join(PLUGINSDIR, entry)
- execfile(entrypath)
backendsdir = os.path.dirname(backends.__file__)
for entry in os.listdir(backendsdir):
entrypath = os.path.join(backendsdir, entry)
=== modified file 'smart/backends/deb/base.py'
--- smart/backends/deb/base.py 2008-11-16 00:06:42 +0000
+++ smart/backends/deb/base.py 2008-09-04 22:32:15 +0000
@@ -20,16 +20,13 @@
# along with Smart Package Manager; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-import fnmatch
-import string
-import sys
-import os
-import re
-
from smart.backends.deb.debver import vercmp, checkdep, splitrelease
from smart.backends.deb.pm import DebPackageManager
from smart.util.strtools import isGlob
from smart.cache import *
+import fnmatch
+import string
+import os, re
__all__ = ["DebPackage", "DebProvides", "DebNameProvides", "DebPreRequires",
"DebRequires", "DebUpgrades", "DebConflicts", "DebBreaks",
@@ -47,20 +44,17 @@
"shel": "sh",
"x86_64": "amd64"}.get(arch)
if result:
- arch = result
+ return result
elif len(arch) == 4 and arch[0] == "i" and arch.endswith("86"):
- arch = "i386"
+ return "i386"
elif arch.startswith("arm"):
- arch = "arm"
+ return "arm"
elif arch.startswith("hppa"):
- arch = "hppa"
+ return "hppa"
elif arch.startswith("alpha"):
- arch = "alpha"
-
- if sys.platform == "linux2":
- return arch
+ return "alpha"
else:
- return "%s-%s" % (sys.platform, arch)
+ return arch
DEBARCH = getArchitecture()
=== modified file 'smart/backends/deb/pm.py'
--- smart/backends/deb/pm.py 2008-10-08 15:35:32 +0000
+++ smart/backends/deb/pm.py 2008-07-03 22:58:43 +0000
@@ -26,7 +26,7 @@
import errno
import shlex
-from smart.const import Enum, INSTALL, REMOVE, OPTIONAL, ENFORCE
+from smart.const import INSTALL, REMOVE, OPTIONAL, ENFORCE
from smart.pm import PackageManager
from smart.sorter import *
from smart import *
@@ -34,8 +34,8 @@
# Part of the logic in this file was based on information found in APT.
-UNPACK = Enum("UNPACK")
-CONFIG = Enum("CONFIG")
+UNPACK = 10
+CONFIG = 11
DEBIAN_FRONTEND = "DEBIAN_FRONTEND"
APT_LISTCHANGES_FRONTEND = "APT_LISTCHANGES_FRONTEND"
@@ -71,7 +71,6 @@
if changeset.get(prvpkg) is INSTALL:
if op is INSTALL:
group.addSuccessor((prvpkg, CONFIG), unpack)
- group.addSuccessor((prvpkg, CONFIG), config)
else:
group.addSuccessor((prvpkg, CONFIG), remove)
elif prvpkg.installed:
@@ -108,7 +107,7 @@
for prvpkg in prv.packages])
for upgpkg in upgpkgs:
if changeset.get(upgpkg) is REMOVE:
- self.addSuccessor(unpack, (upgpkg, REMOVE), OPTIONAL)
+ self.addSuccessor(config, (upgpkg, REMOVE), OPTIONAL)
# Conflicted packages being removed must go in
# before this package's installation.
@@ -203,7 +202,6 @@
old_apt_lc_frontend = os.environ.get(APT_LISTCHANGES_FRONTEND)
os.environ[DEBIAN_FRONTEND] = "noninteractive"
os.environ[APT_LISTCHANGES_FRONTEND] = "none"
- baseargs.append("--force-confold")
if sysconf.get("pm-iface-output"):
output = tempfile.TemporaryFile()
=== modified file 'smart/backends/rpm/base.py'
--- smart/backends/rpm/base.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/base.py 2007-11-25 22:07:53 +0000
@@ -25,7 +25,6 @@
import zlib
from rpmver import checkdep, vercmp, splitarch, splitrelease
-from util import archscore
from smart.util.strtools import isGlob
from smart.cache import *
from smart import *
@@ -42,13 +41,15 @@
traceback.print_exc()
raise Error, _("'rpm' python module is not available")
+archscore = rpm.archscore
+
__all__ = ["RPMPackage", "RPMProvides", "RPMNameProvides", "RPMPreRequires",
"RPMRequires", "RPMUpgrades", "RPMConflicts", "RPMObsoletes",
"rpm", "getTS", "system_provides"]
def getTS(new=False):
if not hasattr(getTS, "ts"):
- getTS.root = os.path.abspath(sysconf.get("rpm-root", "/"))
+ getTS.root = sysconf.get("rpm-root", "/")
getTS.ts = rpm.ts(getTS.root)
if not sysconf.get("rpm-check-signatures", False):
getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
@@ -101,8 +102,8 @@
len(self.conflicts) != len(other.conflicts) or
fk(self.upgrades) != fk(other.upgrades) or
fk(self.conflicts) != fk(other.conflicts) or
- fk([x for x in self.provides if x.name and x.name[0] != "/"]) !=
- fk([x for x in other.provides if x.name and x.name[0] != "/"])):
+ fk([x for x in self.provides if x.name[0] != "/"]) !=
+ fk([x for x in other.provides if x.name[0] != "/"])):
return False
sreqs = fk(self.requires)
oreqs = fk(other.requires)
=== modified file 'smart/backends/rpm/header.py'
--- smart/backends/rpm/header.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/header.py 2008-07-22 10:37:20 +0000
@@ -21,7 +21,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from smart.backends.rpm.rpmver import splitarch
-from smart.backends.rpm.util import filepaths, archscore
from smart.util.strtools import globdistance
from smart.cache import Loader, PackageInfo
from smart.channel import FileChannel
@@ -121,7 +120,9 @@
def getPathList(self):
if self._path is None:
- paths = filepaths(self._h)
+ paths = self._h[rpm.RPMTAG_OLDFILENAMES]
+ if type(paths) != list:
+ paths = [paths]
modes = self._h[rpm.RPMTAG_FILEMODES]
if modes:
if type(modes) != list:
@@ -195,7 +196,7 @@
if h[1106]: # RPMTAG_SOURCEPACKAGE
continue
arch = h[1022] # RPMTAG_ARCH
- if archscore(arch) == 0:
+ if rpm.archscore(arch) == 0:
continue
name = h[1000] # RPMTAG_NAME
@@ -322,8 +323,10 @@
searcher.addResult(pkg, ratio)
continue
if searcher.path:
- paths = filepaths(h)
+ paths = h[rpm.RPMTAG_OLDFILENAMES]
if paths:
+ if type(paths) != list:
+ paths = [paths]
for spath, cutoff in searcher.path:
for path in paths:
_, newratio = globdistance(spath, path, cutoff, ic)
@@ -471,7 +474,9 @@
h, offset = rpm.readHeaderFromFD(file.fileno())
bfp = self.buildFileProvides
while h:
- fnlst = filepaths(h)
+ fnlst = h[1027] # RPMTAG_OLDFILENAMES
+ if type(fnlst) != list:
+ fnlst = [fnlst]
for fn in fnlst:
fn = fndict.get(fn)
if fn and offset in self._offsets:
@@ -482,7 +487,9 @@
def loadFileProvidesHDL(self, fndict):
bfp = self.buildFileProvides
for offset, h in enumerate(self._hdl):
- fnlst = filepaths(h)
+ fnlst = h[1027] # RPMTAG_OLDFILENAMES
+ if type(fnlst) != list:
+ fnlst = [fnlst]
for fn in fnlst:
fn = fndict.get(fn)
if fn and offset in self._offsets:
@@ -670,7 +677,9 @@
iface.error("%s: %s" % (os.path.basename(filepath), e))
else:
file.close()
- fnlst = filepaths(h)
+ fnlst = h[1027] # RPMTAG_OLDFILENAMES
+ if type(fnlst) != list:
+ fnlst = [fnlst]
for fn in fnlst:
fn = fndict.get(fn)
if fn:
=== modified file 'smart/backends/rpm/metadata.py'
--- smart/backends/rpm/metadata.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/metadata.py 2008-08-02 15:07:10 +0000
@@ -22,7 +22,6 @@
#
from smart.cache import PackageInfo, Loader
from smart.backends.rpm.base import *
-from smart.backends.rpm.util import *
try:
from xml.etree import cElementTree
@@ -173,7 +172,7 @@
skip = None
elif tag == ARCH:
- if archscore(elem.text) == 0:
+ if rpm.archscore(elem.text) == 0:
skip = PACKAGE
else:
arch = elem.text
=== modified file 'smart/backends/rpm/pm.py'
--- smart/backends/rpm/pm.py 2008-12-12 07:25:46 +0000
+++ smart/backends/rpm/pm.py 2007-05-22 16:32:57 +0000
@@ -138,10 +138,7 @@
lines.append(" "+" -> ".join(path))
lines.append(_("Will ask RPM to order it."))
iface.error("\n".join(lines))
- sorted = []
- for pkg in changeset:
- op = changeset[pkg]
- sorted.append((pkg, op))
+ sys.exit(1)
forcerpmorder = True
del sorter
=== modified file 'smart/backends/rpm/redcarpet.py'
--- smart/backends/rpm/redcarpet.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/redcarpet.py 2006-11-07 22:22:46 +0000
@@ -21,7 +21,6 @@
#
from smart.cache import PackageInfo, Loader
from smart.backends.rpm.base import *
-from smart.backends.rpm.util import *
from smart import *
import posixpath
import locale
@@ -192,7 +191,7 @@
self._release = data
def handleArchEnd(self, name, attrs, data):
- if archscore(data) == 0:
+ if rpm.archscore(data) == 0:
self._skip = self.PACKAGE
else:
self._arch = data
=== modified file 'smart/backends/rpm/synthesis.py'
--- smart/backends/rpm/synthesis.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/synthesis.py 2006-11-07 22:22:46 +0000
@@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from smart.backends.rpm.rpmver import splitarch
-from smart.backends.rpm.util import archscore
from smart.cache import PackageInfo, Loader
from smart.backends.rpm.base import *
from smart import *
@@ -166,7 +165,7 @@
version, arch = version[:dot], version[dot+1:]
versionarch = "@".join((version, arch))
- if archscore(arch) == 0:
+ if rpm.archscore(arch) == 0:
continue
name = "-".join(rpmnameparts[0:-2])
=== removed file 'smart/backends/rpm/util.py'
--- smart/backends/rpm/util.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/util.py 1970-01-01 00:00:00 +0000
@@ -1,49 +0,0 @@
-#
-# Copyright (c) 2005 Canonical
-#
-# Written by Anders F Bjorklund <afb at users.sourceforge.net>
-#
-# This file is part of Smart Package Manager.
-#
-# Smart Package Manager is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as published
-# by the Free Software Foundation; either version 2 of the License, or (at
-# your option) any later version.
-#
-# Smart Package Manager is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Smart Package Manager; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-import rpm
-
-archscores = {}
-
-def archscore(arch):
- if not arch in archscores:
- try:
- archscores[arch] = rpm.archscore(arch)
- except AttributeError:
- # rpm.archscore missing from RPM 4.4.7 and 5.0.0
- # (but available from 4.4.9 and 5.0.3, and later,
- # using PlatformScore rather than MachineScore)
- archscores[arch] = 1
- return archscores[arch]
-
-def filepaths(h):
- paths = h[rpm.RPMTAG_OLDFILENAMES]
- if not paths:
- dirs = h[rpm.RPMTAG_DIRNAMES]
- base = h[rpm.RPMTAG_BASENAMES]
- paths = []
- for i in range(0,len(dirs)):
- paths.append(dirs[i] + base[i])
- elif type(paths) != list:
- paths = [paths]
- return paths
-
-# vim:ts=4:sw=4:et
=== modified file 'smart/backends/rpm/yast2.py'
--- smart/backends/rpm/yast2.py 2008-12-31 11:12:46 +0000
+++ smart/backends/rpm/yast2.py 2007-10-08 01:42:30 +0000
@@ -22,7 +22,6 @@
from smart.backends.rpm.rpmver import splitarch
from smart.cache import PackageInfo, Loader
from smart.backends.rpm.base import *
-from smart.backends.rpm.util import *
from smart import *
import posixpath
import locale
@@ -189,7 +188,7 @@
raise Error("Error loading YaST2 channel info. Possibly " \
"corrupted file.\n%s" % self._pkginfofile)
- if archscore(arch) <= 0:
+ if rpm.archscore(arch) <= 0:
return
name = nameparts[0]
self.curpkgname = name
=== modified file 'smart/cache.py'
--- smart/cache.py 2008-12-12 07:18:07 +0000
+++ smart/cache.py 2007-05-20 22:42:11 +0000
@@ -193,11 +193,8 @@
filemd5 = self.getMD5(url)
if filemd5:
- try:
- from hashlib import md5
- except ImportError:
- from md5 import md5
- digest = md5()
+ import md5
+ digest = md5.md5()
file = open(localpath)
data = file.read(BLOCKSIZE)
while data:
@@ -210,11 +207,8 @@
else:
filesha = self.getSHA(url)
if filesha:
- try:
- from hashlib import sha1 as sha
- except ImportError:
- from sha import sha
- digest = sha()
+ import sha
+ digest = sha.sha()
file = open(localpath)
data = file.read(BLOCKSIZE)
while data:
=== modified file 'smart/channels/apt_deb.py'
--- smart/channels/apt_deb.py 2008-10-08 15:51:01 +0000
+++ smart/channels/apt_deb.py 2008-09-05 21:59:43 +0000
@@ -217,7 +217,7 @@
packages_items.append(item)
else:
iface.warning(_("Component '%s' is not in Release file "
- "for channel '%s'") % (component, self))
+ "for channel '%s'") % (comp, self))
fetcher.run(progress=progress)
=== modified file 'smart/channels/rpm_md.py'
--- smart/channels/rpm_md.py 2009-01-22 11:34:02 +0000
+++ smart/channels/rpm_md.py 2006-11-24 19:25:39 +0000
@@ -34,7 +34,6 @@
from smart.channel import PackageChannel
from smart import *
import posixpath
-import os
from xml.parsers import expat
@@ -56,14 +55,33 @@
def getFetchSteps(self):
return 3
- def loadMetadata(self, metadatafile):
+ def fetch(self, fetcher, progress):
+
+ fetcher.reset()
+ repomd = posixpath.join(self._baseurl, "repodata/repomd.xml")
+ item = fetcher.enqueue(repomd)
+ fetcher.run(progress=progress)
+
+ if item.getStatus() is FAILED:
+ progress.add(self.getFetchSteps()-1)
+ if fetcher.getCaching() is NEVER:
+ lines = [_("Failed acquiring release file for '%s':") % self,
+ u"%s: %s" % (item.getURL(), item.getFailedReason())]
+ raise Error, "\n".join(lines)
+ return False
+
+ digest = getFileDigest(item.getTargetPath())
+ if digest == self._digest:
+ progress.add(1)
+ return True
+ self.removeLoaders()
+
info = {}
-
try:
- root = ElementTree.parse(metadatafile).getroot()
+ root = ElementTree.parse(item.getTargetPath()).getroot()
except expat.error, e:
raise Error, _("Invalid XML file:\n %s\n %s\n %s") % \
- (metadatafile, repomd, str(e))
+ (item.getTargetPath(), repomd, str(e))
for node in root.getchildren():
if node.tag != DATA:
@@ -79,46 +97,6 @@
if subnode.tag == OPENCHECKSUM:
info[type]["uncomp_"+subnode.get("type")] = \
subnode.text
-
- return info
-
- def getLocalPath(self, fetcher, url):
- from smart.fetcher import FetchItem
- mirror = fetcher.getMirrorSystem().get(url)
- item = FetchItem(fetcher, url, mirror)
- return fetcher.getLocalPath(item)
-
- def fetch(self, fetcher, progress):
-
- fetcher.reset()
- repomd = posixpath.join(self._baseurl, "repodata/repomd.xml")
-
- oldinfo = {}
- path = self.getLocalPath(fetcher, repomd)
- if os.path.exists(path):
- try:
- oldinfo = self.loadMetadata(path)
- except Error:
- pass
-
- item = fetcher.enqueue(repomd)
- fetcher.run(progress=progress)
-
- if item.getStatus() is FAILED:
- progress.add(self.getFetchSteps()-1)
- if fetcher.getCaching() is NEVER:
- lines = [_("Failed acquiring release file for '%s':") % self,
- u"%s: %s" % (item.getURL(), item.getFailedReason())]
- raise Error, "\n".join(lines)
- return False
-
- digest = getFileDigest(item.getTargetPath())
- if digest == self._digest:
- progress.add(1)
- return True
- self.removeLoaders()
-
- info = self.loadMetadata(item.getTargetPath())
if "primary" not in info:
raise Error, _("Primary information not found in repository "
@@ -166,21 +144,6 @@
else:
return False
- uncompressor = fetcher.getUncompressor()
-
- # delete any old files, if the new ones have new names
- for type in ["primary", "filelists", "other"]:
- if type in oldinfo:
- url = oldinfo[type]["url"]
- if url and info[type]["url"] != oldinfo[type]["url"]:
- path = self.getLocalPath(fetcher, url)
- if os.path.exists(path):
- os.unlink(path)
- handler = uncompressor.getHandler(path)
- path = handler.getTargetPath(path)
- if os.path.exists(path):
- os.unlink(path)
-
self._digest = digest
return True
=== modified file 'smart/const.py'
--- smart/const.py 2008-12-12 07:26:36 +0000
+++ smart/const.py 2008-09-08 20:27:13 +0000
@@ -21,7 +21,7 @@
#
import sys
-VERSION = "1.1.1"
+VERSION = "1.1"
RECURSIONLIMIT = sys.getrecursionlimit()
@@ -36,7 +36,7 @@
def __new__(klass, name):
instance = klass._registry.get(name)
if not instance:
- instance = klass._registry[name] = object.__new__(klass)
+ instance = klass._registry[name] = object.__new__(klass, name)
return instance
INSTALL = Enum("INSTALL")
=== modified file 'smart/control.py'
--- smart/control.py 2008-12-12 07:17:44 +0000
+++ smart/control.py 2008-02-19 00:12:08 +0000
@@ -19,11 +19,6 @@
# along with Smart Package Manager; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-import cPickle
-import sys, os
-import copy
-import time
-
from smart.transaction import ChangeSet, ChangeSetSplitter, INSTALL, REMOVE
from smart.util.filetools import compareFiles, setCloseOnExecAll
from smart.util.objdigest import getObjectDigest
@@ -38,11 +33,11 @@
from smart.cache import *
from smart.const import *
from smart import *
-
-
-if sys.version_info < (2, 4):
- from sets import Set as set
-
+import cPickle
+import sys, os
+import copy
+import time
+import md5
class Control(object):
=== modified file 'smart/fetcher.py'
--- smart/fetcher.py 2008-12-12 07:18:07 +0000
+++ smart/fetcher.py 2008-09-05 15:10:59 +0000
@@ -367,11 +367,8 @@
filemd5 = item.getInfo(uncompprefix+"md5")
if filemd5:
- try:
- from hashlib import md5
- except ImportError:
- from md5 import md5
- digest = md5()
+ import md5
+ digest = md5.md5()
file = open(localpath)
data = file.read(BLOCKSIZE)
while data:
@@ -384,11 +381,8 @@
else:
filesha = item.getInfo(uncompprefix+"sha")
if filesha:
- try:
- from hashlib import sha1 as sha
- except ImportError:
- from sha import sha
- digest = sha()
+ import sha
+ digest = sha.sha()
file = open(localpath)
data = file.read(BLOCKSIZE)
while data:
@@ -1115,7 +1109,7 @@
return bool(self._queue or self._active)
def fetch(self):
- import urllib, rfc822, calendar
+ import urllib, rfc822
class Opener(urllib.FancyURLopener):
user = None
@@ -1259,15 +1253,12 @@
mtimes = info["last-modified"]
mtimet = rfc822.parsedate(mtimes)
if mtimet:
- mtime = calendar.timegm(mtimet)
+ mtime = time.mktime(mtimet)
os.utime(localpath, (mtime, mtime))
except urllib.addinfourl, remote:
if remote.errcode == 304: # Not modified
item.setSucceeded(localpath)
- elif remote.errcode == 404:
- # Use a standard translatable error message.
- item.setFailed(_("File not found"))
else:
item.setFailed(remote.errmsg)
=== modified file 'smart/interface.py'
--- smart/interface.py 2008-12-12 07:36:12 +0000
+++ smart/interface.py 2007-03-29 01:31:11 +0000
@@ -148,11 +148,7 @@
x = fcntl.ioctl(1, termios.TIOCGWINSZ, s)
except IOError:
return 80
- width = struct.unpack('HHHH', x)[1]
- if width > 0:
- return width
- else:
- return 80
+ return struct.unpack('HHHH', x)[1]
def createInterface(name, ctrl, command=None, argv=None):
try:
=== modified file 'smart/interfaces/gtk/__init__.py'
--- smart/interfaces/gtk/__init__.py 2008-12-12 07:21:09 +0000
+++ smart/interfaces/gtk/__init__.py 2008-07-22 21:01:43 +0000
@@ -49,10 +49,7 @@
if name not in _pixbuf:
filename = getImagePath(name)
if os.path.isfile(filename):
- try:
- icon_size = sysconf.get("gtk-icon-size")
- except AttributeError:
- icon_size = None
+ icon_size = sysconf.get("gtk-icon-size")
if icon_size:
pixbuf = gtk.gdk.pixbuf_new_from_file_at_size(filename,
icon_size,
=== modified file 'smart/interfaces/gtk/progress.py'
--- smart/interfaces/gtk/progress.py 2008-12-12 07:20:49 +0000
+++ smart/interfaces/gtk/progress.py 2006-10-27 16:49:22 +0000
@@ -299,11 +299,11 @@
def test():
import sys, time
- prog = GtkProgress(True)
+ prog = GtkProgress()
data = {"item-number": 0}
total, subtotal = 100, 100
- prog.start()
+ prog.start(True)
prog.setTopic("Installing packages...")
for n in range(1,total+1):
data["item-number"] = n
=== modified file 'smart/media.py'
--- smart/media.py 2008-12-12 07:23:24 +0000
+++ smart/media.py 2008-06-11 16:28:24 +0000
@@ -328,7 +328,7 @@
if os.access(filename, os.R_OK):
for line in open(filename):
line = line.strip()
- if not line or line[0] == "#" or line[0] == "+":
+ if not line or line[0] == "#":
continue
tokens = line.split()
if len(tokens) < 2:
=== modified file 'smart/plugins/aptchannelsync.py'
--- smart/plugins/aptchannelsync.py 2008-12-12 07:17:44 +0000
+++ smart/plugins/aptchannelsync.py 2008-09-04 21:24:31 +0000
@@ -20,10 +20,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
import posixpath
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
+import md5
import os
# be compatible with 2.3
@@ -72,7 +69,7 @@
continue # We don't deal with these yet.
# Build a unique alias.
- m = md5("%s|%s|%s|%s" % (type, uri, distro, comps))
+ m = md5.new("%s|%s|%s|%s" % (type, uri, distro, comps))
alias = "aptsync-%s" % m.hexdigest()
seen.add(alias)
=== modified file 'smart/util/cdistance.c'
--- smart/util/cdistance.c 2008-11-26 17:30:06 +0000
+++ smart/util/cdistance.c 2005-06-08 20:41:27 +0000
@@ -117,11 +117,6 @@
*ratio = 1.0;
return 0;
}
- if (bl == 0) {
- if (ratio)
- *ratio = 0.0;
- return al;
- }
for (; *a == '*'; a++, al--)
wildstart = 1;
maxl = al>bl?al:bl;
=== modified file 'smart/util/distance.py'
--- smart/util/distance.py 2008-11-26 17:30:06 +0000
+++ smart/util/distance.py 2008-07-22 10:37:20 +0000
@@ -62,8 +62,6 @@
a = a.lstrip("*")
al = len(a)
bl = len(b)
- if bl == 0:
- return al, 0.0
maxl = al > bl and al or bl
if cutoff and type(cutoff) is float:
cutoff = int(maxl-cutoff*maxl)
=== modified file 'smart/util/filetools.py'
--- smart/util/filetools.py 2008-12-12 07:17:44 +0000
+++ smart/util/filetools.py 2008-06-29 20:50:22 +0000
@@ -22,15 +22,12 @@
from smart.const import BLOCKSIZE
import resource
import fcntl
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
+import md5
import os
def getFileDigest(path, digest=None):
if not digest:
- digest = md5()
+ digest = md5.md5()
file = open(path)
while True:
data = file.read(BLOCKSIZE)
@@ -45,8 +42,8 @@
return False
if os.path.getsize(path1) != os.path.getsize(path2):
return False
- path1sum = md5()
- path2sum = md5()
+ path1sum = md5.md5()
+ path2sum = md5.md5()
for path, sum in [(path1, path1sum), (path2, path2sum)]:
file = open(path)
while True:
=== modified file 'smart/util/objdigest.py'
--- smart/util/objdigest.py 2008-12-12 07:17:44 +0000
+++ smart/util/objdigest.py 2004-11-04 23:34:52 +0000
@@ -20,10 +20,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
import cPickle
-try:
- from hashlib import md5
-except ImportError:
- from md5 import md5
+import md5
def getObjectDigest(obj):
return ObjectDigest(obj).getDigest()
@@ -34,7 +31,7 @@
class ObjectDigest(object):
def __init__(self, obj=None):
- self._digest = md5()
+ self._digest = md5.md5()
if obj:
self.addObject(obj)
=== modified file 'smart/util/strtools.py'
--- smart/util/strtools.py 2008-12-12 07:17:44 +0000
+++ smart/util/strtools.py 2007-11-03 06:35:46 +0000
@@ -25,6 +25,7 @@
import posixpath
import string
+import md5
import sys
class ShortURL(object):
=== renamed file 'test' => 'test.py'
--- test 2008-10-08 15:59:14 +0000
+++ test.py 2008-09-04 22:32:15 +0000
@@ -34,7 +34,7 @@
import tests
-USAGE=_("test [options] [<test filename>, ...]")
+USAGE=_("test.py [options] [<test filename>, ...]")
def find_tests(testpaths=()):
=== modified file 'tests/aptdeb.py'
--- tests/aptdeb.py 2008-10-08 15:51:01 +0000
+++ tests/aptdeb.py 2008-09-05 19:55:23 +0000
@@ -8,7 +8,7 @@
from smart.fetcher import Fetcher
from smart.const import NEVER
from smart.cache import Cache
-from smart import Error, sysconf, iface
+from smart import Error, sysconf
from tests.mocker import MockerTestCase
from tests import TESTDATADIR
@@ -341,17 +341,3 @@
self.assertTrue(str(error).endswith(error_message), str(error))
else:
self.fail("Fetch worked with a bad signature! :-(")
-
- def test_fetch_with_component_missing_in_release_file(self):
- iface_mock = self.mocker.patch(iface.object)
- iface_mock.warning("Component 'non-existent' is not in Release file "
- "for channel 'alias'")
- self.mocker.replay()
-
- channel = createChannel("alias",
- {"type": "apt-deb",
- "baseurl": "file://%s/aptdeb" % TESTDATADIR,
- "distribution": "./",
- "components": "non-existent"})
-
- self.assertEquals(channel.fetch(self.fetcher, self.progress), True)
=== removed file 'tests/debbase.py'
--- tests/debbase.py 2008-11-16 00:06:42 +0000
+++ tests/debbase.py 1970-01-01 00:00:00 +0000
@@ -1,36 +0,0 @@
-import sys
-
-from tests.mocker import MockerTestCase
-
-from smart.backends.deb.base import getArchitecture
-
-
-class GetArchitectureTest(MockerTestCase):
-
- def fake_uname(self):
- return ('Linux', 'burma', '2.6.24-19-generic',
- '#1 SMP Wed Aug 20 22:56:21 UTC 2008', self.fake_arch)
-
- def set_arch_and_platform(self, arch, platform):
- self.fake_arch = arch
- sys.platform = platform
-
- def setUp(self):
- self.fake_architecture = "i686"
- self.real_platform = sys.platform
-
- uname_mock = self.mocker.replace("os.uname")
- uname_mock()
- self.mocker.call(self.fake_uname)
- self.mocker.replay()
-
- def tearDown(self):
- sys.platform = self.real_platform
-
- def test_get_architecture_with_i686_linux2(self):
- self.set_arch_and_platform("i686", "linux2")
- self.assertEquals(getArchitecture(), "i386")
-
- def test_get_architecture_with_i686_anything(self):
- self.set_arch_and_platform("i686", "anything")
- self.assertEquals(getArchitecture(), "anything-i386")
=== modified file 'tests/debpm.py'
--- tests/debpm.py 2008-10-08 15:35:32 +0000
+++ tests/debpm.py 2008-09-04 22:32:15 +0000
@@ -1,18 +1,16 @@
import unittest
+import copy
import os
-from smart.backends.deb.base import (
- DebPackage, DebProvides, DebNameProvides, DebPreRequires, DebRequires,
- DebOrRequires, DebUpgrades, DebConflicts, DebBreaks)
-from smart.backends.deb.pm import DebPackageManager, DebSorter, UNPACK, CONFIG
+from smart.backends.deb.pm import DebPackageManager
from smart.channel import createChannel
from smart.sysconfig import SysConfig
from smart.interface import Interface
from smart.progress import Progress
from smart.fetcher import Fetcher
-from smart.cache import Cache, Loader
+from smart.cache import Cache
from smart.const import INSTALL, REMOVE
-from smart import iface, sysconf, cache
+from smart import iface, sysconf
from tests import TESTDATADIR, ctrl
@@ -117,14 +115,13 @@
self.assertEquals(file_url[:7], "file://")
file_path = file_url[7:]
- check_results = []
- def check(argv, output):
- check_results.append(os.environ.get("DEBIAN_FRONTEND"))
- check_results.append(os.environ.get("APT_LISTCHANGES_FRONTEND"))
- check_results.append("--force-confold" in argv)
+ environ = []
+ def check_environ(argv, output):
+ environ.append(os.environ.get("DEBIAN_FRONTEND"))
+ environ.append(os.environ.get("APT_LISTCHANGES_FRONTEND"))
return 0
- self.pm.dpkg = check
+ self.pm.dpkg = check_environ
sysconf.set("pm-iface-output", True, soft=True)
sysconf.set("deb-non-interactive", True, soft=True)
@@ -132,99 +129,5 @@
self.pm.commit({pkg: INSTALL}, {pkg: [file_path]})
# One time for --unpack, one time for --configure.
- self.assertEquals(check_results,
- ["noninteractive", "none", True,
- "noninteractive", "none", True])
-
- def test_deb_non_interactive_false(self):
- pkg = self.cache.getPackages()[0]
- info = self.loader.getInfo(pkg)
-
- file_url = info.getURLs()[0]
- self.assertEquals(file_url[:7], "file://")
- file_path = file_url[7:]
-
- check_results = []
- def check(argv, output):
- check_results.append(os.environ.get("DEBIAN_FRONTEND"))
- check_results.append(os.environ.get("APT_LISTCHANGES_FRONTEND"))
- check_results.append("--force-confold" in argv)
- return 0
-
- self.pm.dpkg = check
-
- sysconf.set("pm-iface-output", False, soft=True)
- sysconf.set("deb-non-interactive", False, soft=True)
-
- self.pm.commit({pkg: INSTALL}, {pkg: [file_path]})
-
- # One time for --unpack, one time for --configure.
- self.assertEquals(check_results,
- [None, None, False,
- None, None, False])
-
-
-class DebSorterTest(unittest.TestCase):
-
- def setUp(self):
- self.packages_to_build = []
- class MyLoader(Loader):
- def load(loader):
- for args in self.packages_to_build:
- loader.buildPackage(*args)
- self.loader = MyLoader()
- self.cache = Cache()
- self.cache.addLoader(self.loader)
-
- def build(self, *args):
- map = {cache.Package: [],
- cache.Provides: [],
- cache.Requires: [],
- cache.Upgrades: [],
- cache.Conflicts: []}
- for arg in args:
- for cls, lst in map.iteritems():
- if issubclass(arg[0], cls):
- lst.append(arg)
- break
- else:
- raise RuntimeError("%r is unknown" % type(arg[0]))
- self.packages_to_build.append(
- (map[cache.Package][0], map[cache.Provides],
- map[cache.Requires], map[cache.Upgrades],
- map[cache.Conflicts]))
-
- def test_conflicts_order_remove_after_unpack_whenever_possible(self):
- self.build((DebPackage, "a", "1"),
- (DebNameProvides, "a", "1"))
- self.build((DebPackage, "a", "2"),
- (DebNameProvides, "a", "2"),
- (DebUpgrades, "a", "<", "2"),
- (DebRequires, "b", "=", "1"))
- self.build((DebPackage, "b", "1"),
- (DebNameProvides, "b", "1"),
- (DebConflicts, "a", "<", "2"))
- self.cache.load()
- changeset = {}
- for pkg in self.cache.getPackages():
- if pkg.name == "a" and pkg.version == "1":
- a_1 = pkg
- elif pkg.name == "a":
- a_2 = pkg
- else:
- b_1 = pkg
-
- a_1.installed = True
-
- changeset[a_1] = REMOVE
- changeset[a_2] = INSTALL
- changeset[b_1] = INSTALL
-
- sorter = DebSorter(changeset)
- sorted = sorter.getSorted()
-
- # XXX That's not yet stable. The deb-ordering-fix branch
- # should bring it to stability.
- #self.assertEquals(sorted,
- # [(a_2, UNPACK), (a_1, REMOVE), (b_1, UNPACK),
- # (b_1, CONFIG), (a_2, CONFIG)])
+ self.assertEquals(environ,
+ ["noninteractive", "none", "noninteractive", "none"])
=== removed file 'tests/initialization.py'
--- tests/initialization.py 2008-11-26 17:10:15 +0000
+++ tests/initialization.py 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
-import sys
-
-from tests.mocker import MockerTestCase
-
-from smart import initPlugins
-
-
-class InitPluginsTest(MockerTestCase):
-
- def setUp(self):
- from smart import const
- self.old_plugins_dir = const.PLUGINSDIR
- self.plugins_dir = self.makeDir()
- const.PLUGINSDIR = self.plugins_dir
-
- def tearDown(self):
- from smart import const
- const.PLUGINSDIR = self.old_plugins_dir
-
- def test_plugins_dir_is_used(self):
- self.makeFile("import sys; sys.test_worked = True",
- basename="plugin.py", dirname=self.plugins_dir)
- initPlugins()
- self.assertEquals(getattr(sys, "test_worked", False), True)
- del sys.test_worked
-
=== removed directory 'tests/util'
=== removed file 'tests/util/__init__.py'
=== removed file 'tests/util/distance.py'
--- tests/util/distance.py 2008-11-26 17:30:06 +0000
+++ tests/util/distance.py 1970-01-01 00:00:00 +0000
@@ -1,11 +0,0 @@
-from tests.mocker import MockerTestCase
-
-from smart.util.distance import globdistance
-
-
-class DistanceTestBase(MockerTestCase):
-
- def test_globdistance_with_empty_values(self):
- self.assertEquals(globdistance("", ""), (0, 1.0))
- self.assertEquals(globdistance("", "a"), (1, 0.0))
- self.assertEquals(globdistance("a", ""), (1, 0.0))
Index: smart.spec
===================================================================
RCS file: /cvs/extras/rpms/smart/F-10/smart.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- smart.spec 27 Dec 2008 13:43:25 -0000 1.38
+++ smart.spec 14 Feb 2009 10:56:19 -0000 1.39
@@ -7,7 +7,7 @@
Summary: Next generation package handling tool
Name: smart
Version: 1.1
-Release: 58.0.1%{?dist}
+Release: 59%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://labix.org/smart/
@@ -17,8 +17,8 @@
Source3: smart.desktop
Source4: distro.py
Source5: ksmarttray.desktop
-# http://bazaar.launchpad.net/%7Esmartpm/smart/bugfix/diff/839/854
-Patch0: 839_854.diff
+# http://bazaar.launchpad.net/%7Esmartpm/smart/bugfix/diff/839/856
+Patch0: 839_856.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python-devel >= 2.3
BuildRequires: desktop-file-utils
@@ -204,8 +204,11 @@
%endif
%changelog
-* Sat Dec 27 2008 Axel Thimm <Axel.Thimm at ATrpms.net> - 1.1-58.0.1
-- Rebuild with proper patch.
+* Sat Feb 14 2009 Axel Thimm <Axel.Thimm at ATrpms.net> - 1.1-59
+- Add some more fixes from the bugfix branch.
+- Fixes Fedora bug #476808 (getPathList on newer rpms not working
+ properly making the content pane apearing empty).
+- Fixes unerased accumulated old repomd metadata bug.
* Sun Dec 21 2008 Axel Thimm <Axel.Thimm at ATrpms.net> - 1.1-58
- Use bugfix branch, remove already included patches.
--- 839_854.diff DELETED ---
More information about the fedora-extras-commits
mailing list