On 20.06.2009 12:24, Steffen Moeller wrote:
Package: python-central
Version: 0.6.11
Severity: important
Tags: patch

Hello, this problem may be more severy than just important. An invocation of 
dh_pycentral
by dpkg-buildpackage and CDBS with debian/rules only being

#!/usr/bin/make -f
export DEB_PYTHON_SYSTEM=pycentral
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

led to

Traceback (most recent call last):
   File "/usr/bin/pycentral", line 2096, in<module>
     main()
   File "/usr/bin/pycentral", line 2090, in main
     rv = action.run(global_options)
   File "/usr/bin/pycentral", line 1947, in run
     pkg.read_pyfiles()
   File "/usr/bin/pycentral", line 357, in read_pyfiles
     lines.append(os.path.join(d, name))
UnboundLocalError: local variable 'd' referenced before assignment

and me producing the following (apparently working but I don't know what I was 
truly doing)
patch

--- /tmp/orig   2009-06-20 12:14:06.501359540 +0200
+++ /usr/bin/pycentral  2009-06-20 12:14:30.209357195 +0200
@@ -353,8 +353,8 @@
                  if root != self.pkgdir:
                      d = root[len(self.pkgdir):]
                      lines.append(d)
-                for name in files:
-                    lines.append(os.path.join(d, name))
+                    for name in files:
+                        lines.append(os.path.join(d, name))
          else:
              config_file = '/usr/share/pyshared-data/%s' % self.name
              if self.pkgconfig:

so, the loop that depends on d was just rendered a part of the "if"
to get access to d.

the patch looks ok, but the test case seems to have files in debian/<pkgname>, which no real package should have. Fixing for the next upload.

  Matthias



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to