tab2space
This commit is contained in:
@@ -4,33 +4,33 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
def configure( parameters = None):
|
def configure( parameters = None):
|
||||||
''' FIXME: Düzgün hale getirilecek '''
|
''' FIXME: Düzgün hale getirilecek '''
|
||||||
''' {EXTRA} = '--with-nls --with-libusb --with-something-usefull '''
|
''' {EXTRA} = '--with-nls --with-libusb --with-something-usefull '''
|
||||||
|
|
||||||
configure_string = './configure --prefix=/usr \
|
configure_string = './configure --prefix=/usr \
|
||||||
--host=i686-pc-linux-gnu \
|
--host=i686-pc-linux-gnu \
|
||||||
--mandir=/usr/share/man \
|
--mandir=/usr/share/man \
|
||||||
--infodir=/usr/share/info \
|
--infodir=/usr/share/info \
|
||||||
--datadir=/usr/share \
|
--datadir=/usr/share \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
--localstatedir=/var/lib {EXTRA}'
|
--localstatedir=/var/lib {EXTRA}'
|
||||||
|
|
||||||
os.system( configure_string.replace( '{EXTRA}', parameters ))
|
os.system( configure_string.replace( '{EXTRA}', parameters ))
|
||||||
|
|
||||||
def make():
|
def make():
|
||||||
''' FIXME: Düzgün hale getirilecek '''
|
''' FIXME: Düzgün hale getirilecek '''
|
||||||
os.system( 'make' )
|
os.system( 'make' )
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
''' FIXME: Düzgün hale getirilecek '''
|
''' FIXME: Düzgün hale getirilecek '''
|
||||||
''' {D} = /var/tmp/pisi/ _paket_adı_ /image/ '''
|
''' {D} = /var/tmp/pisi/ _paket_adı_ /image/ '''
|
||||||
|
|
||||||
install_string = 'make prefix={D}/usr \
|
install_string = 'make prefix={D}/usr \
|
||||||
datadir={D}/usr/share \
|
datadir={D}/usr/share \
|
||||||
infodir={D}/usr/share/info \
|
infodir={D}/usr/share/info \
|
||||||
localstatedir={D}/var/lib \
|
localstatedir={D}/var/lib \
|
||||||
mandir={D}/usr/share/man \
|
mandir={D}/usr/share/man \
|
||||||
sysconfdir={D}/etc \
|
sysconfdir={D}/etc \
|
||||||
install'
|
install'
|
||||||
|
|
||||||
os.system( install_string.replace( '{D}', os.path.dirname( os.getcwd()) + '/image' ))
|
os.system( install_string.replace( '{D}', os.path.dirname( os.getcwd()) + '/image' ))
|
||||||
|
|||||||
@@ -5,31 +5,31 @@ import os, string, re, shutil
|
|||||||
from shell import *
|
from shell import *
|
||||||
|
|
||||||
def gnuconfig_findnewest():
|
def gnuconfig_findnewest():
|
||||||
''' find the newest config.* file according to timestamp and return it '''
|
''' find the newest config.* file according to timestamp and return it '''
|
||||||
|
|
||||||
locations = [ '/usr/share/gnuconfig/config.sub', '/usr/share/automake-1.8/config.sub', '/usr/share/automake-1.7/config.sub', '/usr/share/automake-1.6/config.sub', '/usr/share/automake-1.5/config.sub', '/usr/share/automake-1.4/config.sub' ]
|
locations = [ '/usr/share/gnuconfig/config.sub', '/usr/share/automake-1.8/config.sub', '/usr/share/automake-1.7/config.sub', '/usr/share/automake-1.6/config.sub', '/usr/share/automake-1.5/config.sub', '/usr/share/automake-1.4/config.sub' ]
|
||||||
|
|
||||||
newer_location = {}
|
newer_location = {}
|
||||||
|
|
||||||
for i in locations:
|
for i in locations:
|
||||||
newer_location[i] = re.sub( '\'', '', string.split( ( cat( i ) | tr( str.rstrip ) | grep ( '^timestamp' ) | join ), '=')[1] )
|
newer_location[i] = re.sub( '\'', '', string.split( ( cat( i ) | tr( str.rstrip ) | grep ( '^timestamp' ) | join ), '=')[1] )
|
||||||
|
|
||||||
keys = newer_location.keys()
|
keys = newer_location.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
map(newer_location.get, keys )
|
map(newer_location.get, keys )
|
||||||
|
|
||||||
return os.path.dirname( newer_location.popitem()[0] )
|
return os.path.dirname( newer_location.popitem()[0] )
|
||||||
|
|
||||||
def gnuconfig_update():
|
def gnuconfig_update():
|
||||||
''' copy newest config.* onto source's '''
|
''' copy newest config.* onto source's '''
|
||||||
|
|
||||||
newer_location = gnuconfig_findnewest()
|
newer_location = gnuconfig_findnewest()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.copyfile( newer_location + '/config.sub', os.getcwd() + '/config.sub' )
|
shutil.copyfile( newer_location + '/config.sub', os.getcwd() + '/config.sub' )
|
||||||
shutil.copyfile( newer_location + '/config.guess', os.getcwd() + '/config.guess' )
|
shutil.copyfile( newer_location + '/config.guess', os.getcwd() + '/config.guess' )
|
||||||
except IOError:
|
except IOError:
|
||||||
print 'Hata mata...'
|
print 'Hata mata...'
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
print 'GNU Config Update Finished...'
|
print 'GNU Config Update Finished...'
|
||||||
|
|||||||
@@ -8,11 +8,10 @@ import config
|
|||||||
global package_name
|
global package_name
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
''' WILLBE: Unpack module will pass the package name to action script '''
|
''' WILLBE: Unpack module will pass the package name to action script '''
|
||||||
package_name = 'popt-1.7'
|
package_name = 'popt-1.7'
|
||||||
''' WILLBE: pisi-build call action script after entered the build directory '''
|
''' WILLBE: pisi-build call action script after entered the build directory '''
|
||||||
|
|
||||||
os.chdir( config.tmp_dir() + '/' + package_name + '/build' )
|
os.chdir( config.tmp_dir() + '/' + package_name + '/build' )
|
||||||
|
|
||||||
execfile( sys.argv[1] )
|
|
||||||
|
|
||||||
|
execfile( sys.argv[1] )
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ sys.path.append('..')
|
|||||||
import config
|
import config
|
||||||
|
|
||||||
def libtoolize():
|
def libtoolize():
|
||||||
''' FIXME: Düzgün hale getirilecek '''
|
''' FIXME: Düzgün hale getirilecek '''
|
||||||
''' patch source with ltmain patches '''
|
''' patch source with ltmain patches '''
|
||||||
|
|
||||||
os.system( 'patch -sN < ' + config.lib_dir() + '/portage-1.4.1.patch' )
|
os.system( 'patch -sN < ' + config.lib_dir() + '/portage-1.4.1.patch' )
|
||||||
os.system( 'patch -sN < ' + config.lib_dir() + '/sed-1.4.0.patch' )
|
os.system( 'patch -sN < ' + config.lib_dir() + '/sed-1.4.0.patch' )
|
||||||
|
|||||||
@@ -5,37 +5,37 @@ import sys, re
|
|||||||
from itertools import izip, imap, count, ifilter, ifilterfalse
|
from itertools import izip, imap, count, ifilter, ifilterfalse
|
||||||
|
|
||||||
def cat( filename ):
|
def cat( filename ):
|
||||||
return file( filename ).xreadlines()
|
return file( filename ).xreadlines()
|
||||||
|
|
||||||
class grep:
|
class grep:
|
||||||
"""keep only lines that match the regexp"""
|
"""keep only lines that match the regexp"""
|
||||||
def __init__( self,pat, flags = 0 ):
|
def __init__( self,pat, flags = 0 ):
|
||||||
self.fun = re.compile( pat, flags ).match
|
self.fun = re.compile( pat, flags ).match
|
||||||
def __ror__( self, input ):
|
def __ror__( self, input ):
|
||||||
return ifilter( self.fun, input )
|
return ifilter( self.fun, input )
|
||||||
|
|
||||||
class tr:
|
class tr:
|
||||||
"""apply arbitrary transform to each sequence element"""
|
"""apply arbitrary transform to each sequence element"""
|
||||||
def __init__( self, transform ):
|
def __init__( self, transform ):
|
||||||
self.tr = transform
|
self.tr = transform
|
||||||
def __ror__( self, input ):
|
def __ror__( self, input ):
|
||||||
return imap( self.tr, input )
|
return imap( self.tr, input )
|
||||||
|
|
||||||
class printto:
|
class printto:
|
||||||
"""print sequence elements one per line"""
|
"""print sequence elements one per line"""
|
||||||
def __init__( self, out = sys.stdout ):
|
def __init__( self, out = sys.stdout ):
|
||||||
self.out = out
|
self.out = out
|
||||||
def __ror__( self,input ):
|
def __ror__( self,input ):
|
||||||
for l in input:
|
for l in input:
|
||||||
print >> self.out, l
|
print >> self.out, l
|
||||||
|
|
||||||
printlines = printto( sys.stdout )
|
printlines = printto( sys.stdout )
|
||||||
|
|
||||||
class terminator:
|
class terminator:
|
||||||
def __init__( self,method ):
|
def __init__( self,method ):
|
||||||
self.process = method
|
self.process = method
|
||||||
def __ror__( self,input ):
|
def __ror__( self,input ):
|
||||||
return self.process( input )
|
return self.process( input )
|
||||||
|
|
||||||
aslist = terminator( list )
|
aslist = terminator( list )
|
||||||
asdict = terminator( dict )
|
asdict = terminator( dict )
|
||||||
@@ -44,20 +44,20 @@ join = terminator( "".join )
|
|||||||
enum = terminator( enumerate )
|
enum = terminator( enumerate )
|
||||||
|
|
||||||
class sort:
|
class sort:
|
||||||
def __ror__( self,input ):
|
def __ror__( self,input ):
|
||||||
ll = list( input )
|
ll = list( input )
|
||||||
ll.sort()
|
ll.sort()
|
||||||
return ll
|
return ll
|
||||||
sort = sort()
|
sort = sort()
|
||||||
|
|
||||||
class uniq:
|
class uniq:
|
||||||
def __ror__( self,input ):
|
def __ror__( self,input ):
|
||||||
for i in input:
|
for i in input:
|
||||||
try:
|
try:
|
||||||
if i == prev:
|
if i == prev:
|
||||||
continue
|
continue
|
||||||
except NameError:
|
except NameError:
|
||||||
pass
|
pass
|
||||||
prev = i
|
prev = i
|
||||||
yield i
|
yield i
|
||||||
uniq = uniq()
|
uniq = uniq()
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import time
|
|||||||
from tempfile import mkstemp, mkdtemp
|
from tempfile import mkstemp, mkdtemp
|
||||||
|
|
||||||
def sleep( sleep_time = 5 ):
|
def sleep( sleep_time = 5 ):
|
||||||
time.sleep( sleep_time )
|
time.sleep( sleep_time )
|
||||||
|
|
||||||
def createTmpFile():
|
def createTmpFile():
|
||||||
handle, path = mkstemp()
|
handle, path = mkstemp()
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def createTmpDir():
|
def createTmpDir():
|
||||||
path = mkdtemp()
|
path = mkdtemp()
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user