From 5c21eedafbc6aaeec4aff6e8a39cc4e2184e0971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 5 Jul 2005 09:10:06 +0000 Subject: [PATCH] =?UTF-8?q?SVN-like=20pisi-cli'a=20ba=C5=9Fl=C4=B1yorum...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi-build | 88 ------------------------------------------------------ 1 file changed, 88 deletions(-) delete mode 100755 pisi-build diff --git a/pisi-build b/pisi-build deleted file mode 100755 index 30e4651f..00000000 --- a/pisi-build +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# python standard library -from os.path import basename, dirname, join -import sys -from optparse import OptionParser - -# pisi modules -sys.path.append("./lib") -import pisi.util -from pisi.ui import ui -from pisi.context import BuildContext -from pisi.config import config -from pisi.constants import const -from pisi.build import PisiBuild, PisiBuildError -from pisi.purl import PUrl -from pisi.fetcher import fetchUrl - - -class RemoteSource(object): - def __init__(self, url): - self.url = url - self.location = dirname(self.url.uri) - - pkgname = basename(dirname(self.url.path())) - self.dest = join(config.tmp_dir(), pkgname) - - self.fetch_pspec() - pspec = join(self.dest, self.url.filename()) - self.ctx = BuildContext(pspec) - - self.fetch_actionsfile() - self.fetch_patches() - self.fetch_additionalFiles() - - def fetch_pspec(self): - self.fetchFile(self.url.uri) - - def fetch_actionsfile(self): - actionsuri = join(self.location, const.actions_file) - self.fetchFile(actionsuri) - - def fetch_patches(self): - spec = self.ctx.spec - for patch in spec.source.patches: - patchuri = join(self.location, - const.files_dir, patch.filename) - self.fetchFile(patchuri, const.files_dir) - - def fetch_additionalFiles(self): - spec = self.ctx.spec - for afile in spec.source.additionalFiles: - afileuri = join(self.location, - const.files_dir, patch.filename) - self.fetchFile(afileuri, const.files_dir) - - def fetchFile(self, uri, appendDest=""): - ui.info("Fetching %s\n" % uri) - dest = join(self.dest, appendDest) - fetchUrl(uri, dest) - - -def main(): - # common options - - usage = "usage: %prog [options] package-name.pspec" - import pisi.cli.commonargs - parser = OptionParser(usage=usage,version="%prog " + pisi.__version__) - parser = pisi.cli.commonargs.add(parser) - - (options, args) = parser.parse_args() - - # pspec(PISI Spec) to be used for package - for pspecfile in args: - # What we need to do first is create a context with our specfile - url = PUrl(pspecfile) - if url.isRemoteFile(): - rs = RemoteSource(url) - ctx = rs.ctx - else: - ctx = BuildContext(url.uri) - # don't do the real job here. this is just a CLI! - pb = PisiBuild(ctx) - pb.build() - -if __name__ == "__main__": - main()