shutil'lerden kurtul, os.path.join kullan...
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 '''
|
||||
|
||||
@@ -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)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user