* 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 -*-
import os
from pisi.context import Constants
const = Constants.c
from pisi.context import const
def configure(parameters = None):
''' FIXME: Düzgün hale getirilecek '''
+13 -12
View File
@@ -9,6 +9,7 @@ import sys
# import pisipackage
import util
from ui import ui
from constants import const
from config import config
from sourcearchive import SourceArchive
from files import Files, FileInfo
@@ -45,7 +46,7 @@ class PisiBuild:
try:
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:
ui.error ("Action Script: %s\n" % e)
return
@@ -94,19 +95,19 @@ class PisiBuild:
sys.exit()
def configureSource(self, locals):
func = self.ctx.const.setup_func
func = const.setup_func
if func in locals:
ui.info("Configuring %s...\n" % self.spec.source.name)
locals[func]()
def buildSource(self, locals):
func = self.ctx.const.build_func
func = const.build_func
if func in locals:
ui.info("Building %s...\n" % self.spec.source.name)
locals[func]()
def installSource(self, locals):
func = self.ctx.const.install_func
func = const.install_func
if func in locals:
ui.info("Installing %s...\n" % self.spec.source.name)
locals[func]()
@@ -153,9 +154,9 @@ class PisiBuild:
metadata.appendElement(createElt("License",
self.spec.source.license))
metadata.appendElement(createElt("Distribution",
self.ctx.const.distribution))
const.distribution))
metadata.appendElement(createElt("DistributionRelease",
self.ctx.const.distributionRelease))
const.distributionRelease))
metadata.appendElement(createElt("Architecture",
"Any")) # FIXME
# FIXME: Bu hatalı. installsize'ı almak için tüm
@@ -176,7 +177,7 @@ class PisiBuild:
elt.appendChild(update)
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):
"""Generetes files.xml using the path definitions in specfile and
@@ -201,17 +202,17 @@ class PisiBuild:
ftype = path.fileType
fsize = str(os.path.getsize(fpath))
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):
for package in self.spec.packages:
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)
ui.info(" done.\n")
ui.info("Generating %s..." % self.ctx.const.files_xml)
ui.info("Generating %s..." % const.files_xml)
self.genFilesXml(package)
ui.info(" done.\n")
@@ -223,8 +224,8 @@ class PisiBuild:
c = os.getcwd()
os.chdir(self.ctx.pkg_dir())
pkg.add_file(self.ctx.const.metadata_xml)
pkg.add_file(self.ctx.const.files_xml)
pkg.add_file(const.metadata_xml)
pkg.add_file(const.files_xml)
pkg.add_file("install")
pkg.close()
os.chdir(c)
+3 -2
View File
@@ -3,7 +3,7 @@
# maintainer: baris and meren
import archive
from constants import constants
from constants import const
from config import config
class Package:
@@ -41,5 +41,6 @@ class Package:
def extract_PISI_files(self, outdir):
"""extract PISI control files: metadata.xml, files.xml,
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):
"""fetch an archive and store to ctx.archives_dir()
using fetcher.Fetcher"""
fetch = Fetcher(self.ctx.source)
fetch = Fetcher(self.ctx.spec.source)
# check if source already cached
destpath = fetch.filedest + "/" + fetch.filename