1 |
commit: 60492d29bc4cad13e376b17b6efc63a51c8729e4 |
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:26:45 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=60492d29 |
7 |
|
8 |
grsrun: add 'select' flag -s. |
9 |
|
10 |
grsrun | 18 +++++++++++++----- |
11 |
1 file changed, 13 insertions(+), 5 deletions(-) |
12 |
|
13 |
diff --git a/grsrun b/grsrun |
14 |
index 86b33ea..2e69c71 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,9 @@ def main(): |
60 |
|
61 |
count = 0 |
62 |
for name in CONST.names: |
63 |
+ if grsname: |
64 |
+ if name != grsname: |
65 |
+ continue |
66 |
if not os.fork(): |
67 |
subcgroup = 'run-%s' % name |
68 |
subcgroupdir = os.path.join(CONST.GRS_CGROUPDIR, subcgroup) |