From 7d418364aa01595cb4cc807879f21af18340a81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Mon, 13 Jun 2005 20:45:03 +0000 Subject: [PATCH] tab2space --- src/pisi/actionsapi/autotools.py | 48 +++++++++++----------- src/pisi/actionsapi/gnuconfig.py | 38 ++++++++--------- src/pisi/actionsapi/libbuild.py | 11 +++-- src/pisi/actionsapi/libtoolize.py | 8 ++-- src/pisi/actionsapi/shell.py | 68 +++++++++++++++---------------- src/pisi/actionsapi/utils.py | 10 ++--- 6 files changed, 91 insertions(+), 92 deletions(-) diff --git a/src/pisi/actionsapi/autotools.py b/src/pisi/actionsapi/autotools.py index e2b4f0b8..28a7d16f 100644 --- a/src/pisi/actionsapi/autotools.py +++ b/src/pisi/actionsapi/autotools.py @@ -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' )) diff --git a/src/pisi/actionsapi/gnuconfig.py b/src/pisi/actionsapi/gnuconfig.py index 55c157e0..0de934ce 100644 --- a/src/pisi/actionsapi/gnuconfig.py +++ b/src/pisi/actionsapi/gnuconfig.py @@ -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...' diff --git a/src/pisi/actionsapi/libbuild.py b/src/pisi/actionsapi/libbuild.py index c04d4ffe..48a6bbaa 100644 --- a/src/pisi/actionsapi/libbuild.py +++ b/src/pisi/actionsapi/libbuild.py @@ -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] ) diff --git a/src/pisi/actionsapi/libtoolize.py b/src/pisi/actionsapi/libtoolize.py index 574cae61..43f9c125 100644 --- a/src/pisi/actionsapi/libtoolize.py +++ b/src/pisi/actionsapi/libtoolize.py @@ -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' ) diff --git a/src/pisi/actionsapi/shell.py b/src/pisi/actionsapi/shell.py index fc3dcb49..fead2ac4 100644 --- a/src/pisi/actionsapi/shell.py +++ b/src/pisi/actionsapi/shell.py @@ -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() diff --git a/src/pisi/actionsapi/utils.py b/src/pisi/actionsapi/utils.py index b57047f3..7f939b1a 100644 --- a/src/pisi/actionsapi/utils.py +++ b/src/pisi/actionsapi/utils.py @@ -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