Commits

Moises Henriquez committed 81baea7

Delayed source type detection until after the job starts. This keeps the GUI from lagging when adding large jobs to the queue

Comments (0)

Files changed (2)

src/vpackager/bot.py

         self.parent = parent
 
     def _get_next_job(self):
+        ''' Get the next job in line from the database '''
         return dbutils.GetNextJob()
-        db = sqlite3.connect('/tmp/vpackager.db')
-        c = db.cursor()
-        c.execute('select * from queue')
-        ret = c.next()
-        c.close()
-        return ret
 
     def _log_job_start(self, _id):
+        ''' Log the job start to the database history'''
         return dbutils.LogJobStart(_id)
 
     def _log_job_end(self, _id, stdoutpath, result):
+        ''' Log the job end to the database history'''
         return dbutils.LogJobEnd(_id, stdoutpath, result)
 
     def _refresh_views(self):
+        ''' Refresh the screens that show the database status '''
         self.parent.historyman._refresh_history_display()
         self.parent.queueman._update_queue()
 

src/vpackager/buildutils.py

                 _sources_home, self.app,
                 'package_%s-%s'% (self.app, self.ver))
         self.__dump = []
-        self.builder = self.FindSourceType()
+        #self.builder = self.FindSourceType()
 
     def install_pkg(self):
         fullpath = glob.glob(os.path.join(
         ### The only diff from using this vs sbbuilder itself is that
         ### This app can guess what type of slackbuild needs to be
         ### created for the app to build.
+        if not self.builder:
+            self.builder = self.FindSourceType()
+
         try:
             os.makedirs(_sources_home)
         except:
         """ Internal method to collect a list of the contents of the tarball"""
         self.__dump.append('/'.join(line.strip().split('/')[1::]))
 
-    def FindSourceType(self):
+    def _FindSourceType(self):
         """ Determine what type of slackbuild we need to generate for this
         application to build."""
         cmd = 'tar -tf %s'% self.path
         elif 'autogen.sh' in self.__dump:
             self.builder = 'default'
         elif 'Makefile' in self.__dump:
-            self.builder = 'default'
+            #FIXME: sbbuilder needs to accomodate sources with Makefile only
+            self.builder = '--noconfig'
         elif 'CMakeLists.txt' in self.__dump:
             self.builder = 'cmake'
         elif 'setup.py' in self.__dump: