summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-08-28 09:11:15 +0200
committerGuido Günther <agx@sigxcpu.org>2012-08-28 09:11:15 +0200
commitff2e88c3779d44f05a50d9ceee403992c9202471 (patch)
tree5da21fa09d7d15d4ce7b18cecf69ddf1b9083570 /cfg.mk
parent6cf501ca9d76d417768e7a46cd6c8c1d36eedf7c (diff)
New upstream version 0.10.0~rc2
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk126
1 files changed, 56 insertions, 70 deletions
diff --git a/cfg.mk b/cfg.mk
index 7664d5deb..4cdfd1ba8 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -13,7 +13,8 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
# Use alpha.gnu.org for alpha and beta releases.
# Use ftp.gnu.org for major releases.
@@ -76,6 +77,17 @@ local-checks-to-skip = \
sc_makefile_check \
sc_useless_cpp_parens
+# Most developers don't run 'make distcheck'. We want the official
+# dist to be secure, but don't want to penalize other developers
+# using a distro that has not yet picked up the automake fix.
+# FIXME remove this ifeq (making the syntax check unconditional)
+# once fixed automake (1.11.6 or 1.12.2+) is more common.
+ifeq ($(filter dist%, $(MAKECMDGOALS)), )
+local-checks-to-skip += sc_vulnerable_makefile_CVE-2012-3386
+else
+distdir: sc_vulnerable_makefile_CVE-2012-3386.z
+endif
+
# Files that should never cause syntax check failures.
VC_LIST_ALWAYS_EXCLUDE_REGEX = \
(^(HACKING|docs/(news\.html\.in|.*\.patch))|\.po)$$
@@ -133,20 +145,9 @@ useless_free_options = \
--name=virJSONValueFree \
--name=virLastErrFreeData \
--name=virNetMessageFree \
- --name=virNetClientFree \
- --name=virNetClientProgramFree \
- --name=virNetClientStreamFree \
- --name=virNetServerFree \
- --name=virNetServerClientFree \
--name=virNetServerMDNSFree \
--name=virNetServerMDNSEntryFree \
--name=virNetServerMDNSGroupFree \
- --name=virNetServerProgramFree \
- --name=virNetServerServiceFree \
- --name=virNetSocketFree \
- --name=virNetSASLContextFree \
- --name=virNetSASLSessionFree \
- --name=virNetTLSSessionFree \
--name=virNWFilterDefFree \
--name=virNWFilterEntryFree \
--name=virNWFilterHashTableFree \
@@ -159,6 +160,8 @@ useless_free_options = \
--name=virNetworkObjFree \
--name=virNodeDeviceDefFree \
--name=virNodeDeviceObjFree \
+ --name=virObjectUnref \
+ --name=virObjectFreeCallback \
--name=virSecretDefFree \
--name=virStorageEncryptionFree \
--name=virStorageEncryptionSecretFree \
@@ -442,7 +445,7 @@ sc_size_of_brackets:
# Ensure that no C source file, docs, or rng schema uses TABs for
# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
# files in gnulib, since they're imported.
-space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py|syms)|(daemon|tools)/.*\.in)
+space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py|pl|syms)|(daemon|tools)/.*\.in)
sc_TAB_in_indentation:
@prohibit='^ * ' \
in_vc_files='$(space_indent_files)$$' \
@@ -506,46 +509,12 @@ sc_avoid_attribute_unused_in_header:
# |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$'
msg_gen_function =
-msg_gen_function += ESX_ERROR
-msg_gen_function += ESX_VI_ERROR
-msg_gen_function += HYPERV_ERROR
-msg_gen_function += PHYP_ERROR
msg_gen_function += VIR_ERROR
-msg_gen_function += VMX_ERROR
-msg_gen_function += XENXS_ERROR
-msg_gen_function += eventReportError
-msg_gen_function += ifaceError
-msg_gen_function += interfaceReportError
-msg_gen_function += iptablesError
msg_gen_function += lxcError
-msg_gen_function += libxlError
-msg_gen_function += macvtapError
-msg_gen_function += networkReportError
-msg_gen_function += nodeReportError
-msg_gen_function += openvzError
-msg_gen_function += pciReportError
-msg_gen_function += qemuReportError
-msg_gen_function += qemudDispatchClientFailure
msg_gen_function += regerror
-msg_gen_function += remoteError
-msg_gen_function += remoteDispatchFormatError
-msg_gen_function += statsError
-msg_gen_function += streamsReportError
-msg_gen_function += usbReportError
-msg_gen_function += umlReportError
msg_gen_function += vah_error
msg_gen_function += vah_warning
-msg_gen_function += vboxError
-msg_gen_function += virCommandError
-msg_gen_function += virConfError
-msg_gen_function += virCPUReportError
-msg_gen_function += virEventError
-msg_gen_function += virDomainReportError
msg_gen_function += virGenericReportError
-msg_gen_function += virHashError
-msg_gen_function += virHookReportError
-msg_gen_function += virInterfaceReportError
-msg_gen_function += virJSONError
msg_gen_function += virLibConnError
msg_gen_function += virLibDomainError
msg_gen_function += virLibDomainSnapshotError
@@ -556,39 +525,21 @@ msg_gen_function += virLibNWFilterError
msg_gen_function += virLibSecretError
msg_gen_function += virLibStoragePoolError
msg_gen_function += virLibStorageVolError
-msg_gen_function += virNetworkReportError
-msg_gen_function += virNodeDeviceReportError
-msg_gen_function += virNWFilterReportError
msg_gen_function += virRaiseError
+msg_gen_function += virReportError
msg_gen_function += virReportErrorHelper
msg_gen_function += virReportSystemError
-msg_gen_function += virSecretReportError
-msg_gen_function += virSecurityReportError
-msg_gen_function += virSexprError
-msg_gen_function += virSmbiosReportError
-msg_gen_function += virSocketError
-msg_gen_function += virStatsError
-msg_gen_function += virStorageReportError
-msg_gen_function += virUtilError
-msg_gen_function += virXMLError
-msg_gen_function += virXenInotifyError
-msg_gen_function += virXenStoreError
-msg_gen_function += virXendError
-msg_gen_function += vmwareError
msg_gen_function += xenapiSessionErrorHandler
-msg_gen_function += xenUnifiedError
-msg_gen_function += xenXMError
# Uncomment the following and run "make syntax-check" to see diagnostics
# that are not yet marked for translation, but that need to be rewritten
# so that they are translatable.
# msg_gen_function += fprintf
# msg_gen_function += testError
-# msg_gen_function += virXenError
# msg_gen_function += vshPrint
# msg_gen_function += vshError
-func_or := $(shell printf '$(msg_gen_function)'|tr -s '[[:space:]]' '|')
+func_or := $(shell echo $(msg_gen_function)|tr -s ' ' '|')
func_re := ($(func_or))
# Look for diagnostics that aren't marked for translation.
@@ -622,6 +573,30 @@ sc_prohibit_newline_at_end_of_diagnostic:
&& { echo '$(ME): newline at end of message(s)' 1>&2; \
exit 1; } || :
+# Look for diagnostics that lack a % in the format string, except that we
+# allow VIR_ERROR to do this, and ignore functions that take a single
+# string rather than a format argument.
+sc_prohibit_diagnostic_without_format:
+ @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
+ grep -A2 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
+ | sed -rn -e ':l; /[,"]$$/ {N;b l;}' \
+ -e '/(xenapiSessionErrorHandler|vah_(error|warning))/d' \
+ -e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \
+ | grep -vE 'VIR_ERROR' && \
+ { echo '$(ME): found diagnostic without %' 1>&2; \
+ exit 1; } || :
+
+# The strings "" and "%s" should never be marked for translation.
+# Files under tests/ and examples/ should not be translated.
+sc_prohibit_useless_translation:
+ @prohibit='_\("(%s)?"\)' \
+ halt='found useless translation' \
+ $(_sc_search_regexp)
+ @prohibit='\<N?_ *\(' \
+ in_vc_files='^(tests|examples)/' \
+ halt='no translations in tests or examples' \
+ $(_sc_search_regexp)
+
# Enforce recommended preprocessor indentation style.
sc_preprocessor_indentation:
@if cppi --version >/dev/null 2>&1; then \
@@ -644,6 +619,13 @@ sc_copyright_format:
halt='spell Red Hat as two words' \
$(_sc_search_regexp)
+# Prefer the new URL listing over the old street address listing when
+# calling out where to get a copy of the [L]GPL.
+sc_copyright_address:
+ @prohibit=Boston,' MA' \
+ halt='Point to <http://www.gnu.org/licenses/>, not an address' \
+ $(_sc_search_regexp)
+
# Some functions/macros produce messages intended solely for developers
# and maintainers. Do not mark them for translation.
sc_prohibit_gettext_markup:
@@ -750,7 +732,7 @@ $(srcdir)/src/remote/remote_client_bodies.h: $(srcdir)/src/remote/remote_protoco
$(MAKE) -C src remote/remote_client_bodies.h
# List all syntax-check exemptions:
-exclude_file_name_regexp--sc_avoid_strcase = ^tools/virsh\.c$$
+exclude_file_name_regexp--sc_avoid_strcase = ^tools/virsh\.h$$
_src1=libvirt|fdstream|qemu/qemu_monitor|util/(command|util)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller
exclude_file_name_regexp--sc_avoid_write = \
@@ -758,6 +740,9 @@ exclude_file_name_regexp--sc_avoid_write = \
exclude_file_name_regexp--sc_bindtextdomain = ^(tests|examples)/
+exclude_file_name_regexp--sc_copyright_address = \
+ ^COPYING\.LIB$$
+
exclude_file_name_regexp--sc_flags_usage = ^(docs/|src/util/virnetdevtap\.c$$)
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics = \
@@ -819,9 +804,10 @@ exclude_file_name_regexp--sc_prohibit_xmlURI = ^src/util/viruri\.c$$
exclude_file_name_regexp--sc_prohibit_return_as_function = \.py$$
-exclude_file_name_regexp--sc_require_config_h = ^(examples/|tools/virsh-edit.c$$)
+_virsh_includes=(edit|domain-monitor|domain|volume|pool|network|interface|nwfilter|secret|snapshot|host|nodedev)
+exclude_file_name_regexp--sc_require_config_h = ^(examples/|tools/virsh-$(_virsh_includes)\.c$$)
-exclude_file_name_regexp--sc_require_config_h_first = ^(examples/|tools/virsh-edit.c$$)
+exclude_file_name_regexp--sc_require_config_h_first = ^(examples/|tools/virsh-$(_virsh_includes)\.c$$)
exclude_file_name_regexp--sc_trailing_blank = \
(/qemuhelpdata/|\.(fig|gif|ico|png)$$)