Hello community, here is the log from the commit of package smart checked in at Sun Aug 6 22:18:05 CEST 2006. -------- --- smart/smart.changes 2006-06-26 07:39:47.000000000 +0200 +++ smart/smart.changes 2006-08-06 14:07:33.000000000 +0200 @@ -1,0 +2,37 @@ +Sun Aug 6 14:06:31 CEST 2006 - cthiel@suse.de + +- added smart-0.42-pycurl.patch to make smart follow location redirects when + using python-curl + +------------------------------------------------------------------- +Sat Aug 5 17:17:19 CEST 2006 - cthiel@suse.de + +- require python-curl, on suse_version > 1010 + +------------------------------------------------------------------- +Sat Aug 5 00:48:07 CEST 2006 - cthiel@suse.de + +- fixed typo in distro.py + +------------------------------------------------------------------- +Fri Aug 4 23:35:09 CEST 2006 - cthiel@suse.de + +- added smart-ksmarttray.patch to call smart-update by absolute path + +------------------------------------------------------------------- +Fri Aug 4 22:57:56 CEST 2006 - cthiel@suse.de + +- improved smart-rpm-check-signatures.patch +- set default keyserver to pgp.mit.edu + +------------------------------------------------------------------- +Fri Aug 4 17:53:01 CEST 2006 - cthiel@suse.de + +- added smart-ksmarttray-runsmart.patch by Steve Boddy + +------------------------------------------------------------------- +Wed Jul 12 21:43:40 CEST 2006 - cthiel@suse.de + +- added smart-rpm-check-signatures.patch by Andrea Arcangeli + +------------------------------------------------------------------- New: ---- smart-0.42-pycurl.patch smart-ksmarttray-runsmart.patch smart-ksmarttray.patch smart-rpm-check-signatures.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ smart.spec ++++++ --- /var/tmp/diff_new_pack.PBSrX8/_old 2006-08-06 22:17:37.000000000 +0200 +++ /var/tmp/diff_new_pack.PBSrX8/_new 2006-08-06 22:17:37.000000000 +0200 @@ -14,19 +14,26 @@ BuildRequires: kdelibs3-devel python-devel python-elementtree python-gtk rpm-devel rpm-python update-desktop-files Summary: Smart Package Manager Version: 0.42 -Release: 1 +Release: 2 Source: %{name}-%{version}.tar.bz2 Source1: distro.py Source2: %{name}.desktop Source3: %{name}-ksmarttray.desktop Patch: %{name}-cElementTree.patch Patch1: %{name}-channel-mirrors.patch +Patch2: %{name}-rpm-check-signatures.patch +Patch3: %{name}-ksmarttray-runsmart.patch +Patch4: %{name}-ksmarttray.patch +Patch5: %{name}-%{version}-pycurl.patch URL: http://smartpm.org Group: System/Packages License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: python-elementtree Requires: python-xml +%if %{suse_version} > 1010 +Requires: python-curl +%endif %py_requires @@ -77,6 +84,10 @@ %setup -q %patch %patch1 +%patch2 +%patch3 +%patch4 +%patch5 %if %{suse_version} < 1010 echo ' sysconf.set("no-rpm-readHeaderFromFD", 3)' >> %{SOURCE1} %endif @@ -161,6 +172,22 @@ /opt/kde3/share/apps/konqueror %changelog -n smart +* Sun Aug 06 2006 - cthiel@suse.de +- added smart-0.42-pycurl.patch to make smart follow location redirects when + using python-curl +* Sat Aug 05 2006 - cthiel@suse.de +- require python-curl, on suse_version > 1010 +* Sat Aug 05 2006 - cthiel@suse.de +- fixed typo in distro.py +* Fri Aug 04 2006 - cthiel@suse.de +- added smart-ksmarttray.patch to call smart-update by absolute path +* Fri Aug 04 2006 - cthiel@suse.de +- improved smart-rpm-check-signatures.patch +- set default keyserver to pgp.mit.edu +* Fri Aug 04 2006 - cthiel@suse.de +- added smart-ksmarttray-runsmart.patch by Steve Boddy +* Wed Jul 12 2006 - cthiel@suse.de +- added smart-rpm-check-signatures.patch by Andrea Arcangeli * Mon Jun 26 2006 - cthiel@suse.de - update to final 0.42 release * Thu Jun 22 2006 - cthiel@suse.de ++++++ distro.py ++++++ --- smart/distro.py 2006-06-21 16:33:04.000000000 +0200 +++ smart/distro.py 2006-08-05 00:49:27.000000000 +0200 @@ -5,11 +5,12 @@ if not sysconf.getReadOnly(): sysconf.set("rpm-check-signatures", True, weak=True) - - for type in ["kernel-bigsmp", "kernel-debug", "kernel-default", - "kernel-dummy", "kernel-iseries64","kernel-ppc64", - "kernel-s390","kernel-s390x","kernel-smp","kernel-source", - "kernel-syms","kernel-um","kernel-xen"]: + sysconf.set("keyserver","pgp.mit.edu", weak=True) + + for type in ["bigsmp", "debug", "default", + "dummy", "iseries64","ppc64", + "s390","smp","source", + "syms","um","xen","xenpae"]: kernel = "kernel-%s" % type pkgconf.setFlag("multi-version", kernel) ++++++ smart-0.42-pycurl.patch ++++++ --- smart/fetcher.py +++ smart/fetcher.py @@ -1625,6 +1625,8 @@ handle.setopt(pycurl.NOPROGRESS, 0) handle.setopt(pycurl.PROGRESSFUNCTION, progress) handle.setopt(pycurl.WRITEDATA, local) + handle.setopt(pycurl.FOLLOWLOCATION, 1) + handle.setopt(pycurl.MAXREDIRS, 5) # check if we have a valid local file and use I-M-S if fetcher.validate(item, localpath): ++++++ smart-ksmarttray-runsmart.patch ++++++ Index: contrib/ksmarttray/src/ksmarttray.cc =================================================================== --- contrib/ksmarttray/src/ksmarttray.cc (revision 735) +++ contrib/ksmarttray/src/ksmarttray.cc (working copy) @@ -48,6 +48,7 @@ { hasActions = false; checkAction.setText("Check"); + startSmartAction.setText("Start Smart..."); stopAction.setText("Stop"); stopAction.setIcon("stop"); stopAction.setEnabled(false); @@ -58,6 +59,7 @@ if (!hasActions) { hasActions = true; checkAction.plug(menu, 1); + startSmartAction.plug(menu, 2); //stopAction.plug(menu, 2); } } @@ -94,6 +96,8 @@ 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()), @@ -112,6 +116,7 @@ return; if (state == StateWaiting) { sysTray.checkAction.setEnabled(false); + sysTray.startSmartAction.setEnabled(false); sysTray.stopAction.setEnabled(true); process.resetAll(); if (manual) @@ -145,6 +150,7 @@ "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"; @@ -159,6 +165,28 @@ } } +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(); @@ -223,6 +251,11 @@ lastKnownStatus = ""; break; + case StateRunningSmart: + state = StateWaiting; + lastKnownStatus = ""; + break; + default: /* Error! */ break; @@ -231,6 +264,7 @@ if (state == StateWaiting) { updateFailed = false; sysTray.checkAction.setEnabled(true); + sysTray.startSmartAction.setEnabled(true); sysTray.stopAction.setEnabled(false); if (!lastKnownStatus.isEmpty()) { Index: contrib/ksmarttray/src/ksmarttray.h =================================================================== --- contrib/ksmarttray/src/ksmarttray.h (revision 735) +++ contrib/ksmarttray/src/ksmarttray.h (working copy) @@ -43,6 +43,7 @@ KAction checkAction; KAction stopAction; + KAction startSmartAction; protected: @@ -69,6 +70,7 @@ StateUpdating, StateChecking, StateUpgrading, + StateRunningSmart, }; State state; @@ -105,6 +107,7 @@ void checkUpgrades(); void manualCheckUpgrades(); void runUpgrades(); + void startSmart(); public: ++++++ smart-ksmarttray.patch ++++++ --- contrib/ksmarttray/src/ksmarttray.cc +++ contrib/ksmarttray/src/ksmarttray.cc @@ -120,9 +120,9 @@ sysTray.stopAction.setEnabled(true); process.resetAll(); if (manual) - process << "smart-update"; + process << "/usr/sbin/smart-update"; else - process << "smart-update" << "--after" << "60"; + process << "/usr/sbin/smart-update" << "--after" << "60"; if (!process.start()) { KNotifyClient::event(sysTray.winId(), "fatalerror", "Couldn't run 'smart-update'."); ++++++ smart-rpm-check-signatures.patch ++++++ Index: smart/interface.py =================================================================== --- smart/interface.py (revision 735) +++ smart/interface.py (working copy) @@ -69,14 +69,14 @@ self._progress = Progress() return self._progress - def askYesNo(self, question, default=False): - return True + def askYesNo(self, question, default=True): + return default - def askContCancel(self, question, default=False): - return True + def askContCancel(self, question, default=True): + return default - def askOkCancel(self, question, default=False): - return True + def askOkCancel(self, question, default=True): + return default def askInput(self, prompt, message=None, widthchars=None, echo=True): return "" Index: smart/backends/rpm/base.py =================================================================== --- smart/backends/rpm/base.py (revision 735) +++ smart/backends/rpm/base.py (working copy) @@ -49,6 +49,8 @@ getTS.ts = rpm.ts(getTS.root) if not sysconf.get("rpm-check-signatures", False): getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) + else: + getTS.ts.setVSFlags(0) dbdir = os.path.join(getTS.root, "var/lib/rpm") if not os.path.isdir(dbdir): try: @@ -75,6 +77,8 @@ ts = rpm.ts(getTS.root) if not sysconf.get("rpm-check-signatures", False): ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) + else: + ts.setVSFlags(0) return ts else: return getTS.ts Index: smart/backends/rpm/pm.py =================================================================== --- smart/backends/rpm/pm.py (revision 735) +++ smart/backends/rpm/pm.py (working copy) @@ -40,6 +40,17 @@ except locale.Error: ENCODING = "C" +def get_rpm_public_key(filepath): + f = file(filepath, 'r') + ts = rpm.ts() + ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) + hdr = ts.hdrFromFdno(f.fileno()) + return hdr.sprintf("%|DSAHEADER?{%{DSAHEADER:pgpsig}}:" + "{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:" + "{%|SIGGPG?{%{SIGGPG:pgpsig}}:" + "{%|SIGPGP?{%{SIGPGP:pgpsig}}:" + "{(none)}|}|}|}|").split()[-1] + class RPMPackageManager(PackageManager): def commit(self, changeset, pkgpaths): @@ -152,12 +163,53 @@ info = loader.getInfo(pkg) mode = pkg in upgrading and "u" or "i" path = pkgpaths[pkg][0] - fd = os.open(path, os.O_RDONLY) - try: - h = ts.hdrFromFdno(fd) - except rpm.error, e: - os.close(fd) - raise Error, "%s: %s" % (os.path.basename(path), e) + for _pass in xrange(2): + fd = os.open(path, os.O_RDONLY) + try: + h = ts.hdrFromFdno(fd) + except rpm.error, e: + os.close(fd) + + # in the slow path we trap the case of a gpg public key not in rpmdb + # and we try to fetch it from the keyserver and we ask the user + # if he wants to trust this key to continue the installation + if not _pass and e.args[0] == 'public key not available': + keyserver = sysconf.get('keyserver') + if not keyserver: + iface.error('To enable the keyserver run: ' + '"smart config --set keyserver=pgp.mit.edu"') + else: + key = get_rpm_public_key(path) + iface.info('Trying to import the key %s from %s...' % (key, keyserver)) + popen = os.popen('gpg --keyserver %s --recv-keys %s' % (keyserver, key)) + popen_out = popen.read() + if popen.close() is not None: + iface.error('gpg failed to import keyid %s, ' + 'please make sure that gpg is installed, ' + 'that the keyserver %s is working ' + 'and that the package %s has a valid signature.' % (key, + keyserver, + path)) + else: + popen_out += '\nThe above GPG key has been imported successfully.\n' \ + 'It is required to install this package:\n\n\t' \ + + os.path.basename(path) + \ + '\n\nDo you want to trust this key forever?\n\n' \ + 'You must verify the below fingerprint before answering.\n' \ + + os.popen('gpg --fingerprint %s' % key).read() + \ + '\nIf you answer "Yes" all other packages signed with this key ' \ + 'will be installed automatically.' + if iface.askYesNo(popen_out, False): + key_armor = os.popen('gpg --export %s' % key, 'r').read() + if ts.pgpImportPubkey(key_armor): + iface.error('rpm failed to import the public key id %s' % key) + else: + # try one more time with the pub key on + continue + + raise Error, "%s: %s" % (os.path.basename(path), e) + else: + break os.close(fd) ts.addInstall(h, (info, path), mode) packages += 1 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...