2626import tempfile
2727
2828
29- def parse_args ():
29+ def _install_script (src , dst ):
30+ shutil .copyfile (src , dst )
31+ os .chmod (dst , 0o755 )
32+
33+
34+ def main ():
3035 parser = argparse .ArgumentParser (description = __doc__ )
3136 parser .add_argument ("--materialize-root-py" , required = True , help = "Path to materialize_root.py." )
3237 parser .add_argument ("--root" , required = True , help = "pkg_install-materialized root directory (symlink farm)." )
@@ -38,16 +43,8 @@ def parse_args():
3843 parser .add_argument ("--preinstall" , default = "" , help = "Optional path to a preinstall script." )
3944 parser .add_argument ("--postinstall" , default = "" , help = "Optional path to a postinstall script." )
4045 parser .add_argument ("--signing-identity" , default = "" , help = "Optional pkgbuild --sign identity name." )
41- return parser .parse_args ()
42-
4346
44- def _install_script (src , dst ):
45- shutil .copyfile (src , dst )
46- os .chmod (dst , 0o755 )
47-
48-
49- def main ():
50- args = parse_args ()
47+ args = parser .parse_args ()
5148
5249 real_root_dir = tempfile .mkdtemp ()
5350 scripts_dir = tempfile .mkdtemp ()
@@ -57,16 +54,13 @@ def main():
5754 check = True ,
5855 )
5956
57+ # fmt: off
6058 pkgbuild_args = [
6159 args .pkgbuild ,
62- "--root" ,
63- real_root_dir ,
64- "--identifier" ,
65- args .identifier ,
66- "--version" ,
67- args .version ,
68- "--install-location" ,
69- args .install_location ,
60+ "--root" , real_root_dir ,
61+ "--identifier" , args .identifier ,
62+ "--version" , args .version ,
63+ "--install-location" , args .install_location ,
7064 ]
7165
7266 if args .preinstall or args .postinstall :
0 commit comments