Exemplo n.º 1
0
 def on_rpmPrepButton_clicked(self):
     projectName = self.getCurrentProject()
     if projectName is None:
         return
     alreadyInstalled = list()
     for package in self.selectedPackages():
         if self.manager.isInstalledInChRoot(self.__project, package):
             alreadyInstalled.append(package)
     if len(alreadyInstalled) > 0:
         questionString = u"The packages <b>%s" % unicode(
             alreadyInstalled[0])
         for package in alreadyInstalled[1:]:
             questionString += u", %s" % unicode(package)
         questionString += u"</b> are already present in the project file system, "
         questionString += u"do you want to overwrite them ?"
         result = QMessageBox.question(self.mainWindow,
                                       u"Overwrite ?",
                                       questionString,
                                       buttons=QMessageBox.Yes
                                       | QMessageBox.Cancel,
                                       defaultButton=QMessageBox.Yes)
         if result != QMessageBox.Yes:
             return
     self.__mapOnSelectedPackages(
         firstArgLast(self.manager.buildPrep), None,
         u"Importing %(arg)s source in file system " +
         "and executing %%prep", self.__handleRpmOperationResult,
         projectName)
Exemplo n.º 2
0
 def on_rpmBuildRpmButton_clicked(self):
     projectName = self.getCurrentProject()
     if projectName is None:
         return
     self.__mapOnSelectedPackages(firstArgLast(self.manager.packageRpm),
                                  None, u"Packaging %(arg)s",
                                  self.__handleRpmOperationResult,
                                  projectName)
Exemplo n.º 3
0
 def on_rpmInstallButton_clicked(self):
     projectName = self.getCurrentProject()
     if projectName is None:
         return
     self.__mapOnSelectedPackages(
         firstArgLast(self.manager.installRpm), None,
         u"Executing %%install section of %(arg)s",
         self.__handleRpmOperationResult, projectName)
Exemplo n.º 4
0
    def __refreshStatus(self, packagesNames=None):
        if packagesNames is None:
            if len(self.selectedPackages()) == 0:
                self.selectAllPackages()
            packagesNames = self.selectedPackages()

        self.__callWithSelectedPackages(
            firstArgLast(self.__refreshBothStatuses),
            u"Refreshing package status", self.refresh, packagesNames,
            self.getCurrentProject())
Exemplo n.º 5
0
    def on_updateFilesButton_clicked(self):
        project = self.getCurrentProject()
        if project is None:
            return

        self.__mapOnSelectedPackages(
            firstArgLast(self.manager.testConflict),
            u"Checking for potential conflicts",
            u"Checking if package <i>%(arg)s</i> has a conflict",
            self.__preCheckingConflicts, project)
Exemplo n.º 6
0
    def __doUpdatePackages(self):
        def myRefreshStatus(arg=[]):
            packageToRefreshList = [x[0] for x in arg]
            self.__refreshStatus(packageToRefreshList)

        project = self.getCurrentProject()
        if project is None:
            return

        self.__callWithSelectedPackages(
            firstArgLast(self.manager.updatePackage), u"Updating packages",
            myRefreshStatus, None, project)