smart doesn't work with rpm-repackage option

Bug #244589 reported by Rehan Khan
2
Affects Status Importance Assigned to Milestone
Smart Package Manager
New
Undecided
Unassigned

Bug Description

Imported: http://tracker.labix.org/issue268

Reason: A patch was pasted. Has this been checked?

further details: https://blueprints.launchpad.net/smart/+spec/bug-reporting-migration

msg1174 (view) Author: petersurda Date: 2007-07-27.11:22:03

I fixed it, gustavo seems too busy to respond to email, so I'm posting it here too:

--- /tmp/pm.py 2007-07-24 09:12:36.000000000 +0100
+++ /usr/lib/python2.4/site-packages/smart/backends/rpm/pm.py 2007-07-24
10:41:20.000000000 +0100
@@ -280,7 +282,7 @@
     def __init__(self, prog, upgradednames):
         self.prog = prog
         self.upgradednames = upgradednames
- self.data = {"item-number": 0}
+ self.data = {"item-number": 0, "repackage": False}
         self.fd = None
         self.rpmout = None
         self.rpmoutbuffer = ""
@@ -352,16 +354,28 @@
                 self.fd = None

         elif what == rpm.RPMCALLBACK_INST_START:
- info, path = infopath
- pkg = info.getPackage()
             self.data["item-number"] += 1
+ if isinstance(infopath, tuple):
+ info, path = infopath
+ pkg = info.getPackage()
+ name = pkg.name
+ if isinstance(infopath, str):
+ name = infopath
             self.prog.add(1)
- self.prog.setSubTopic(infopath, _("Installing %s") % pkg.name)
+ if self.data["repackage"]:
+ self.prog.setSubTopic(infopath, _("Repackaging %s") % name)
+ self.data["repackage"] = False
+ else:
+ self.prog.setSubTopic(infopath, _("Installing %s") % name)
             self.prog.setSub(infopath, 0, 1, subdata=self.data)
             self.prog.show()

+ elif what == rpm.RPMCALLBACK_REPACKAGE_START:
+ self.data["repackage"] = True
+
         elif (what == rpm.RPMCALLBACK_TRANS_PROGRESS or
- what == rpm.RPMCALLBACK_INST_PROGRESS):
+ what == rpm.RPMCALLBACK_INST_PROGRESS or
+ what == rpm.RPMCALLBACK_REPACKAGE_PROGRESS):
             self.prog.setSub(infopath or "trans", amount, total,
                              subdata=self.data)
             self.prog.show()

msg1103 (view) Author: thimm Date: 2007-02-15.22:25:08

This was confirmed to still be an issue with 0.50.

msg1055 (view) Author: thimm Date: 2006-12-28.13:42:05

Copied over from https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218145
=======================
Opened by Igor Jagec (<email address hidden>) on 2006-12-01 20:06 EST [reply]

Description of problem:

SmartPM doesn't work with rpm-repackage option

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

$ rpmgrep smart
fedora-package-config-smart-6-8.i386
smart-0.42-40.fc6.i386
smart-gui-0.42-40.fc6.i386
smartmontools-5.36-3.i386

How reproducible:

Every time

Steps to Reproduce:
1. # smart upgrade -y

Actual results:

It fails to upgrade the system

Expected results:

To upgrade the system

Additional info:

# smart upgrade -y
Loading cache...
Updating cache... ######################################## [100%]

Computing transaction...
Committing transaction...
Preparing... ######################################## [ 0%]

Traceback (most recent call last):
  File "/usr/bin/smart", line 194, in ?
    main(sys.argv[1:])
  File "/usr/bin/smart", line 167, in main
    exitcode = iface.run(opts.command, opts.argv)
  File "/usr/lib/python2.4/site-packages/smart/interface.py", line 53, in run
    result = _command.main(self._ctrl, opts)
  File "/usr/lib/python2.4/site-packages/smart/commands/upgrade.py", line 182,
in main
    ctrl.commitTransaction(trans, confirm=confirm)
  File "/usr/lib/python2.4/site-packages/smart/control.py", line 464, in
commitTransaction
    return self.commitChangeSet(trans.getChangeSet(), caching, confirm)
  File "/usr/lib/python2.4/site-packages/smart/control.py", line 518, in
commitChangeSet
    pmclass().commit(pmcs, pkgpaths)
  File "/usr/lib/python2.4/site-packages/smart/backends/rpm/pm.py", line 218,
in commit
    probs = ts.run(cb, None)
  File "/usr/lib/python2.4/site-packages/smart/backends/rpm/pm.py", line 303,
in __call__
    info, path = infopath
ValueError: too many values to unpack

[root@localhost igor]# smart config --set rpm-repackage=false

[root@localhost igor]# smart upgrade -y
Loading cache...
Updating cache... ######################################## [100%]

Computing transaction...
Committing transaction...
Preparing... ######################################## [ 0%]
   1:Installing openssl ######################################## [ 7%]
   2:Cleaning openssl ######################################## [ 14%]
   3:Installing dbus ######################################## [ 21%]
   4:Cleaning dbus ######################################## [ 28%]
   5:Installing freetype ######################################## [ 35%]
   6:Cleaning freetype ######################################## [ 42%]
   7:Installing hsqldb ######################################## [ 50%]
   8:Cleaning hsqldb ######################################## [ 57%]
   9:Installing gnome-session ######################################## [ 64%]
  10:Cleaning gnome-session ######################################## [ 71%]
  11:Installing dbus-x11 ######################################## [ 78%]
  12:Cleaning dbus-x11 ######################################## [ 85%]
  13:Installing freetype-devel ######################################## [ 92%]
  14:Cleaning freetype-devel ######################################## [100%]
=======================

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.