Activity log for bug #1000527

Date Who What changed Old value New value Message
2012-05-17 02:43:01 Wookey bug added bug
2012-05-17 09:36:19 Wookey description After fixing usb-creator so it builds, I tried it on a debian box and found a problem: in install.py is a load of code to use syslinx-legacy and apropriate options either side of the 10.04 and 10.10 Ubuntu releases. That fails if a debian iso has been burned onto the USB stick. target_os_ver, our_os_ver = self.os_vers() File "/usr/lib/python2.7/dist-packages/usbcreator/install.py",line 206, in os_vers target_os_ver = debian_support.Version(contents[1]) File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 172, in __init__ super(AptPkgVersion, self).__init__(version) File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 91, in __init__ self.full_version = version File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 117, in __setattr__ self._set_full_version(str(value)) File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 96, in _set_full_version raise ValueError("Invalid version string %r" % version) ValueError: Invalid version string 'GNU/Linux' This is because of this code: if os.path.exists(os.path.join(self.target, '.disk', 'info')): with open(os.path.join(self.target, '.disk', 'info'),'r') as f: contents = f.readline().split() if len(contents) > 2: # Consider point releases the same as the initial release # (10.04.4 -> 10.04) target_os_ver = debian_support.Version(contents[1]) becuause .disk/info is: Debian GNU/Linux wheezy-DI-a1 "Wheezy" - Official Snapshot amd64 NETINST Binary-1 20120512-00:39 so the code tries to parse "GNU/Linux" as debian version number and rightly fails. BTW I'm not sure that the 'debian_support.Version' fn is really apropriate here as it seems to be designed for package version numbers not release numbers - mind you this works OK: our_os_ver = debian_support.Version( lsb_release.get_distro_information()['RELEASE']) My python is not good enough to work out what to do about this. You could just look for contents[3] and not use the 'Version' function. (There is a 'Release' fn which might be helpful here?) Or perhaps better is to simply not do any of this checking on Debian as we've been on syslinux 2.4 since squeeze, and there isn't a syslinux-legacy package to use anyway. I'm not sure of the full implications here. In fact how much do we care about people writing images older then 10.10 any more. Could it all just be simplified for Ubuntu too? There is a lot of simplification possible in install_bootloader, mangle_syslinux, need_syslinux_legacy etc. Someone who actually speaks python and is vaguely famliar with the code could presumably fix this without too much trouble. Hope this is helpful to someone. After fixing usb-creator so it builds on debian, I tried it on a debian box and found a problem: in install.py is a load of code to use syslinx-legacy and apropriate options either side of the 10.04 and 10.10 Ubuntu releases. That fails if a debian iso has been burned onto the USB stick.     target_os_ver, our_os_ver = self.os_vers()       File "/usr/lib/python2.7/dist-packages/usbcreator/install.py",line 206, in os_vers     target_os_ver = debian_support.Version(contents[1])       File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 172, in __init__     super(AptPkgVersion, self).__init__(version)       File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 91, in __init__     self.full_version = version       File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 117, in __setattr__     self._set_full_version(str(value))       File "/usr/lib/python2.7/dist-packages/debian/debian_support.py", line 96, in _set_full_version     raise ValueError("Invalid version string %r" % version)     ValueError: Invalid version string 'GNU/Linux' This is because of this code: if os.path.exists(os.path.join(self.target, '.disk', 'info')):     with open(os.path.join(self.target, '.disk', 'info'),'r') as f:         contents = f.readline().split()     if len(contents) > 2:         # Consider point releases the same as the initial release         # (10.04.4 -> 10.04)         target_os_ver = debian_support.Version(contents[1]) becuause .disk/info is: Debian GNU/Linux wheezy-DI-a1 "Wheezy" - Official Snapshot amd64 NETINST Binary-1 20120512-00:39 so the code tries to parse "GNU/Linux" as debian version number and rightly fails. BTW I'm not sure that the 'debian_support.Version' fn is really apropriate here as it seems to be designed for package version numbers not release numbers - mind you this works OK: our_os_ver = debian_support.Version(       lsb_release.get_distro_information()['RELEASE']) My python is not good enough to work out what to do about this. You could just look for contents[3] and not use the 'Version' function. (There is a 'Release' fn which might be helpful here?) Or perhaps better is to simply not do any of this checking on Debian as we've been on syslinux 2.4 since squeeze, and there isn't a syslinux-legacy package to use anyway. I'm not sure of the full implications here. In fact how much do we care about people writing images older then 10.10 any more. Could it all just be simplified for Ubuntu too? There is a lot of simplification possible in install_bootloader, mangle_syslinux, need_syslinux_legacy etc. Someone who actually speaks python and is vaguely famliar with the code could presumably fix this without too much trouble. Hope this is helpful to someone.
2012-05-17 10:04:38 Wookey attachment added usb-creator-2.2.8.patch https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/1000527/+attachment/3150332/+files/usb-creator-2.2.8.patch
2012-05-17 12:14:24 Ubuntu Foundations Team Bug Bot tags patch
2012-05-17 12:14:31 Ubuntu Foundations Team Bug Bot bug added subscriber Ubuntu Review Team
2012-05-17 18:16:29 Wookey attachment removed usb-creator-2.2.8.patch https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/1000527/+attachment/3150332/+files/usb-creator-2.2.8.patch
2012-05-17 18:17:11 Wookey attachment added usb-creator-2.2.8-debfix.patch https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/1000527/+attachment/3150923/+files/usb-creator-2.2.8-debfix.patch