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 0E5341393F9 for ; Sat, 25 Jul 2015 01:24:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 79CAEE0998; Sat, 25 Jul 2015 01:24:19 +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 1CE52E0998 for ; Sat, 25 Jul 2015 01:24:19 +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 07A48340A89 for ; Sat, 25 Jul 2015 01:24:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 632BBB7 for ; Sat, 25 Jul 2015 01:24:12 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1437787605.60492d29bc4cad13e376b17b6efc63a51c8729e4.blueness@gentoo> Subject: [gentoo-commits] proj/grss:master commit in: / X-VCS-Repository: proj/grss X-VCS-Files: grsrun X-VCS-Directories: / X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 60492d29bc4cad13e376b17b6efc63a51c8729e4 X-VCS-Branch: master Date: Sat, 25 Jul 2015 01:24:12 +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: 40ef18fd-1895-4843-ae07-d01e64d9c10d X-Archives-Hash: 46b7905171704888d9d50a5ec53f38f0 commit: 60492d29bc4cad13e376b17b6efc63a51c8729e4 Author: Anthony G. Basile gentoo org> AuthorDate: Sat Jul 25 01:26:45 2015 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Jul 25 01:26:45 2015 +0000 URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=60492d29 grsrun: add 'select' flag -s. grsrun | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/grsrun b/grsrun index 86b33ea..2e69c71 100755 --- a/grsrun +++ b/grsrun @@ -15,11 +15,13 @@ from getopt import getopt, GetoptError def usage(rc=1): usage = """ -usage: grsrun [-m|-u|-h] +usage: grsrun [-m|-u|-h|-s ] -flags: -m Mock run. Don't really execute. - : -u Update run. - : -h print this help file +flags: Release run. Do every step in build script. + : -u Update run. Do only '+' steps. + : -m Mock run. Log what would be done. + : -s . Only run for GRS system . + : -h Print this help file. """ print(usage) sys.exit(rc) @@ -28,12 +30,13 @@ flags: -m Mock run. Don't really execute. def main(): try: - opts, x = getopt(sys.argv[1:], 'muh') + opts, x = getopt(sys.argv[1:], 'mus:h') except GetoptError as e: usage() mock_run = False update_run = False + grsname = None for o, a in opts: if o == '-h': usage(0) @@ -41,6 +44,8 @@ def main(): mock_run = True elif o == '-u': update_run = True + elif o == '-s': + grsname = a os.makedirs(CONST.GRS_CGROUPDIR, mode=0o555, exist_ok=True) if not os.path.ismount(CONST.GRS_CGROUPDIR): @@ -49,6 +54,9 @@ def main(): count = 0 for name in CONST.names: + if grsname: + if name != grsname: + continue if not os.fork(): subcgroup = 'run-%s' % name subcgroupdir = os.path.join(CONST.GRS_CGROUPDIR, subcgroup)