Esempio n. 1
0
    def rebuild(names):
        ''' Rebuilds the specified packages '''
        if not Config.get('pkgbuild', False):
            LocalRepo.error(
                _('Please specify \'pkgbuild\' in your config file!'))

        LocalRepo.add([PkgbuildLog.log_dir(name) for name in names],
                      force=True)
Esempio n. 2
0
	def _load_pkgbuild(name, path):
		''' Stores the PKGBUILD dir or loads an existing PKGBUILD from the pkgbuild dir '''
		if not path.startswith(PkgbuildLog.log_dir(name)):
			PkgbuildLog.store(name, path)
			return path

		try:
			tmpdir = join(mkdtemp(dir=Package.get_tmpdir()), name)
			copytree(path, tmpdir)
			return tmpdir
		except:
			raise BuildError(_('Could not load PKGBUILD into workspace: {0}').format(path))
Esempio n. 3
0
    def _process_pkgbuild(path):
        ''' Parses the PKGBUILD and stores or loads it in/from the pkgbuild dir '''
        info = PkgbuildParser(path).parse()
        path = dirname(path)

        if not Config.get('pkgbuild', False):
            return path, info

        if not path.startswith(PkgbuildLog.log_dir(info['name'])):
            PkgbuildLog.store(info['name'], path)
            return path, info

        tmpdir = join(Package.get_tmpdir(), info['name'])
        PkgbuildLog.load(info['name'], tmpdir)
        return tmpdir, info
Esempio n. 4
0
	def _process_pkgbuild(path):
		''' Parses the PKGBUILD and stores or loads it in/from the pkgbuild dir '''
		info = PkgbuildParser(path).parse()
		path = dirname(path)

		if not Config.get('pkgbuild', False):
			return path, info

		if not path.startswith(PkgbuildLog.log_dir(info['name'])):
			PkgbuildLog.store(info['name'], path)
			return path, info

		tmpdir = join(Package.get_tmpdir(), info['name'])
		PkgbuildLog.load(info['name'], tmpdir)
		return tmpdir, info
Esempio n. 5
0
	def test_pkgbuild_log_dir(self):
		PkgbuildLog.init(self.repo)
		self.assertEqual(join(self.pkgbuild, 'pkgname'), PkgbuildLog.log_dir('pkgname'))
Esempio n. 6
0
	def rebuild(names):
		''' Rebuilds the specified packages '''
		if not Config.get('pkgbuild', False):
			LocalRepo.error(_('Please specify \'pkgbuild\' in your config file!'))

		LocalRepo.add([PkgbuildLog.log_dir(name) for name in names], force=True)
Esempio n. 7
0
 def test_pkgbuild_log_dir(self):
     PkgbuildLog.init(self.repo)
     self.assertEqual(join(self.pkgbuild, 'pkgname'),
                      PkgbuildLog.log_dir('pkgname'))