All pastes #992225 Raw Edit

Unnamed

public text v1 · immutable
#992225 ·published 2008-04-21 18:04 UTC
rendered paste body
laga@prometheus:~/dev/mythbuntu/mythbuntu-control-centre$ bzr diff -r214
=== modified file 'MythbuntuControlCentre/changer.py'
--- MythbuntuControlCentre/changer.py   2008-04-09 14:24:39 +0000
+++ MythbuntuControlCentre/changer.py   2008-04-12 13:38:55 +0000
@@ -998,8 +998,15 @@
             progbar = self.progressbar
             fraction=0

+            # other locales break parsing
+            oldlocale = os.getenv('LC_ALL')
+            os.putenv('LC_ALL','en_GB')
             pp=Popen3('/usr/sbin/ltsp-build-client ' + ltsp_args + ' 2>/dev/null')
-            for nn in xrange(3472):
+            if oldlocale is None:
+                oldlocale = ''
+            os.putenv('LC_ALL',oldlocale)
+            #for nn in xrange(3472): # this seems to be number of lines spit out by ltsp-build-client
+            for nn in xrange(4083):
                 while gtk.events_pending():
                     gtk.main_iteration(True)
                 line = pp.fromchild.readline().strip()
@@ -1008,9 +1015,10 @@
                 out = self.line_filter(line)
                 if out:
                     progbar.set_text(out)
-                    step = fraction+0.000666667 #0.000731529 for http, 0.000877193 for cdroms
-
-                    #reset when we hit 100 percent.  this is about where it starts installing things
+                    #step = fraction+0.000666667 #0.000731529 for http, 0.000877193 for cdroms
+                    step = fraction+0.000389863 # mythbuntu-diskless in hardy
+                    # reset when we hit 100 percent.  this shouldn't happen
+                    # old behavior: reset before it starts to install things
                     if step > 1.0:
                         step = 0
                     progbar.set_fraction(step)
@@ -1021,10 +1029,11 @@

     def diskless_pen(self,enable,arch,wol,block,nbd):
         """Creates a pen drive to use with diskless stuff"""
-        print 'ltsp_base_dir: ' + ltsp_base_dir
-        print 'arch: ' + arch
-        print 'block: ' + block
-        print 'nbd: ' + nbd
+        if self.mcc_debug():
+            print 'ltsp_base_dir: ' + ltsp_base_dir
+            print 'arch: ' + arch
+            print 'block: ' + block
+            print 'nbd: ' + nbd
         def diskless_pendrive_dowork():
             #install syslinux
             os.system('syslinux /dev/' + partition)
@@ -1136,6 +1145,8 @@
             file.close()

     def line_filter(self, line):
+        if self.mcc_debug():
+            print line
         if line.startswith('Retrieving') or line.startswith('Validating') or line.startswith('Extracting') or line.startswith('Installing') or line.startswith('Unpacking') or line.startswith('Configuring') or line.startswith('Need to get') or line.startswith('Setting up') or line.startswith('Cleaning'):
             line = line.split('(')[0]
             if not line.endswith('...'):
@@ -1146,5 +1157,13 @@
             line = 'Retrieving '+line.split()[3]+'...'
             self.lines=self.lines+1
             return line
+        elif line.startswith('Parallel mksquashfs:'):
+            line = 'Compressing image. This can take a while.'
+            self.lines=self.lines+1
+            return line
         else:
             return
+
+    def mcc_debug(self):
+        env = os.getenv('MCC_DEBUG')
+        return env == 'true' or env == '1' or env == 'True' or env == 'TRUE' or env == 'Yes' or env == 'YES'

=== modified file 'debian/changelog'
--- debian/changelog    2008-04-11 06:07:35 +0000
+++ debian/changelog    2008-04-21 18:02:19 +0000
@@ -1,3 +1,11 @@
+mythbuntu-control-centre (0.28-0ubuntu1) hardy; urgency=low
+
+  * add MCC_DEBUG environment variable. set to "true" to get additional
+    debugging output. only applies for -diskless right now
+  * fix the progress bar for -diskless
+
+ -- Michael Haas <laga@laga.ath.cx>  Mon, 21 Apr 2008 20:01:38 +0200
+
 mythbuntu-control-centre (0.27-0ubuntu1) hardy; urgency=low

   * Correct error in checking diskless dictionaries for dhcp3

=== modified file 'debian/rules'
--- debian/rules        2008-04-11 06:07:35 +0000
+++ debian/rules        2008-04-21 18:02:54 +0000
@@ -6,7 +6,7 @@
 include /usr/share/cdbs/1/class/makefile.mk
 include /usr/share/cdbs/1/rules/langpack.mk

-BZR_REVISION+=214
+BZR_REVISION+=216
 BZR_BRANCH+=http://bazaar.launchpad.net/~mythbuntu/mythbuntu/$(DEB_SOURCE_PACKAGE)
 TARFILE+=$(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz