[SCM] Samba Shared Repository - branch master updated
Jelmer Vernooij
jelmer at samba.org
Thu Mar 15 19:49:03 MDT 2012
The branch, master has been updated
via 0affe19 Remove more unnecessary shebang lines in python files.
via 3530ac0 samba.tests.source: Verify that only executable python files (and only executable files) have a shebang line.
via fa806eb wafsamba: Remove shebang lines from non-executable files.
from 6589e02 Make reinit_after_fork_pipe_handler code with reads being interrupted by a signal.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0affe19304b96332c5c1ff36373203216a35ec07
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Mar 15 16:03:57 2012 +0100
Remove more unnecessary shebang lines in python files.
Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
Autobuild-Date: Fri Mar 16 02:48:52 CET 2012 on sn-devel-104
commit 3530ac01492727d64b7f7d10d7a1ef21bb590c5d
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Mar 15 16:03:36 2012 +0100
samba.tests.source: Verify that only executable python files (and only executable files) have a shebang line.
commit fa806eb7c666ec795fa4f8309f939c4e9bfb7b36
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Mar 15 15:56:27 2012 +0100
wafsamba: Remove shebang lines from non-executable files.
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/gccdeps.py | 1 -
buildtools/wafsamba/nothreads.py | 1 -
buildtools/wafsamba/samba_wildcard.py | 2 --
buildtools/wafsamba/stale_files.py | 1 -
lib/socket_wrapper/socket.py | 2 --
source4/librpc/rpc/dcerpc.py | 2 --
source4/scripting/python/samba/tests/source.py | 21 ++++++++++++++++++++-
7 files changed, 20 insertions(+), 10 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/gccdeps.py b/buildtools/wafsamba/gccdeps.py
index 2f09083..2da42e6 100644
--- a/buildtools/wafsamba/gccdeps.py
+++ b/buildtools/wafsamba/gccdeps.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2008-2010 (ita)
diff --git a/buildtools/wafsamba/nothreads.py b/buildtools/wafsamba/nothreads.py
index b39aeb5..90babf4 100644
--- a/buildtools/wafsamba/nothreads.py
+++ b/buildtools/wafsamba/nothreads.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2008 (ita)
diff --git a/buildtools/wafsamba/samba_wildcard.py b/buildtools/wafsamba/samba_wildcard.py
index a0a10a3..84503b8 100644
--- a/buildtools/wafsamba/samba_wildcard.py
+++ b/buildtools/wafsamba/samba_wildcard.py
@@ -1,5 +1,3 @@
-#! /usr/bin/env python
-
# based on playground/evil in the waf svn tree
import os, datetime
diff --git a/buildtools/wafsamba/stale_files.py b/buildtools/wafsamba/stale_files.py
index 1ee1ff9..5a91367 100644
--- a/buildtools/wafsamba/stale_files.py
+++ b/buildtools/wafsamba/stale_files.py
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
diff --git a/lib/socket_wrapper/socket.py b/lib/socket_wrapper/socket.py
index bba9665..ccbb820 100644
--- a/lib/socket_wrapper/socket.py
+++ b/lib/socket_wrapper/socket.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#
# Wrapper for socket wrapper (based on python socket wrapper)
# Copyright (C) Amitay Isaacs 2011
#
diff --git a/source4/librpc/rpc/dcerpc.py b/source4/librpc/rpc/dcerpc.py
index 73db9e3..830720c 100644
--- a/source4/librpc/rpc/dcerpc.py
+++ b/source4/librpc/rpc/dcerpc.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer at samba.org> 2008
#
diff --git a/source4/scripting/python/samba/tests/source.py b/source4/scripting/python/samba/tests/source.py
index 06e8739..0876b04 100644
--- a/source4/scripting/python/samba/tests/source.py
+++ b/source4/scripting/python/samba/tests/source.py
@@ -33,7 +33,6 @@ from samba.tests import (
)
-
def get_python_source_files():
"""Iterate over all Python source files."""
library_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "samba"))
@@ -184,6 +183,26 @@ class TestSource(TestCase):
self.fail(self._format_message(illegal_newlines,
'Non-unix newlines were found in the following source files:'))
+ def test_shebang_lines(self):
+ """Check that files with shebang lines and only those are executable."""
+ files_with_shebang = {}
+ files_without_shebang= {}
+ for fname, line_no, line in self._iter_source_files_lines():
+ if line_no >= 1:
+ continue
+ executable = (os.stat(fname).st_mode & 0111)
+ has_shebang = line.startswith("#!")
+ if has_shebang and not executable:
+ self._push_file(files_with_shebang, fname, line_no)
+ if not has_shebang and executable:
+ self._push_file(files_without_shebang, fname, line_no)
+ if files_with_shebang:
+ self.fail(self._format_message(files_with_shebang,
+ 'Files with shebang line that are not executable:'))
+ if files_without_shebang:
+ self.fail(self._format_message(files_without_shebang,
+ 'Files without shebang line that are executable:'))
+
pep8_ignore = [
'E401', # multiple imports on one line
'E501', # line too long
--
Samba Shared Repository
More information about the samba-cvs
mailing list