* 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
|
from pisi.actionsapi.libtools import gnuconfig_update
|
||||||
|
|
||||||
class ConfigureError(pisi.actionsapi.Error):
|
class ConfigureError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(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())
|
ctx.ui.error(_('Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd())
|
||||||
|
|
||||||
class MakeError(pisi.actionsapi.Error):
|
class MakeError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|
||||||
class InstallError(pisi.actionsapi.Error):
|
class InstallError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|
||||||
class RunTimeError(pisi.actionsapi.Error):
|
class RunTimeError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|||||||
@@ -11,9 +11,13 @@
|
|||||||
# Please read the COPYING file.
|
# Please read the COPYING file.
|
||||||
|
|
||||||
# Standard Python Modules
|
# Standard Python Modules
|
||||||
import sys
|
|
||||||
import re
|
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
|
# ActionsAPI
|
||||||
import pisi.actionsapi
|
import pisi.actionsapi
|
||||||
|
|||||||
+30
-4
@@ -25,28 +25,44 @@ import pisi.context as ctx
|
|||||||
from variables import glb
|
from variables import glb
|
||||||
|
|
||||||
class BinutilsError(pisi.actionsapi.Error):
|
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
|
env = glb.env
|
||||||
dirs = glb.dirs
|
dirs = glb.dirs
|
||||||
|
|
||||||
def curDIR():
|
def curDIR():
|
||||||
|
'''returns current work directory's path'''
|
||||||
return os.getcwd()
|
return os.getcwd()
|
||||||
|
|
||||||
|
def curKERNEL():
|
||||||
|
'''returns currently running kernel's version'''
|
||||||
|
versionString = file("/proc/version").readline()
|
||||||
|
return versionString.split()[2]
|
||||||
|
|
||||||
def ENV(environ):
|
def ENV(environ):
|
||||||
|
'''returns any given environ variable'''
|
||||||
return os.environ[environ];
|
return os.environ[environ];
|
||||||
|
|
||||||
# variables.Env
|
# PİSİ Related Functions
|
||||||
|
|
||||||
def pkgDIR():
|
def pkgDIR():
|
||||||
|
'''returns the path of binary packages'''
|
||||||
|
'''Default: /var/cache/pisi/packages'''
|
||||||
return env.pkg_dir
|
return env.pkg_dir
|
||||||
|
|
||||||
def workDIR():
|
def workDIR():
|
||||||
return env.work_dir
|
return env.work_dir
|
||||||
|
|
||||||
def installDIR():
|
def installDIR():
|
||||||
|
'''returns the path of binary packages'''
|
||||||
return env.install_dir
|
return env.install_dir
|
||||||
|
|
||||||
|
# PSPEC Related Functions
|
||||||
|
|
||||||
def srcNAME():
|
def srcNAME():
|
||||||
return env.src_name
|
return env.src_name
|
||||||
|
|
||||||
@@ -61,10 +77,17 @@ def srcTAG():
|
|||||||
|
|
||||||
def srcDIR():
|
def srcDIR():
|
||||||
return env.src_name + '-' + env.src_version
|
return env.src_name + '-' + env.src_version
|
||||||
|
|
||||||
|
# Build Related Functions
|
||||||
|
|
||||||
def HOST():
|
def HOST():
|
||||||
return env.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():
|
def CFLAGS():
|
||||||
return env.cflags
|
return env.cflags
|
||||||
|
|
||||||
@@ -74,7 +97,7 @@ def CXXFLAGS():
|
|||||||
def LDFLAGS():
|
def LDFLAGS():
|
||||||
return env.ldflags
|
return env.ldflags
|
||||||
|
|
||||||
# variables.Dirs
|
# Directory Related Functions
|
||||||
|
|
||||||
def docDIR():
|
def docDIR():
|
||||||
return dirs.doc
|
return dirs.doc
|
||||||
@@ -101,12 +124,15 @@ def defaultprefixDIR():
|
|||||||
return dirs.defaultprefix
|
return dirs.defaultprefix
|
||||||
|
|
||||||
def kdeDIR():
|
def kdeDIR():
|
||||||
|
# FIXME: Get followings from env.d or somewhere else
|
||||||
return dirs.kde
|
return dirs.kde
|
||||||
|
|
||||||
def qtDIR():
|
def qtDIR():
|
||||||
|
# FIXME: Get followings from env.d or somewhere else
|
||||||
return dirs.qt
|
return dirs.qt
|
||||||
|
|
||||||
def qtLIBDIR():
|
def qtLIBDIR():
|
||||||
|
# FIXME: Get followings from env.d or somewhere else
|
||||||
return '%s/lib/' % qtDIR()
|
return '%s/lib/' % qtDIR()
|
||||||
|
|
||||||
# Binutils Variables
|
# Binutils Variables
|
||||||
@@ -115,7 +141,7 @@ def existBinary(bin):
|
|||||||
# determine if path has binary
|
# determine if path has binary
|
||||||
path = os.environ['PATH'].split(':')
|
path = os.environ['PATH'].split(':')
|
||||||
for directory in path:
|
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 True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
+14
-7
@@ -23,21 +23,28 @@ import pisi.context as ctx
|
|||||||
# ActionsAPI Modules
|
# ActionsAPI Modules
|
||||||
import pisi.actionsapi
|
import pisi.actionsapi
|
||||||
import pisi.actionsapi.get as get
|
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):
|
class ConfigureError(pisi.actionsapi.Error):
|
||||||
def __init__(self, Exception):
|
def __init__(self, value=''):
|
||||||
ctx.ui.error(Exception)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
|
self.value = value
|
||||||
|
ctx.ui.error(value)
|
||||||
if can_access_file('config.log'):
|
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())
|
ctx.ui.error(_('\n!!! Please attach the config.log to your bug report:\n%s/config.log') % os.getcwd())
|
||||||
|
|
||||||
class MakeError(pisi.actionsapi.Error):
|
class MakeError(pisi.actionsapi.Error):
|
||||||
def __init__(self, Exception):
|
def __init__(self, value=''):
|
||||||
ctx.ui.error(Exception)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
|
self.value = value
|
||||||
|
ctx.ui.error(value)
|
||||||
|
|
||||||
class InstallError(pisi.actionsapi.Error):
|
class InstallError(pisi.actionsapi.Error):
|
||||||
def __init__(self, Exception):
|
def __init__(self, value=''):
|
||||||
ctx.ui.error(Exception)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
|
self.value = value
|
||||||
|
ctx.ui.error(value)
|
||||||
|
|
||||||
def configure(parameters = ''):
|
def configure(parameters = ''):
|
||||||
''' parameters = '--with-nls --with-libusb --with-something-usefull '''
|
''' parameters = '--with-nls --with-libusb --with-something-usefull '''
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from pisi.actionsapi.shelltools import *
|
|||||||
import pisi.actionsapi.get as get
|
import pisi.actionsapi.get as get
|
||||||
|
|
||||||
class RunTimeError(pisi.actionsapi.Error):
|
class RunTimeError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
@@ -37,9 +37,6 @@ def preplib(sourceDirectory = '/usr/lib'):
|
|||||||
if system('/sbin/ldconfig -n -N %s' % sourceDirectory):
|
if system('/sbin/ldconfig -n -N %s' % sourceDirectory):
|
||||||
raise RunTimeError(_('!!! Running ldconfig failed...'))
|
raise RunTimeError(_('!!! Running ldconfig failed...'))
|
||||||
|
|
||||||
def preplib_so(sourceDirectory):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def gnuconfig_update():
|
def gnuconfig_update():
|
||||||
''' copy newest config.* onto source\'s '''
|
''' copy newest config.* onto source\'s '''
|
||||||
for root, dirs, files in os.walk(os.getcwd()):
|
for root, dirs, files in os.walk(os.getcwd()):
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ import pisi.context as ctx
|
|||||||
# ActionsAPI Modules
|
# ActionsAPI Modules
|
||||||
import pisi.actionsapi
|
import pisi.actionsapi
|
||||||
import pisi.actionsapi.get as get
|
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):
|
class ConfigureError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value=''):
|
def __init__(self, value=''):
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ import pisi.actionsapi
|
|||||||
from pisi.actionsapi.shelltools import *
|
from pisi.actionsapi.shelltools import *
|
||||||
|
|
||||||
class FileError(pisi.actionsapi.Error):
|
class FileError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|
||||||
class ArgumentError(pisi.actionsapi.Error):
|
class ArgumentError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|||||||
@@ -23,15 +23,14 @@ import pisi.actionsapi
|
|||||||
import pisi.actionsapi.get as get
|
import pisi.actionsapi.get as get
|
||||||
from pisi.actionsapi.shelltools import system
|
from pisi.actionsapi.shelltools import system
|
||||||
|
|
||||||
|
|
||||||
class MakeError(pisi.actionsapi.Error):
|
class MakeError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|
||||||
class InstallError(pisi.actionsapi.Error):
|
class InstallError(pisi.actionsapi.Error):
|
||||||
def __init__(self, value):
|
def __init__(self, value=''):
|
||||||
pisi.actionsapi.Error.__init__(self, value)
|
pisi.actionsapi.Error.__init__(self, value)
|
||||||
self.value = value
|
self.value = value
|
||||||
ctx.ui.error(value)
|
ctx.ui.error(value)
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
# Please read the COPYING file.
|
# Please read the COPYING file.
|
||||||
|
|
||||||
# Standard Python Modules
|
# Standard Python Modules
|
||||||
from os import getenv, environ
|
from os import getenv
|
||||||
|
from os import environ
|
||||||
|
|
||||||
# Pisi-Core Modules
|
# Pisi-Core Modules
|
||||||
import pisi.context as ctx
|
import pisi.context as ctx
|
||||||
|
|||||||
Reference in New Issue
Block a user