[Piuparts-devel] Bug#773874: piuparts: schroot option fails with valid name without ":"

Sandro Knauß bugs at sandroknauss.de
Wed Dec 24 13:56:01 UTC 2014


Package: piuparts
Version: 0.61
Severity: important
Tags: patch

If I try to use piuparts with schroot parameter:

Command line arguments: /usr/sbin/piuparts --allow-database -D ubuntu -d trusty --schroot trusty-amd64 [...] --apt baloo=4.14.3.0.git20141125.e4ddeb6
0m0.0s INFO: Running on: Linux tabin.local 3.17-1.towo.4-siduction-amd64 #1 SMP PREEMPT siduction 3.17-9 (2014-10-28) x86_64
Traceback (most recent call last):
  File "/usr/sbin/piuparts", line 3068, in <module>
    main()
  File "/usr/sbin/piuparts", line 3060, in main
    process_packages(regular_packages_list)
  File "/usr/sbin/piuparts", line 2973, in process_packages
    chroot.create()
  File "/usr/sbin/piuparts", line 703, in create
    self.setup_from_schroot(settings.schroot)
  File "/usr/sbin/piuparts", line 808, in setup_from_schroot
    self.schroot_session = schroot.split(":")[1] + "-" + str(uuid.uuid1()) + "-piuparts"
IndexError: list index out of range

The schroot environment must not have an ":" as delimiter, than schroot starts a new session. mk-sbuild is there very clear:
To CHANGE the golden image: sudo schroot -c source:${SCHROOT_NAME} -u root
To ENTER an image snapshot: schroot -c $SCHROOT_NAME

and normally you don't want to change the base image if you access schroot or at least you should have the possibility :)

--- a/piuparts       2014-12-24 14:51:34.902723380 +0100
+++ b/piuparts  2014-12-24 14:52:21.306523398 +0100
@@ -805,7 +805,11 @@
         run(prefix + ["tar", "-C", self.name, "-zxf", tarball])
 
     def setup_from_schroot(self, schroot):
-       self.schroot_session = schroot.split(":")[1] + "-" + str(uuid.uuid1()) + "-piuparts"
+       try:
+               name = schroot.split(":")[1]
+       except:
+               name = schroot
+       self.schroot_session = name + "-" + str(uuid.uuid1()) + "-piuparts"
         run(['schroot', '--begin-session', '--chroot', schroot , '--session-name', self.schroot_session])
         ret_code, output = run(['schroot', '--chroot', "session:" + self.schroot_session, '--location'])
         self.name = output.strip()


-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (600, 'unstable'), (500, 'testing'), (500, 'stable'), (110, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.17-1.towo.4-siduction-amd64 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages piuparts depends on:
ii  debootstrap      1.0.66
ii  debsums          2.0.52+nmu2
ii  dpkg             1.17.22
ii  lsb-release      4.1+Debian13+nmu1
ii  lsof             4.86+dfsg-1
ii  piuparts-common  0.61
ii  python-debian    0.1.25
pn  python:any       <none>

Versions of packages piuparts recommends:
ii  adequate  0.12.1

Versions of packages piuparts suggests:
ii  schroot  1.6.10-1+b1

-- debconf-show failed

-- debsums errors found:
debsums: changed file /usr/sbin/piuparts (from piuparts package)



More information about the Piuparts-devel mailing list