heimdal-build: Avoid using python str.format()
authorAmitay Isaacs <amitay@gmail.com>
Wed, 19 Sep 2018 08:31:34 +0000 (18:31 +1000)
committerMartin Schwenke <martins@samba.org>
Fri, 21 Sep 2018 01:06:44 +0000 (03:06 +0200)
In python 2.6, the format fields need to be numbered explicitly.  This
causes the build to fail on RHEL6/Centos6 with following error:

 File "/home/amitay/samba.git/source4/heimdal_build/wscript_build", line 87, in HEIMDAL_ASN1
    os.path.join(bld.path.abspath(), option_file)))
ValueError: zero length field name in format

To use str.format() in HEIMDAL_ASN1(),

   "--option-file='{}'"  needs to be   "--options-file='{0}'"

Or this fix which avoids str.format() completely.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Sep 21 03:06:44 CEST 2018 on sn-devel-144

source4/heimdal_build/wscript_build

index a0572e4ed5154704c7ba0c6d2b8640bdee0f1014..45938b88315c02d98c8cb4a20a2ea4f1ff64e115 100644 (file)
@@ -82,9 +82,8 @@ def HEIMDAL_ASN1(name, source,
     t.env.ASN1OPTIONS  = options
     t.env.BLDBIN       = os.path.normpath(os.path.join(bld.srcnode.abspath(bld.env), '..'))
     if option_file is not None:
-        t.env.OPTION_FILE = "--option-file='{}'".format(
-                os.path.normpath(
-                    os.path.join(bld.path.abspath(), option_file)))
+        t.env.OPTION_FILE = "--option-file='%s'" % \
+            os.path.normpath(os.path.join(bld.path.abspath(), option_file))
 
     cfile = out_files[0][0:-2] + '.c'
     hfile = out_files[1][0:-3] + '.h'