From a6d9d4b65fd7cdd59912dcb4e18f32cca3155270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 30 Aug 2005 19:21:39 +0000 Subject: [PATCH] =?UTF-8?q?echo=20dosya=20yoksa=20yarats=C4=B1n,=20curDIR?= =?UTF-8?q?=20mevcut=20klas=C3=B6r=C3=BC,=20ENV=20ise=20arg=C3=BCman=20ola?= =?UTF-8?q?rak=20verilen=20env.=20de=C4=9Fi=C5=9Fkenini=20d=C3=B6nd=C3=BCr?= =?UTF-8?q?s=C3=BCn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/get.py | 8 +++++++- pisi/actionsapi/shelltools.py | 15 ++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pisi/actionsapi/get.py b/pisi/actionsapi/get.py index 2b9d1ac7..f9b8124a 100644 --- a/pisi/actionsapi/get.py +++ b/pisi/actionsapi/get.py @@ -11,7 +11,7 @@ # Please read the COPYING file. # Standart Python Modules -import os.path +import os # PISI Modules import pisi.actionsapi @@ -26,6 +26,12 @@ class BinutilsError(pisi.actionsapi.Error): env = glb.env dirs = glb.dirs +def curDIR(): + return os.getcwd() + +def ENV(env): + return os.environ[env]; + # variables.Env def pkgDIR(): diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index 93385cca..caec4d09 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -38,15 +38,12 @@ def makedirs(destinationDirectory): pass def echo(destionationFile, content): - if can_access_file(destionationFile): - try: - f = open(destionationFile, 'a') - f.write("%s\n" % content) - f.close() - except IOError: - ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n') - else: - ctx.ui.error('\n!!! ActionsAPI [echo]: File doesn\'t exists...\n') + try: + f = open(destionationFile, 'a') + f.write("%s\n" % content) + f.close() + except IOError: + ctx.ui.error('\n!!! ActionsAPI [echo]: Can\'t append to file...\n') def chmod(sourceFile, mode = 0755): '''change the mode of sourceFile to the mode'''