Ubiquity installer issue: inserting values into debconf and writing to a file during installation

Pieter van Zyl pvzyl at csir.co.za
Thu Apr 24 11:06:48 BST 2008

Good day

I have a problem with inserting values into debconf.

I am busy with creating a page in ubiquity to select packages from a
list to install.

I read in the list of packages from a file and then create the gtk
components and page.

Then when the user selects these options I try to insert the selected
values/packages in either: in a file or in debconf

Using debconf:
If I try to insert the selected values into debconf I get the following

exception caught in process_line:
Traceback (most recent call last):
  File "/usr/lib/ubiquity/ubiquity/filteredcommand.py", line 112, in
    return self.dbfilter.process_line()
  File "/usr/lib/ubiquity/ubiquity/debconffilter.py", line 260, in
    if not input_widgets[0].run(priority, question):
  File "/usr/lib/ubiquity/ubiquity/components/scib.py", line 38, in run
  File "/usr/lib/ubiquity/ubiquity/components/scib.py", line 106, in
    self.preseed_bool(name, self.yesInstall)
  File "/usr/lib/ubiquity/ubiquity/filteredcommand.py", line 293, in
    self.preseed(name, 'true', seen)
  File "/usr/lib/ubiquity/ubiquity/filteredcommand.py", line 284, in
    self.db.register('debian-installer/dummy', name)
  File "/usr/lib/python2.5/site-packages/debconf.py", line 60, in
    lambda *args, **kw: self.command(command, *args, **kw))
  File "/usr/lib/python2.5/site-packages/debconf.py", line 96, in
    raise DebconfError(status, data)
DebconfError: (20, 'Incorrect number of arguments')

No idea why this happens.

I am iterating through a list and trying to add the package name and the
value true into debconf. Example (packageX,True)

for package in list:
            self.yesInstall = True

            name = str(package)
            name = name.strip(name)
            name = unicode(name)

            self.preseed_bool(name, self.yesInstall) 

I am using the preseed_bool method to insert into debconf

If I create a string value and insert it using preseed_bool it works but
when I iterate using the package names it fails

I suspect it has something to do with the encoding?

Writing the selected values to a file:

If I iterate through the selected packages and try to write them to a
file I get this error:
self.output_file =
IOError [Errno 13] permission denied:

The file I try to create and write to:
self.output_file =

Any ideas on how to fix this? I have tried to create the file and have
it on the live cd and I still get that error. Do I need to set
permissions or the mode?



My script class:

class ScientificPackageInstall(FilteredCommand):
    def prepare(self):
        print "prepare"
        questions = ['^scib/install',
        return (['/usr/share/ubiquity/scib_script'], questions)

    def run(self,priority,question):
        print "run ScientificPackageInstall"
        if question.startswith('scib/install'):
            install = self.frontend.pvz_cool()
            #self.preseed('scib/install', install)
        elif question.startswith('scib/xDrawChem'):
            math = self.frontend.get_xDrawChemBtn()
            print "xDrawChem SELECTED fc: ",math
        elif question.startswith('scib/chemtool'):
            bio = self.frontend.get_chemtoolBtn()
            self.preseed_bool('scib/chemtool', bio)
            list = []
            list = self.frontend.get_packages_to_install()
            test_string = 'pvz'
            self.yesInstall = True
            self.preseed_bool(test_string, self.yesInstall) 
#            self.store_packages_to_install_in_file(list)
            print "chemtool SELECTED fc: ",bio
        return FilteredCommand.run(self, priority, question)

    def ok_handler(self):
        print "ok_handler ScientificPackageInstall"
    def store_packages_to_install_in_file(self,list):
#        self.chroot_setup()
#        self.target = '/target'

        self.output_file =
        st = os.lstat(self.output_file)
        mode = stat.S_IMODE(st.st_mode)
        print "Mode: ",mode
        access = os.access(self.output_file, mode)
        print "access: ",access
        if not os.path.exists(self.output_file):
            print "file does not exists"
        self.output_file =
        for package in list:
            print "install: ",package
#            self.db.set(package, True) 
#        self.chroot_cleanup()
        #end store_packages_to_install
    def store_packages_to_install_in_debconf(self,list):
        self.yesInstall = True
        for package in list:
            print "install: ",package
            #this works
            #self.preseed_bool('scib/chemtool', self.yesInstall) 
               store the package name in debconf using its name:
               This does not work. Does not seem happy with the string?
Maybe need to do a conversion
            print "str: ",str(package)
            test_string = 'pvz'
            #name = repr(package)
            name = str(package)
            name = name.strip(name)
            name = unicode(name)

            self.preseed_bool(test_string, self.yesInstall) 
            self.preseed_bool(name, self.yesInstall)

This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

More information about the Ubuntu-installer mailing list