You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/resources/scripts/lib/buildfed.py
+34-17Lines changed: 34 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,6 @@
1
1
importsys
2
+
importcodecs
3
+
importos
2
4
importtraceback
3
5
importlogging
4
6
@@ -7,19 +9,22 @@
7
9
fromenvconfigimportPropConfig
8
10
fromdatetimeimportdatetime
9
11
10
-
defparse_system_property(sys_prop):
11
-
ifnotsys_prop:
12
-
logging.error("Empty system property not allowed!")
12
+
defparse_cli_property(cli_prop):
13
+
ifnotcli_prop:
14
+
logging.error("Empty property not allowed!")
13
15
exit(1)
14
16
15
-
s=sys_prop.split(":", 1)
17
+
s=cli_prop.split(":", 1)
16
18
ifnots[0]:
17
-
logging.error("Empty system property name!")
19
+
logging.error("Empty property name!")
18
20
exit(1)
19
21
20
22
name=s[0]
21
23
value=s[1] iflen(s) >1elseNone
22
24
25
+
ifnotvalue:
26
+
logging.warn("Empty value for property '%s'."%name)
27
+
23
28
return (name, value)
24
29
25
30
@@ -40,7 +45,8 @@ def main():
40
45
parser.add_option("--cert-config-update", dest="cert_config_update", help="Enable writing of info section for 'update' certificates within the configuration file [optional]", action="store_true")
parser.add_option("-D", "--define", dest="sys_properties", help="Define a system property [multiple]", metavar="NAME:VALUE", action="append")
48
+
parser.add_option("-D", "--define", dest="cli_properties", help="Define a command line property [multiple]", metavar="NAME:VALUE", action="append")
49
+
parser.add_option("-F", "--fromFile", dest="file_properties", help="Define a command line property from file content [multiple]", metavar="NAME:FILE", action="append")
44
50
parser.add_option("--passphrase-in", dest="passphrase_in", help="Passphrase of input archive files [optional]", metavar="PASSPHRASE")
45
51
parser.add_option("--passphrase-out", dest="passphrase_out", help="Passphrase for output archive files [optional]", metavar="PASSPHRASE")
0 commit comments