tab2space

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