Kaydet (Commit) 9ae65788 authored tarafından Suleyman Poyraz's avatar Suleyman Poyraz

actionsapi-runtime-fixes.patch

üst 951eec3f
2018-01-17 Suleyman Poyraz <zaryob.dev@gmail.com>
* fetcher pycurl kullanılarak yeniden yazıldı. Bu sayede base sistemde
dependency yükü azaldı, partial file download özelliği getirildi.
* actionsapi modulleri elden geçirildi kararlılık sağlandı
2018-12-07 Suleyman Poyraz <zaryob.dev@gmail.com>
* inary.operations.operations isimli modül hem saçma hem gereksizdi. Silindi.
......
......@@ -27,15 +27,11 @@ import inary.actionsapi.get as get
from inary.actionsapi.shelltools import system
from inary.actionsapi.shelltools import can_access_file
from inary.actionsapi.shelltools import unlink
from inary.actionsapi.shelltools import export
from inary.actionsapi.libtools import gnuconfig_update
from inary.actionsapi.shelltools import isDirectory
from inary.actionsapi.shelltools import ls
from inary.actionsapi.inarytools import dosed
from inary.actionsapi.inarytools import removeDir
from inary.actionsapi.shelltools import isDirectory
from inary.actionsapi.shelltools import ls
from inary.actionsapi.inarytools import removeDir
class ConfigureError(inary.actionsapi.Error):
def __init__(self, value=''):
......@@ -51,6 +47,12 @@ class MakeError(inary.actionsapi.Error):
self.value = value
ctx.ui.error(value)
class CompileError(inary.actionsapi.Error):
def __init__(self, value=''):
inary.actionsapi.Error.__init__(self, value)
self.value = value
ctx.ui.error(value)
class InstallError(inary.actionsapi.Error):
def __init__(self, value=''):
inary.actionsapi.Error.__init__(self, value)
......@@ -104,7 +106,8 @@ def rawConfigure(parameters = ''):
raise ConfigureError(_('No configure script found.'))
def compile(parameters = ''):
system('{0} {1} {2}'.format(get.CC(), get.CFLAGS(), parameters))
if system('{0} {1} {2}'.format(get.CC(), get.CFLAGS(), parameters)):
raise CompileError(_('Compiling failed.'))
def make(parameters = ''):
"""make source with given parameters = "all" || "doc" etc."""
......
......@@ -56,7 +56,7 @@ class RunTimeError(inary.actionsapi.Error):
ctx.ui.error(value)
def configure(parameters = '', installPrefix = '/{}'.format(get.defaultprefixDIR()), sourceDir = '.'):
"""configure source with given cmake parameters = "-DCMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS ... \""""
"""configure source with given cmake parameters = "-DCMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS ... " """
if can_access_file(join_path(sourceDir, 'CMakeLists.txt')):
args = 'cmake -DCMAKE_INSTALL_PREFIX={0} \
-DCMAKE_C_FLAGS="{1}" \
......
......@@ -24,7 +24,7 @@ from itertools import filterfalse
import inary.actionsapi
def cat(filename):
return file(filename)
return open(filename)
class grep:
"""keep only lines that match the regexp"""
......
......@@ -36,6 +36,7 @@ class BinutilsError(inary.actionsapi.Error):
# Globals
env = inary.actionsapi.variables.glb.env
dirs = inary.actionsapi.variables.glb.dirs
config = inary.actionsapi.variables.glb.config
generals = inary.actionsapi.variables.glb.generals
def curDIR():
......@@ -53,6 +54,10 @@ def curPYTHON():
def curPERL():
""" returns currently used perl's version"""
#for i in os.listdir("/usr/bin"):
# if i.startswith("perl"):
# if i.split("perl")[1]
return os.path.realpath('/usr/bin/perl').split('perl')[1]
def ENV(environ):
......@@ -76,13 +81,16 @@ def installDIR():
"""returns the path of binary packages"""
return env.install_dir
# Pardus Related Functions
# Sulin Related Functions
def lsbINFO():
"""Returns a dictionary filled through /etc/lsb-release."""
return dict([(l.split("=")[0], l.split("=")[1].strip("'\"")) \
for l in open("/etc/lsb-release", "r").read().strip().split("\n") if "=" in l])
def kernelVERSION():
return env.src_version
# PSPEC Related Functions
def srcNAME():
......
......@@ -27,7 +27,7 @@ import inary.context as ctx
import inary.actionsapi
import inary.actionsapi.get as get
import inary.actionsapi.autotools as autotools
import inary.actionsapi.inarytools as inarytools
import inary.actionsapi.inarytools as inarytools
import inary.actionsapi.shelltools as shelltools
......@@ -84,7 +84,7 @@ def __getExtraVersion():
# if successful, this is something like:
# .1 for 2.6.30.1
# _rc8 for 2.6.30_rc8
extraversion = re.split("3.[0-9].[0-9]{2}([._].*)", get.srcVERSION())[1]
extraversion = re.split("4.[0-9].[0-9]{2}([._].*)", get.srcVERSION())[1]
except IndexError:
# e.g. if version == 2.6.30
pass
......
......@@ -66,7 +66,7 @@ def gen_usr_ldscript(dynamicLib):
destinationFile = open('{0}/usr/lib/{1}'.format(get.installDIR(), dynamicLib), 'w')
content = '''
/* GNU ld script
Since Pardus has critical dynamic libraries
Since Sulin has critical dynamic libraries
in /lib, and the static versions in /usr/lib,
we need to have a "fake" dynamic lib in /usr/lib,
otherwise we run into linking problems.
......
......@@ -53,10 +53,10 @@ def configure(parameters = ''):
"""configure source with given parameters."""
export('PERL_MM_USE_DEFAULT', '1')
if can_access_file('Build.PL'):
if system('perl Build.PL installdirs=vendor destdir={}'.format(get.installDIR())):
if system('perl{0} Build.PL installdirs=vendor destdir={1}'.format(get.curPERL(), get.installDIR())):
raise ConfigureError(_('Configure failed.'))
else:
if system('perl Makefile.PL {0} PREFIX=/usr INSTALLDIRS=vendor DESTDIR={1}'.format(parameters, get.installDIR())):
if system('perl{0} Makefile.PL {1} PREFIX=/usr INSTALLDIRS=vendor DESTDIR={2}'.format(get.curPERL(), parameters, get.installDIR())):
raise ConfigureError(_('Configure failed.'))
def make(parameters = ''):
......@@ -65,7 +65,7 @@ def make(parameters = ''):
if system('make {}'.format(parameters)):
raise MakeError(_('Make failed.'))
else:
if system('perl Build {}'.format(parameters)):
if system('perl{0} Build {1}'.format(get.curPERL(), parameters)):
raise MakeError(_('perl build failed.'))
def install(parameters = 'install'):
......@@ -74,7 +74,7 @@ def install(parameters = 'install'):
if system('make {}'.format(parameters)):
raise InstallError(_('Make failed.'))
else:
if system('perl Build install'):
if system('perl{} Build install'.get.curPERL()):
raise MakeError(_('perl install failed.'))
removePacklist()
......
......@@ -39,7 +39,7 @@ def getVariableForLibrary(library, variable):
return_code = proc.wait()
except OSError as exception:
if exception.errno == 2:
raise PkgconfigError(_("pkg-config is not installed on your system."))
raise PkgconfigError(_("Package pkgconfig is not installed on your system."))
else:
if return_code == 0 and proc.stdout:
return proc.stdout.read().strip()
......@@ -58,7 +58,7 @@ def getLibraryVersion(library):
return_code = proc.wait()
except OSError as exception:
if exception.errno == 2:
raise PkgconfigError(_("pkg-config is not installed on your system."))
raise PkgconfigError(_("Package pkgconfig is not installed on your system."))
else:
if return_code == 0 and proc.stdout:
return proc.stdout.read().strip()
......@@ -78,7 +78,7 @@ def getLibraryCFLAGS(library):
return_code = proc.wait()
except OSError as exception:
if exception.errno == 2:
raise PkgconfigError(_("pkg-config is not installed on your system."))
raise PkgconfigError(_("Package pkgconfig is not installed on your system."))
else:
if return_code == 0 and proc.stdout:
return proc.stdout.read().strip()
......@@ -98,7 +98,7 @@ def getLibraryLIBADD(library):
return_code = proc.wait()
except OSError as exception:
if exception.errno == 2:
raise PkgconfigError(_("pkg-config is not installed on your system."))
raise PkgconfigError(_("Package pkgconfig is not installed on your system."))
else:
if return_code == 0 and proc.stdout:
return proc.stdout.read().strip()
......@@ -117,7 +117,7 @@ def runManualCommand(*args):
return_code = proc.wait()
except OSError as exception:
if exception.errno == 2:
raise PkgconfigError(_("pkg-config is not installed on your system."))
raise PkgconfigError(_("Package pkgconfig is not installed on your system."))
else:
if return_code == 0 and proc.stdout:
return proc.stdout.read().strip()
......
......@@ -104,7 +104,8 @@ def unlink(pattern):
except OSError:
ctx.ui.error(_('ActionsAPI [unlink]: Permission denied: {}.').format(filePath))
elif isDirectory(filePath):
pass
ctx.ui.warning(_('ActionsAPI [unlink]: %s is not a file, use \'unlinkDir\' or \'removeDir\' to remove directories.') % filePath)
else:
ctx.ui.error(_('ActionsAPI [unlink]: File {} doesn\'t exists.').format(filePath))
......@@ -137,7 +138,7 @@ def move(source, destination):
# FIXME: instead of passing a sym parameter, split copy and copytree into 4 different function
def copy(source, destination, sym = True):
"""recursively copy a "source" file or directory to "destination\""""
"""recursively copy a "source" file or directory to "destination\" """
sourceGlob = glob.glob(source)
if len(sourceGlob) == 0:
error(_("ActionsAPI [copy]: No file matched pattern \"{}\".").format(source))
......
......@@ -41,6 +41,7 @@ def exportFlags():
# http://liste.pardus.org.tr/gelistirici/2009-January/016442.html
os.environ['CC'] = "{}-gcc".format(values.build.host)
os.environ['CXX'] = "{}-g++".format(values.build.host)
os.environ['LD'] = "{}-ld".format(values.build.host)
class Env(object):
"""General environment variables used in actions API"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment