Ticket #271: f_option.haikuporter.patch
| File f_option.haikuporter.patch, 2.4 KB (added by thorn, 6 years ago) |
|---|
-
haikuporter
105 105 # read global settings 106 106 mainConfig = Config(haikuPortsConf) 107 107 self.confKeys = mainConfig.getKeys() 108 self.options = options 108 109 109 110 for key in self.confKeys: 110 111 try: … … 291 292 print '*'*80 292 293 293 294 fp.close() 295 296 def setFlag(self, name): 297 f = open('%s/haikuports.%s' %(self.workDir, name), 'w') 298 f.close() 299 300 def checkFlag(self, name): 301 if os.path.exists('%s/haikuports.%s' %(self.workDir, name)): 302 return True 303 else: 304 return False 294 305 295 306 def getTree(self): 296 307 """ Get port tree via svn""" … … 550 561 # create work dir 551 562 if not os.path.exists(self.workDir): 552 563 os.mkdir(self.workDir) 564 if self.checkFlag('unpack') and not self.options.force: 565 return 553 566 # unpack source archive 554 567 os.chdir(self.workDir) 555 568 print "Unpacking " + self.src_local … … 565 578 else: 566 579 print "Unrecognised archive type" 567 580 sys.exit() 581 self.setFlag('unpack') 568 582 569 583 def patch(self): 570 584 """Apply the Haiku patches to the source directory""" 585 if self.checkFlag('patch') and not self.options.force: 586 return 571 587 os.chdir(self.workDir) 572 588 patchFilePath = self.patchesDir + '/' + self.portName + '-' + self.portVersion + '.patch' 573 589 if os.path.exists(patchFilePath): … … 575 591 # TODO: check return code 576 592 else: 577 593 print "No patching required" 594 self.setFlag('patch') 578 595 579 596 def build(self): 580 597 """Build the sources""" 598 if self.checkFlag('build') and not self.options.force: 599 return 581 600 os.chdir(self.workDir) 582 601 # TODO: if self.bepKeys['BUILD'] = empty, warn user 583 602 buildCommands = '' … … 586 605 buildCommands = buildCommands + " && " 587 606 buildCommands = buildCommands + command 588 607 os.system(buildCommands) 608 self.setFlag('build') 589 609 590 610 def install(self): 591 611 """Install the binaries onto the system""" 612 print "Installing ..." 592 613 os.chdir(self.workDir) 593 614 # TODO: if self.bepKeys['INSTALL'] = empty, warn user 594 615 installCommands = '' … … 831 852 action="store_true", dest="update", default=False, 832 853 help="update ports tree (you should get it before)") 833 854 855 parser.add_option("-f", "--force", 856 action="store_true", dest="force", default=False, 857 help="force to perform the steps (upack, patch, build)") 858 834 859 (options, args) = parser.parse_args() 835 860 836 861 haikuporter = HaikuPorter(options, args)
