* get artık curKERNEL() isimli bir fonksiyona sahip, işlevi az sonra,
* Exception'lar Barış'ın önerdiği biçime getirildi,
* Kozmetik değişiklikler...
This commit is contained in:
@@ -28,7 +28,7 @@ from pisi.actionsapi.shelltools import can_access_file
|
||||
from pisi.actionsapi.libtools import gnuconfig_update
|
||||
|
||||
class ConfigureError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
@@ -36,19 +36,19 @@ class ConfigureError(pisi.actionsapi.Error):
|
||||
ctx.ui.error(_('Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd())
|
||||
|
||||
class MakeError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
class InstallError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
class RunTimeError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
@@ -11,9 +11,13 @@
|
||||
# Please read the COPYING file.
|
||||
|
||||
# Standard Python Modules
|
||||
import sys
|
||||
import re
|
||||
from itertools import izip, imap, count, ifilter, ifilterfalse
|
||||
import sys
|
||||
from itertools import izip
|
||||
from itertools import imap
|
||||
from itertools import count
|
||||
from itertools import ifilter
|
||||
from itertools import ifilterfalse
|
||||
|
||||
# ActionsAPI
|
||||
import pisi.actionsapi
|
||||
|
||||
+30
-4
@@ -25,28 +25,44 @@ import pisi.context as ctx
|
||||
from variables import glb
|
||||
|
||||
class BinutilsError(pisi.actionsapi.Error):
|
||||
pass
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
# Globals
|
||||
env = glb.env
|
||||
dirs = glb.dirs
|
||||
|
||||
def curDIR():
|
||||
'''returns current work directory's path'''
|
||||
return os.getcwd()
|
||||
|
||||
def curKERNEL():
|
||||
'''returns currently running kernel's version'''
|
||||
versionString = file("/proc/version").readline()
|
||||
return versionString.split()[2]
|
||||
|
||||
def ENV(environ):
|
||||
'''returns any given environ variable'''
|
||||
return os.environ[environ];
|
||||
|
||||
# variables.Env
|
||||
# PİSİ Related Functions
|
||||
|
||||
def pkgDIR():
|
||||
'''returns the path of binary packages'''
|
||||
'''Default: /var/cache/pisi/packages'''
|
||||
return env.pkg_dir
|
||||
|
||||
def workDIR():
|
||||
return env.work_dir
|
||||
|
||||
def installDIR():
|
||||
'''returns the path of binary packages'''
|
||||
return env.install_dir
|
||||
|
||||
# PSPEC Related Functions
|
||||
|
||||
def srcNAME():
|
||||
return env.src_name
|
||||
|
||||
@@ -61,10 +77,17 @@ def srcTAG():
|
||||
|
||||
def srcDIR():
|
||||
return env.src_name + '-' + env.src_version
|
||||
|
||||
# Build Related Functions
|
||||
|
||||
def HOST():
|
||||
return env.host
|
||||
|
||||
def CHOST():
|
||||
# FIXME: Currently it behave same as HOST,
|
||||
# but will be used for cross-compiling when PİSİ ready...
|
||||
return env.host
|
||||
|
||||
def CFLAGS():
|
||||
return env.cflags
|
||||
|
||||
@@ -74,7 +97,7 @@ def CXXFLAGS():
|
||||
def LDFLAGS():
|
||||
return env.ldflags
|
||||
|
||||
# variables.Dirs
|
||||
# Directory Related Functions
|
||||
|
||||
def docDIR():
|
||||
return dirs.doc
|
||||
@@ -101,12 +124,15 @@ def defaultprefixDIR():
|
||||
return dirs.defaultprefix
|
||||
|
||||
def kdeDIR():
|
||||
# FIXME: Get followings from env.d or somewhere else
|
||||
return dirs.kde
|
||||
|
||||
def qtDIR():
|
||||
# FIXME: Get followings from env.d or somewhere else
|
||||
return dirs.qt
|
||||
|
||||
def qtLIBDIR():
|
||||
# FIXME: Get followings from env.d or somewhere else
|
||||
return '%s/lib/' % qtDIR()
|
||||
|
||||
# Binutils Variables
|
||||
@@ -115,7 +141,7 @@ def existBinary(bin):
|
||||
# determine if path has binary
|
||||
path = os.environ['PATH'].split(':')
|
||||
for directory in path:
|
||||
if os.path.exists(os.path.join(directory, bin) ):
|
||||
if os.path.exists(os.path.join(directory, bin)):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
+14
-7
@@ -23,21 +23,28 @@ import pisi.context as ctx
|
||||
# ActionsAPI Modules
|
||||
import pisi.actionsapi
|
||||
import pisi.actionsapi.get as get
|
||||
from pisi.actionsapi.shelltools import system, can_access_file
|
||||
from pisi.actionsapi.shelltools import system
|
||||
from pisi.actionsapi.shelltools import can_access_file
|
||||
|
||||
class ConfigureError(pisi.actionsapi.Error):
|
||||
def __init__(self, Exception):
|
||||
ctx.ui.error(Exception)
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
if can_access_file('config.log'):
|
||||
ctx.ui.error(_('\n!!! Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd())
|
||||
|
||||
class MakeError(pisi.actionsapi.Error):
|
||||
def __init__(self, Exception):
|
||||
ctx.ui.error(Exception)
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
class InstallError(pisi.actionsapi.Error):
|
||||
def __init__(self, Exception):
|
||||
ctx.ui.error(Exception)
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
def configure(parameters = ''):
|
||||
''' parameters = '--with-nls --with-libusb --with-something-usefull '''
|
||||
|
||||
@@ -26,7 +26,7 @@ from pisi.actionsapi.shelltools import *
|
||||
import pisi.actionsapi.get as get
|
||||
|
||||
class RunTimeError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
@@ -37,9 +37,6 @@ def preplib(sourceDirectory = '/usr/lib'):
|
||||
if system('/sbin/ldconfig -n -N %s' % sourceDirectory):
|
||||
raise RunTimeError(_('!!! Running ldconfig failed...'))
|
||||
|
||||
def preplib_so(sourceDirectory):
|
||||
pass
|
||||
|
||||
def gnuconfig_update():
|
||||
''' copy newest config.* onto source\'s '''
|
||||
for root, dirs, files in os.walk(os.getcwd()):
|
||||
|
||||
@@ -23,7 +23,9 @@ import pisi.context as ctx
|
||||
# ActionsAPI Modules
|
||||
import pisi.actionsapi
|
||||
import pisi.actionsapi.get as get
|
||||
from pisi.actionsapi.shelltools import system, can_access_file, export
|
||||
from pisi.actionsapi.shelltools import system
|
||||
from pisi.actionsapi.shelltools import can_access_file
|
||||
from pisi.actionsapi.shelltools import export
|
||||
|
||||
class ConfigureError(pisi.actionsapi.Error):
|
||||
def __init__(self, value=''):
|
||||
|
||||
@@ -28,13 +28,13 @@ import pisi.actionsapi
|
||||
from pisi.actionsapi.shelltools import *
|
||||
|
||||
class FileError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
class ArgumentError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
@@ -23,15 +23,14 @@ import pisi.actionsapi
|
||||
import pisi.actionsapi.get as get
|
||||
from pisi.actionsapi.shelltools import system
|
||||
|
||||
|
||||
class MakeError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
class InstallError(pisi.actionsapi.Error):
|
||||
def __init__(self, value):
|
||||
def __init__(self, value=''):
|
||||
pisi.actionsapi.Error.__init__(self, value)
|
||||
self.value = value
|
||||
ctx.ui.error(value)
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
# Please read the COPYING file.
|
||||
|
||||
# Standard Python Modules
|
||||
from os import getenv, environ
|
||||
from os import getenv
|
||||
from os import environ
|
||||
|
||||
# Pisi-Core Modules
|
||||
import pisi.context as ctx
|
||||
|
||||
Reference in New Issue
Block a user