[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sat Sep 21 20:51:05 UTC 2019


The branch, master has been updated
       via  89288c7e839 samba_version.py: avoid inefficient string concatenations
       via  432d9fd2214 samba_deps.py avoid inefficient string concatenations
       via  8b43aabecba samba_bundled.py avoid inefficient string concatenations
       via  0141c82eedb samba_autoconf.py: avoid inefficient string concatenations
       via  2291679e2b0 samba_abi.py: avoid inefficient string concatenations
       via  dd0837c9a84 user.py: import tempfile module only where needed
      from  01b0e5aadf9 spoolss: Add PRINTER_DRIVER_CATEGORY_3D driver define

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 89288c7e8398d86a24ea19a94908bc85a2664074
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Aug 25 23:03:54 2019 +0200

    samba_version.py: avoid inefficient string concatenations
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Sat Sep 21 20:50:17 UTC 2019 on sn-devel-184

commit 432d9fd2214a4804a9cfefb9916e97efb9909c2c
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Aug 25 23:02:37 2019 +0200

    samba_deps.py avoid inefficient string concatenations
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8b43aabecbad2084169b229859bf5bfc9e2ddac0
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Aug 25 23:02:00 2019 +0200

    samba_bundled.py avoid inefficient string concatenations
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0141c82eedbe525169546f6d30488149c3a7ed7a
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Aug 25 23:01:22 2019 +0200

    samba_autoconf.py: avoid inefficient string concatenations
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2291679e2b02e729e34ef848164d6630c5adc546
Author: Björn Jacke <bj at sernet.de>
Date:   Sun Aug 25 22:53:59 2019 +0200

    samba_abi.py: avoid inefficient string concatenations
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dd0837c9a84bdbb98c9c31997c431173dfe6e714
Author: Björn Jacke <bj at sernet.de>
Date:   Mon Aug 26 00:50:29 2019 +0200

    user.py: import tempfile module only where needed
    
    Signed-off-by: Bjoern Jacke <bjacke at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_abi.py      | 4 +---
 buildtools/wafsamba/samba_autoconf.py | 5 ++---
 buildtools/wafsamba/samba_bundled.py  | 4 ++--
 buildtools/wafsamba/samba_deps.py     | 6 ++----
 buildtools/wafsamba/samba_version.py  | 8 ++++----
 python/samba/netcmd/user.py           | 2 +-
 6 files changed, 12 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 5e7686da3d6..bf82fc5fe1f 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -72,9 +72,7 @@ def parse_sigs(sigs, abi_match):
 
 def save_sigs(sig_file, parsed_sigs):
     '''save ABI signatures to a file'''
-    sigs = ''
-    for s in sorted(parsed_sigs.keys()):
-        sigs += '%s: %s\n' % (s, parsed_sigs[s])
+    sigs = "".join('%s: %s\n' % (s, parsed_sigs[s]) for s in sorted(parsed_sigs.keys()))
     return samba_utils.save_file(sig_file, sigs, create_dir=True)
 
 
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index ee15e34b5ec..63664a41160 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -23,13 +23,12 @@ def DEFINE(conf, d, v, add_to_cflags=False, quote=False):
 
 def hlist_to_string(conf, headers=None):
     '''convert a headers list to a set of #include lines'''
-    hdrs=''
     hlist = conf.env.hlist
     if headers:
         hlist = hlist[:]
         hlist.extend(TO_LIST(headers))
-    for h in hlist:
-        hdrs += '#include <%s>\n' % h
+    hdrs = "\n".join('#include <%s>' % h for h in hlist)
+
     return hdrs
 
 
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 60ce7da7232..5f080dd8a7a 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -204,8 +204,8 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
     version_checks = '%s >= %s' % (pkg, minversion)
     if maxversion is not None:
         version_checks += ' %s <= %s' % (pkg, maxversion)
-    for v in version_blacklist:
-        version_checks += ' %s != %s' % (pkg, v)
+
+    version_checks += "".join(' %s != %s' % (pkg, v) for v in version_blacklist)
 
     # try pkgconfig first
     if (conf.CHECK_CFG(package=pkg,
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 03c37079a8c..f400e1833a2 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -253,10 +253,8 @@ def add_init_functions(self):
                 cflags.append('-DSTATIC_%s_MODULES_PROTO=%s' % (m, proto))
         else:
             cflags.append('-DSTATIC_%s_MODULES=%s' % (m, ','.join(init_fn_list) + ',' + sentinel))
-            proto=''
-            for f in init_fn_list:
-                proto += '_MODULE_PROTO(%s)' % f
-            proto += "extern void __%s_dummy_module_proto(void)" % (m)
+            proto = "".join('_MODULE_PROTO(%s)' % f for f in init_fn_list) +\
+                    "extern void __%s_dummy_module_proto(void)" % (m)
             cflags.append('-DSTATIC_%s_MODULES_PROTO=%s' % (m, proto))
     self.cflags = cflags
 
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index f0e7b4d0caf..5df7ddbcb3d 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -173,10 +173,10 @@ also accepted as dictionary entries here
             self.STRING_WITH_NICKNAME = self.STRING
 
     def __str__(self):
-        string="/* Autogenerated by waf */\n"
-        string+="#define SAMBA_VERSION_MAJOR %u\n" % self.MAJOR
-        string+="#define SAMBA_VERSION_MINOR %u\n" % self.MINOR
-        string+="#define SAMBA_VERSION_RELEASE %u\n" % self.RELEASE
+        string="/* Autogenerated by waf */\n" +\
+                "#define SAMBA_VERSION_MAJOR %u\n" % self.MAJOR +\
+                "#define SAMBA_VERSION_MINOR %u\n" % self.MINOR +\
+                "#define SAMBA_VERSION_RELEASE %u\n" % self.RELEASE
         if self.REVISION is not None:
             string+="#define SAMBA_VERSION_REVISION %u\n" % self.REVISION
 
diff --git a/python/samba/netcmd/user.py b/python/samba/netcmd/user.py
index e9f35f158e3..e59222f7727 100644
--- a/python/samba/netcmd/user.py
+++ b/python/samba/netcmd/user.py
@@ -23,7 +23,6 @@ import pwd
 import os
 import io
 import re
-import tempfile
 import difflib
 import fcntl
 import signal
@@ -2411,6 +2410,7 @@ LDAP server using the 'nano' editor.
         except IndexError:
             raise CommandError('Unable to find user "%s"' % (username))
 
+        import tempfile
         for msg in res:
             result_ldif = common.get_ldif_for_editor(samdb, msg)
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list