refactor continues...
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
ReFactor ActionsAPI:
|
ReFactor ActionsAPI:
|
||||||
|
|
||||||
pisitools.py - %80
|
pisitools.py - %80
|
||||||
autotools.py - %50
|
autotools.py - %100
|
||||||
get.py - %75
|
get.py - %75
|
||||||
kde.py - %0
|
kde.py - %0
|
||||||
libtools.py - %25
|
libtools.py - %75
|
||||||
pisitools_functions.py - %50
|
pisitoolsfunctions.py - %75
|
||||||
shelltools.py - %50
|
shelltools.py - %50
|
||||||
variables.py - %100
|
variables.py - %100
|
||||||
coreutils.py - %100
|
coreutils.py - %100
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ class InstallError(pisi.actionsapi.Error):
|
|||||||
def __init__(self, Exception):
|
def __init__(self, Exception):
|
||||||
ui.error(Exception)
|
ui.error(Exception)
|
||||||
|
|
||||||
|
class RunTimeError(pisi.actionsapi.Error):
|
||||||
|
def __init__(self, Exception):
|
||||||
|
ui.error(Exception)
|
||||||
|
|
||||||
def configure(parameters = ''):
|
def configure(parameters = ''):
|
||||||
'''configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"'''
|
'''configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"'''
|
||||||
if can_access_file('configure'):
|
if can_access_file('configure'):
|
||||||
@@ -118,12 +122,15 @@ def rawInstall(parameters = ''):
|
|||||||
|
|
||||||
def aclocal(parameters = ''):
|
def aclocal(parameters = ''):
|
||||||
'''generates an aclocal.m4 based on the contents of configure.in.'''
|
'''generates an aclocal.m4 based on the contents of configure.in.'''
|
||||||
system('aclocal %s' % parameters)
|
if system('aclocal %s' % parameters):
|
||||||
|
raise RunTimeError("!!!! Running aclocal failed...")
|
||||||
|
|
||||||
def autoconf(parameters = ''):
|
def autoconf(parameters = ''):
|
||||||
'''generates a configure script'''
|
'''generates a configure script'''
|
||||||
system('autoconf %s' % parameters)
|
if system('autoconf %s' % parameters):
|
||||||
|
raise RunTimeError("!!!! Running autoconf failed...")
|
||||||
|
|
||||||
def automake(parameters = ''):
|
def automake(parameters = ''):
|
||||||
'''generates a makefile'''
|
'''generates a makefile'''
|
||||||
system('automake %s' % parameters)
|
if system('automake %s' % parameters):
|
||||||
|
raise RunTimeError("!!!! Running automake failed...")
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import sys
|
|||||||
import re
|
import re
|
||||||
from itertools import izip, imap, count, ifilter, ifilterfalse
|
from itertools import izip, imap, count, ifilter, ifilterfalse
|
||||||
|
|
||||||
|
# ActionsAPI
|
||||||
import pisi.actionsapi as actionsapi
|
import pisi.actionsapi as actionsapi
|
||||||
|
|
||||||
def cat(filename):
|
def cat(filename):
|
||||||
|
|||||||
@@ -20,21 +20,33 @@ from pisi.ui import ui
|
|||||||
|
|
||||||
# ActionsAPI Modules
|
# ActionsAPI Modules
|
||||||
import pisi.actionsapi
|
import pisi.actionsapi
|
||||||
from pisi.actionsapi.shelltools import chmod, makedirs
|
from pisi.actionsapi.shelltools import chmod, makedirs, can_access_directory
|
||||||
import pisi.actionsapi.get as get
|
import pisi.actionsapi.get as get
|
||||||
|
|
||||||
def preplib(sourceDirectory):
|
class RunTimeError(pisi.actionsapi.Error):
|
||||||
os.system('/sbin/ldconfig -n -N %s' % get.installDIR() + sourceDirectory)
|
def __init__(self, Exception):
|
||||||
|
ui.error(Exception)
|
||||||
|
|
||||||
|
def preplib(sourceDirectory = '/usr/lib'):
|
||||||
|
sourceDirectory = '%s' % (get.installDIR() + sourceDirectory)
|
||||||
|
if can_access_directory(sourceDirectory):
|
||||||
|
os.system('/sbin/ldconfig -n -N %s' % sourceDirectory)
|
||||||
|
|
||||||
|
def preplib_so(sourceDirectory):
|
||||||
|
pass
|
||||||
|
|
||||||
def gnuconfig_update():
|
def gnuconfig_update():
|
||||||
''' copy newest config.* onto source's '''
|
''' copy newest config.* onto source's '''
|
||||||
shutil.copyfile('/usr/share/gnuconfig/config.sub', os.getcwd() + '/config.sub')
|
for root, dirs, files in os.walk(os.getcwd()):
|
||||||
shutil.copyfile('/usr/share/gnuconfig/config.guess',os.getcwd() + '/config.guess')
|
for file in files:
|
||||||
|
if file == "config.sub" or file == "config.guess":
|
||||||
|
shutil.copyfile('/usr/share/gnuconfig/%s' % file, os.path.join(root, file))
|
||||||
|
|
||||||
ui.info('GNU Config Update Finished...\n')
|
ui.info('GNU Config Update Finished...\n')
|
||||||
|
|
||||||
def libtoolize(parameters = ''):
|
def libtoolize(parameters = ''):
|
||||||
os.system('/usr/bin/libtoolize %s' % parameters)
|
if os.system('/usr/bin/libtoolize %s' % parameters):
|
||||||
|
raise RunTimeError("!!!! Running libtoolize failed...")
|
||||||
|
|
||||||
def gen_usr_ldscript(dynamicLib):
|
def gen_usr_ldscript(dynamicLib):
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ def dobin(sourceFile, destinationDirectory = '/usr/bin'):
|
|||||||
''' example call: pisitools.dobin("bin/xloadimage", "/bin", "xload") '''
|
''' example call: pisitools.dobin("bin/xloadimage", "/bin", "xload") '''
|
||||||
executable_insinto(sourceFile, get.installDIR() + destinationDirectory)
|
executable_insinto(sourceFile, get.installDIR() + destinationDirectory)
|
||||||
|
|
||||||
def doconfd():
|
|
||||||
#FIXME: AdditionalFiles
|
|
||||||
pass
|
|
||||||
|
|
||||||
def dodir(destinationDirectory):
|
def dodir(destinationDirectory):
|
||||||
'''creates a directory tree'''
|
'''creates a directory tree'''
|
||||||
makedirs(get.installDIR() + destinationDirectory)
|
makedirs(get.installDIR() + destinationDirectory)
|
||||||
@@ -43,10 +39,6 @@ def dodoc(*sourceFiles):
|
|||||||
'''inserts the files in the list of files into /usr/share/doc/PACKAGE'''
|
'''inserts the files in the list of files into /usr/share/doc/PACKAGE'''
|
||||||
readable_insinto(get.installDIR() + os.path.join('/usr/share/doc', get.srcTAG()), *sourceFiles)
|
readable_insinto(get.installDIR() + os.path.join('/usr/share/doc', get.srcTAG()), *sourceFiles)
|
||||||
|
|
||||||
def doenvd():
|
|
||||||
#FIXME: AdditionalFiles
|
|
||||||
pass
|
|
||||||
|
|
||||||
def doexe(sourceFile, destinationDirectory):
|
def doexe(sourceFile, destinationDirectory):
|
||||||
'''insert a executable file into destination directory'''
|
'''insert a executable file into destination directory'''
|
||||||
|
|
||||||
@@ -85,10 +77,6 @@ def doinfo(*sourceFiles):
|
|||||||
'''inserts the into files in the list of files into /usr/share/info'''
|
'''inserts the into files in the list of files into /usr/share/info'''
|
||||||
readable_insinto(os.path.join(get.installDIR(), get.infoDIR()), *sourceFiles)
|
readable_insinto(os.path.join(get.installDIR(), get.infoDIR()), *sourceFiles)
|
||||||
|
|
||||||
def doinitd():
|
|
||||||
#FIXME: AdditionalFiles
|
|
||||||
pass
|
|
||||||
|
|
||||||
def dojar():
|
def dojar():
|
||||||
'''installs jar files into /usr/share/PACKAGE/lib, and adds to /usr/share/PACKAGE/classpath.env'''
|
'''installs jar files into /usr/share/PACKAGE/lib, and adds to /usr/share/PACKAGE/classpath.env'''
|
||||||
pass
|
pass
|
||||||
@@ -227,13 +215,3 @@ def remove(sourceFile):
|
|||||||
def removeDir(destinationDirectory):
|
def removeDir(destinationDirectory):
|
||||||
'''removes destinationDirectory and its subtrees'''
|
'''removes destinationDirectory and its subtrees'''
|
||||||
unlinkDir(get.installDIR() + destinationDirectory)
|
unlinkDir(get.installDIR() + destinationDirectory)
|
||||||
|
|
||||||
''' ************************************************************************** '''
|
|
||||||
|
|
||||||
def preplib():
|
|
||||||
'''prepare all library files for installation'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
def preplib_so():
|
|
||||||
'''prepare dynamic library files for installation'''
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -22,10 +22,12 @@ import pisi.actionsapi
|
|||||||
from pisi.actionsapi.shelltools import *
|
from pisi.actionsapi.shelltools import *
|
||||||
|
|
||||||
class FileError(pisi.actionsapi.Error):
|
class FileError(pisi.actionsapi.Error):
|
||||||
pass
|
def __init__(self, Exception):
|
||||||
|
ui.error(Exception)
|
||||||
|
|
||||||
class ArgumentError(pisi.actionsapi.Error):
|
class ArgumentError(pisi.actionsapi.Error):
|
||||||
pass
|
def __init__(self, Exception):
|
||||||
|
ui.error(Exception)
|
||||||
|
|
||||||
def executable_insinto(sourceFile, destinationDirectory):
|
def executable_insinto(sourceFile, destinationDirectory):
|
||||||
'''insert a executable file into destinationDirectory'''
|
'''insert a executable file into destinationDirectory'''
|
||||||
|
|||||||
Reference in New Issue
Block a user