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 string
import re
import shutil
# pisi modules
from pisi.ui import ui
from pisi.util import copy_file
# actions api modules
from shell import *
@@ -51,9 +51,9 @@ def gnuconfig_update():
newer_location = gnuconfig_findnewest()
try:
shutil.copyfile(newer_location + '/config.sub',
copy_file(newer_location + '/config.sub',
os.getcwd() + '/config.sub')
shutil.copyfile(newer_location + '/config.guess',
copy_file(newer_location + '/config.guess',
os.getcwd() + '/config.guess')
except IOError, 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...
kde_dir = os.getenv('KDEDIR')
qt_dir = os.getenv('QTDIR')
qt_libdir = os.getenv('QTDIR') + '/lib/'
qt_libdir = os.path.join(os.getenv('QTDIR') + 'lib/')
def configure(parameters = ''):
''' FIXME: Düzgün hale getirilecek '''
+9 -8
View File
@@ -3,9 +3,10 @@
# standard python modules
import os
import shutil
import gzip
from pisi.util import copy_file
# actions api modules
from config import config
@@ -26,7 +27,7 @@ def dodoc(*documentList):
for document in documentList:
if os.access(document, os.F_OK):
shutil.copyfile(document,
copy_file(document,
os.path.join(env.install_dir,
dirs.doc,
srcTag,
@@ -37,17 +38,17 @@ def dosed(filename, *sedPattern):
for pattern in sedPattern:
os.system('sed -i -e \'' + pattern + '\' ' + filename)
def dosbin(filename, destination='/' + config.dirs.sbin):
def dosbin(filename, destination=config.dirs.sbin):
env = config.env
try:
os.makedirs(env.install_dir + destination)
os.makedirs(os.path.join(env.install_dir, destination))
except OSError:
pass
if os.access(filename, os.F_OK):
shutil.copyfile(filename,
os.path.join(env.install_dir +
copy_file(filename,
os.path.join(env.install_dir,
destination,
os.path.basename(filename)))
@@ -56,7 +57,7 @@ def doman(filename):
dirs = config.dirs
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:
os.makedirs(destDir)
except OSError:
@@ -67,7 +68,7 @@ def doman(filename):
gzfile.close()
if os.access(filename, os.F_OK):
shutil.copyfile(filename + '.gz',
copy_file(filename + '.gz',
os.path.join(destDir,
os.path.basename(filename)))