* turlu karin agrilarini duzelt

This commit is contained in:
Eray Özkural
2005-06-23 13:36:40 +00:00
parent 05e1b2a6f9
commit 9768625985
4 changed files with 18 additions and 17 deletions
+1 -2
View File
@@ -2,8 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
from pisi.context import Constants from pisi.context import const
const = Constants.c
def configure(parameters = None): def configure(parameters = None):
''' FIXME: Düzgün hale getirilecek ''' ''' FIXME: Düzgün hale getirilecek '''
+13 -12
View File
@@ -9,6 +9,7 @@ import sys
# import pisipackage # import pisipackage
import util import util
from ui import ui from ui import ui
from constants import const
from config import config from config import config
from sourcearchive import SourceArchive from sourcearchive import SourceArchive
from files import Files, FileInfo from files import Files, FileInfo
@@ -45,7 +46,7 @@ class PisiBuild:
try: try:
specdir = os.path.dirname(self.ctx.pspecfile) specdir = os.path.dirname(self.ctx.pspecfile)
self.actionScript = open("/".join([specdir,self.ctx.const.actions_file])).read() self.actionScript = open("/".join([specdir,const.actions_file])).read()
except IOError, e: except IOError, e:
ui.error ("Action Script: %s\n" % e) ui.error ("Action Script: %s\n" % e)
return return
@@ -94,19 +95,19 @@ class PisiBuild:
sys.exit() sys.exit()
def configureSource(self, locals): def configureSource(self, locals):
func = self.ctx.const.setup_func func = const.setup_func
if func in locals: if func in locals:
ui.info("Configuring %s...\n" % self.spec.source.name) ui.info("Configuring %s...\n" % self.spec.source.name)
locals[func]() locals[func]()
def buildSource(self, locals): def buildSource(self, locals):
func = self.ctx.const.build_func func = const.build_func
if func in locals: if func in locals:
ui.info("Building %s...\n" % self.spec.source.name) ui.info("Building %s...\n" % self.spec.source.name)
locals[func]() locals[func]()
def installSource(self, locals): def installSource(self, locals):
func = self.ctx.const.install_func func = const.install_func
if func in locals: if func in locals:
ui.info("Installing %s...\n" % self.spec.source.name) ui.info("Installing %s...\n" % self.spec.source.name)
locals[func]() locals[func]()
@@ -153,9 +154,9 @@ class PisiBuild:
metadata.appendElement(createElt("License", metadata.appendElement(createElt("License",
self.spec.source.license)) self.spec.source.license))
metadata.appendElement(createElt("Distribution", metadata.appendElement(createElt("Distribution",
self.ctx.const.distribution)) const.distribution))
metadata.appendElement(createElt("DistributionRelease", metadata.appendElement(createElt("DistributionRelease",
self.ctx.const.distributionRelease)) const.distributionRelease))
metadata.appendElement(createElt("Architecture", metadata.appendElement(createElt("Architecture",
"Any")) # FIXME "Any")) # FIXME
# FIXME: Bu hatalı. installsize'ı almak için tüm # FIXME: Bu hatalı. installsize'ı almak için tüm
@@ -176,7 +177,7 @@ class PisiBuild:
elt.appendChild(update) elt.appendChild(update)
metadata.appendElement(elt) metadata.appendElement(elt)
metadata.write(os.path.join(self.ctx.pkg_dir(), self.ctx.const.metadata_xml)) metadata.write(os.path.join(self.ctx.pkg_dir(), const.metadata_xml))
def genFilesXml(self, package): def genFilesXml(self, package):
"""Generetes files.xml using the path definitions in specfile and """Generetes files.xml using the path definitions in specfile and
@@ -201,17 +202,17 @@ class PisiBuild:
ftype = path.fileType ftype = path.fileType
fsize = str(os.path.getsize(fpath)) fsize = str(os.path.getsize(fpath))
files.append(FileInfo(frpath, ftype, fsize, fhash)) files.append(FileInfo(frpath, ftype, fsize, fhash))
files.write(os.path.join(self.ctx.pkg_dir(), self.ctx.const.files_xml)) files.write(os.path.join(self.ctx.pkg_dir(), const.files_xml))
def buildPackages(self): def buildPackages(self):
for package in self.spec.packages: for package in self.spec.packages:
ui.info("** Building package %s\n" % package.name); ui.info("** Building package %s\n" % package.name);
ui.info("Generating %s..." % self.ctx.const.metadata_xml) ui.info("Generating %s..." % const.metadata_xml)
self.genMetaDataXml(package) self.genMetaDataXml(package)
ui.info(" done.\n") ui.info(" done.\n")
ui.info("Generating %s..." % self.ctx.const.files_xml) ui.info("Generating %s..." % const.files_xml)
self.genFilesXml(package) self.genFilesXml(package)
ui.info(" done.\n") ui.info(" done.\n")
@@ -223,8 +224,8 @@ class PisiBuild:
c = os.getcwd() c = os.getcwd()
os.chdir(self.ctx.pkg_dir()) os.chdir(self.ctx.pkg_dir())
pkg.add_file(self.ctx.const.metadata_xml) pkg.add_file(const.metadata_xml)
pkg.add_file(self.ctx.const.files_xml) pkg.add_file(const.files_xml)
pkg.add_file("install") pkg.add_file("install")
pkg.close() pkg.close()
os.chdir(c) os.chdir(c)
+3 -2
View File
@@ -3,7 +3,7 @@
# maintainer: baris and meren # maintainer: baris and meren
import archive import archive
from constants import constants from constants import const
from config import config from config import config
class Package: class Package:
@@ -41,5 +41,6 @@ class Package:
def extract_PISI_files(self, outdir): def extract_PISI_files(self, outdir):
"""extract PISI control files: metadata.xml, files.xml, """extract PISI control files: metadata.xml, files.xml,
action scripts, etc.""" action scripts, etc."""
self.extract_files([constants.metadata_xml, constants.files_xml,'Config'], outdir) self.extract_files([const.metadata_xml,
const.files_xml,'Config'], outdir)
+1 -1
View File
@@ -33,7 +33,7 @@ class SourceArchive:
def fetch(self, percentHook=displayProgress): def fetch(self, percentHook=displayProgress):
"""fetch an archive and store to ctx.archives_dir() """fetch an archive and store to ctx.archives_dir()
using fetcher.Fetcher""" using fetcher.Fetcher"""
fetch = Fetcher(self.ctx.source) fetch = Fetcher(self.ctx.spec.source)
# check if source already cached # check if source already cached
destpath = fetch.filedest + "/" + fetch.filename destpath = fetch.filedest + "/" + fetch.filename