Logo Search packages:      
Sourcecode: falcon version File versions  Download package

def falcon::config::SystemConfiguration::set_options (   self,
  options,
  needs_rootdir = True,
  action = None 
)

Main initialization function

Definition at line 142 of file config.py.

00142                                                                    :
        """Main initialization function"""
        super(SystemConfiguration, self).set_options(options)
        # Option checking
        if options.application == 'falcon':
            if options.force_yes and options.force_no:
                falcon.util.error(_("Can't force both yes and no"))
            if not options.iso_architecture:
                self.iso_architecture = self.architecture
            try:
                self.isosize = int(self.isosize)
            except:
                falcon.util.error(_("Iso size should be a number"))
        if options.application == 'falcon-import':
            if options.delete and not options.extract:
                falcon.util.error(_("Deleting files without extracting them is silly"))
        if action and action != 'build':
            if bool(options.component) ^ bool(options.pocket):
                falcon.util.error(_("You need to specify both pocket and component (or neither)"))

        # Check rootdir
        if os.path.islink(os.path.join(os.getenv('HOME'), '.falcon', 'rootdir')):
            self.rootdir = os.readlink(os.path.join(os.getenv('HOME'), '.falcon', 'rootdir')) 
        if options.rootdir:
            self.rootdir = options.rootdir

        if self.rootdir:
            if not os.path.exists(self.rootdir):
                if needs_rootdir:
                    falcon.util.error(_("Repository root %s does not exist") % self.rootdir)
                falcon.util.warning(_("Repository root %s does not exist") % self.rootdir)
            else:
                if 'pocket' in dir(options) and options.pocket:
                    if not os.path.exists(os.path.join(self.rootdir, 'pool', options.pocket)):
                        falcon.util.error(_("Pocket %s does not exist") % options.pocket)
                    if options.component:
                        if not os.path.exists(os.path.join(self.rootdir, 'pool', options.pocket, options.component)):
                            falcon.util.error(_("Pocket %s does not exist") % os.path.join(options.pocket, options.component))
                falcon.init_rootdir()
        elif needs_rootdir:
            falcon.util.error(_("No repository root sepcified"))

    def configure(self):


Generated by  Doxygen 1.6.0   Back to index