Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/grss:master commit in: /
Date: Sat, 25 Jul 2015 01:51:20
Message-Id: 1437789217.83a2ce2e43cf2163cba458e8c133b0de71ec32b4.blueness@gentoo
1 commit: 83a2ce2e43cf2163cba458e8c133b0de71ec32b4
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 25 01:26:45 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 25 01:53:37 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=83a2ce2e
7
8 grsrun: add 'select' flag -s.
9
10 grsrun | 19 ++++++++++++++-----
11 1 file changed, 14 insertions(+), 5 deletions(-)
12
13 diff --git a/grsrun b/grsrun
14 index 86b33ea..c5e5240 100755
15 --- a/grsrun
16 +++ b/grsrun
17 @@ -15,11 +15,13 @@ from getopt import getopt, GetoptError
18
19 def usage(rc=1):
20 usage = """
21 -usage: grsrun [-m|-u|-h]
22 +usage: grsrun [-m|-u|-h|-s <name>]
23
24 -flags: -m Mock run. Don't really execute.
25 - : -u Update run.
26 - : -h print this help file
27 +flags: Release run. Do every step in build script.
28 + : -u Update run. Do only '+' steps.
29 + : -m Mock run. Log what would be done.
30 + : -s <name>. Only run for GRS system <name>.
31 + : -h Print this help file.
32 """
33 print(usage)
34 sys.exit(rc)
35 @@ -28,12 +30,13 @@ flags: -m Mock run. Don't really execute.
36
37 def main():
38 try:
39 - opts, x = getopt(sys.argv[1:], 'muh')
40 + opts, x = getopt(sys.argv[1:], 'mus:h')
41 except GetoptError as e:
42 usage()
43
44 mock_run = False
45 update_run = False
46 + grsname = None
47 for o, a in opts:
48 if o == '-h':
49 usage(0)
50 @@ -41,6 +44,8 @@ def main():
51 mock_run = True
52 elif o == '-u':
53 update_run = True
54 + elif o == '-s':
55 + grsname = a
56
57 os.makedirs(CONST.GRS_CGROUPDIR, mode=0o555, exist_ok=True)
58 if not os.path.ismount(CONST.GRS_CGROUPDIR):
59 @@ -49,6 +54,10 @@ def main():
60
61 count = 0
62 for name in CONST.names:
63 + if grsname:
64 + if name != grsname:
65 + count = count + 1
66 + continue
67 if not os.fork():
68 subcgroup = 'run-%s' % name
69 subcgroupdir = os.path.join(CONST.GRS_CGROUPDIR, subcgroup)