shutil'lerden kurtul, os.path.join kullan...

This commit is contained in:
S.Çağlar Onur
2005-07-01 12:35:34 +00:00
parent 7b9f670690
commit 18eae65f29
3 changed files with 13 additions and 12 deletions
+3 -3
View File
@@ -5,10 +5,10 @@
import os import os
import string import string
import re import re
import shutil
# pisi modules # pisi modules
from pisi.ui import ui from pisi.ui import ui
from pisi.util import copy_file
# actions api modules # actions api modules
from shell import * from shell import *
@@ -51,9 +51,9 @@ def gnuconfig_update():
newer_location = gnuconfig_findnewest() newer_location = gnuconfig_findnewest()
try: try:
shutil.copyfile(newer_location + '/config.sub', copy_file(newer_location + '/config.sub',
os.getcwd() + '/config.sub') os.getcwd() + '/config.sub')
shutil.copyfile(newer_location + '/config.guess', copy_file(newer_location + '/config.guess',
os.getcwd() + '/config.guess') os.getcwd() + '/config.guess')
except IOError, e: except IOError, e:
ui.error ("Error : %s\n" % e) ui.error ("Error : %s\n" % e)
+1 -1
View File
@@ -10,7 +10,7 @@ from config import config
# Global variables for compiling KDE programs... # Global variables for compiling KDE programs...
kde_dir = os.getenv('KDEDIR') kde_dir = os.getenv('KDEDIR')
qt_dir = os.getenv('QTDIR') qt_dir = os.getenv('QTDIR')
qt_libdir = os.getenv('QTDIR') + '/lib/' qt_libdir = os.path.join(os.getenv('QTDIR') + 'lib/')
def configure(parameters = ''): def configure(parameters = ''):
''' FIXME: Düzgün hale getirilecek ''' ''' FIXME: Düzgün hale getirilecek '''
+9 -8
View File
@@ -3,9 +3,10 @@
# standard python modules # standard python modules
import os import os
import shutil
import gzip import gzip
from pisi.util import copy_file
# actions api modules # actions api modules
from config import config from config import config
@@ -26,7 +27,7 @@ def dodoc(*documentList):
for document in documentList: for document in documentList:
if os.access(document, os.F_OK): if os.access(document, os.F_OK):
shutil.copyfile(document, copy_file(document,
os.path.join(env.install_dir, os.path.join(env.install_dir,
dirs.doc, dirs.doc,
srcTag, srcTag,
@@ -37,17 +38,17 @@ def dosed(filename, *sedPattern):
for pattern in sedPattern: for pattern in sedPattern:
os.system('sed -i -e \'' + pattern + '\' ' + filename) os.system('sed -i -e \'' + pattern + '\' ' + filename)
def dosbin(filename, destination='/' + config.dirs.sbin): def dosbin(filename, destination=config.dirs.sbin):
env = config.env env = config.env
try: try:
os.makedirs(env.install_dir + destination) os.makedirs(os.path.join(env.install_dir, destination))
except OSError: except OSError:
pass pass
if os.access(filename, os.F_OK): if os.access(filename, os.F_OK):
shutil.copyfile(filename, copy_file(filename,
os.path.join(env.install_dir + os.path.join(env.install_dir,
destination, destination,
os.path.basename(filename))) os.path.basename(filename)))
@@ -56,7 +57,7 @@ def doman(filename):
dirs = config.dirs dirs = config.dirs
man, postfix = filename.split('.') man, postfix = filename.split('.')
destDir = os.path.join(env.install_dir, dirs.man, "man"+postfix) destDir = os.path.join(env.install_dir, dirs.man, "man" + postfix)
try: try:
os.makedirs(destDir) os.makedirs(destDir)
except OSError: except OSError:
@@ -67,7 +68,7 @@ def doman(filename):
gzfile.close() gzfile.close()
if os.access(filename, os.F_OK): if os.access(filename, os.F_OK):
shutil.copyfile(filename + '.gz', copy_file(filename + '.gz',
os.path.join(destDir, os.path.join(destDir,
os.path.basename(filename))) os.path.basename(filename)))