From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E9EBE13888F for ; Fri, 9 Oct 2015 02:40:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 463EAE07E2; Fri, 9 Oct 2015 02:40:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B8C94E07E6 for ; Fri, 9 Oct 2015 02:40:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F3C7F34070A for ; Fri, 9 Oct 2015 02:40:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D6800CC4 for ; Fri, 9 Oct 2015 02:40:33 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1444342077.b2e05841e9b4eed6c287631bde8be58ff9430bb6.vapier@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/, catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/resume.py catalyst/base/stagebase.py catalyst/support.py X-VCS-Directories: catalyst/base/ catalyst/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: b2e05841e9b4eed6c287631bde8be58ff9430bb6 X-VCS-Branch: master Date: Fri, 9 Oct 2015 02:40:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2115752f-5de5-48b8-9189-ee4b594a6a19 X-Archives-Hash: ff81e9205abb02994a45b3c5ad105898 commit: b2e05841e9b4eed6c287631bde8be58ff9430bb6 Author: Mike Frysinger gentoo org> AuthorDate: Tue Oct 6 22:28:36 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Oct 8 22:07:57 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b2e05841 support: use snakeoil.fileutils.touch No point in duplicating our own when snakeoil provides a better one. catalyst/base/resume.py | 5 +++-- catalyst/base/stagebase.py | 6 ++++-- catalyst/support.py | 8 -------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/catalyst/base/resume.py b/catalyst/base/resume.py index e3f03e7..443b46d 100644 --- a/catalyst/base/resume.py +++ b/catalyst/base/resume.py @@ -15,8 +15,9 @@ import os import sys import traceback +from snakeoil import fileutils + from catalyst.fileops import ensure_dirs, pjoin, listdir_files, clear_dir -from catalyst.support import touch class AutoResumeError(Exception): @@ -69,7 +70,7 @@ class AutoResume(object): myf.write(data) else: try: - touch(fname) + fileutils.touch(fname) self._points[point] = fname except Exception as e: print AutoResumeError(str(e)) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 813e5f1..f81c51b 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -9,12 +9,14 @@ from stat import ST_UID, ST_GID, ST_MODE # for convienience pjoin = os.path.join +from snakeoil import fileutils + from DeComp.compress import CompressMap from catalyst.defaults import (SOURCE_MOUNT_DEFAULTS, TARGET_MOUNT_DEFAULTS, PORT_LOGDIR_CLEAN) from catalyst.support import (CatalystError, msg, file_locate, normpath, - touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, + cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount, file_check) from catalyst.base.targetbase import TargetBase from catalyst.base.clearbase import ClearBase @@ -1513,7 +1515,7 @@ class StageBase(TargetBase, ClearBase, GenBase): cmd(self.settings["controller_file"]+\ " build_packages "+mypack,\ "Error in attempt to build packages",env=self.env) - touch(build_packages_resume) + fileutils.touch(build_packages_resume) self.resume.enable("build_packages") except CatalystError: self.unbind() diff --git a/catalyst/support.py b/catalyst/support.py index 1207d36..960a91d 100644 --- a/catalyst/support.py +++ b/catalyst/support.py @@ -250,14 +250,6 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec): raise CatalystError('\n\tAlso: '.join(messages)) -def touch(myfile): - try: - myf=open(myfile,"w") - myf.close() - except IOError: - raise CatalystError("Could not touch "+myfile+".", print_traceback=True) - - def countdown(secs=5, doing="Starting"): if secs: print ">>> Waiting",secs,"seconds before starting..."