Projects
openEuler:Mainline
libtdb
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:libtdb.spec
Changed
@@ -1,6 +1,6 @@ Name: libtdb -Version: 1.4.5 -Release: 3 +Version: 1.4.7 +Release: 1 Summary: The Tdb library License: LGPLv3+ URL: http://tdb.samba.org/ @@ -87,6 +87,9 @@ %ldconfig_scriptlets %changelog +* Sat Nov 05 2022 shixuantong<shixuantong1@huawei.com> - 1.4.7-1 +- upgrade version to 1.4.7 + * Tue May 10 2022 mylee <liweiganga@uniontech.com> - 1.4.5-3 - fix spec changelog date
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/libtdb.git</param> - <param name="revision">b0b144cbffc832e6c7dcc16296c00eb1a7cb05e6</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/testwaf.sh
Deleted
@@ -1,70 +0,0 @@ -#!/bin/bash - -set -e -set -x - -d=$(dirname $0) - -cd $d/.. -PREFIX=$HOME/testprefix - -if $# -gt 0 ; then - tests="$*" -else - tests="lib/replace lib/talloc lib/tevent lib/tdb lib/ldb" -fi - -echo "testing in dirs $tests" - -for d in $tests; do - echo "`date`: testing $d" - pushd $d - rm -rf bin - type waf - waf dist - ./configure -C --enable-developer --prefix=$PREFIX - time make - make install - make distcheck - case $d in - "lib/ldb") - ldd bin/ldbadd - ;; - "lib/replace") - ldd bin/replace_testsuite - ;; - "lib/talloc") - ldd bin/talloc_testsuite - ;; - "lib/tdb") - ldd bin/tdbtool - ;; - esac - popd -done - -echo "testing python portability" -pushd lib/talloc -versions="python2.4 python2.5 python2.6 python3.0 python3.1" -for p in $versions; do - ret=$(which $p || echo "failed") - if $ret = "failed" ; then - echo "$p not found, skipping" - continue - fi - echo "Testing $p" - $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX - $p ../../buildtools/bin/waf build install -done -popd - -echo "testing cross compiling" -pushd lib/talloc -ret=$(which arm-linux-gnueabi-gcc || echo "failed") -if $ret != "failed" ; then - CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX --cross-compile --cross-execute='runarm' - make && make install -else - echo "Cross-compiler not installed, skipping test" -fi -popd
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/cwrap.c
Deleted
@@ -1,46 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * - * Replaceable functions by cwrap - * - * Copyright (c) 2014 Andreas Schneider <asn@samba.org> - * - * ** NOTE! The following LGPL license applies to the replace - * ** library. This does NOT imply that all of Samba is released - * ** under the LGPL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see <http://www.gnu.org/licenses/>. - */ - -#include "replace.h" - -bool nss_wrapper_enabled(void) -{ - return false; -} - -bool nss_wrapper_hosts_enabled(void) -{ - return false; -} - -bool socket_wrapper_enabled(void) -{ - return false; -} - -bool uid_wrapper_enabled(void) -{ - return false; -}
View file
_service:tar_scm:tdb-1.4.7.tar.gz/ABI/tdb-1.4.6.sigs
Added
@@ -0,0 +1,73 @@ +tdb_add_flags: void (struct tdb_context *, unsigned int) +tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA) +tdb_chainlock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA) +tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_close: int (struct tdb_context *) +tdb_delete: int (struct tdb_context *, TDB_DATA) +tdb_dump_all: void (struct tdb_context *) +tdb_enable_seqnum: void (struct tdb_context *) +tdb_error: enum TDB_ERROR (struct tdb_context *) +tdb_errorstr: const char *(struct tdb_context *) +tdb_exists: int (struct tdb_context *, TDB_DATA) +tdb_fd: int (struct tdb_context *) +tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_firstkey: TDB_DATA (struct tdb_context *) +tdb_freelist_size: int (struct tdb_context *) +tdb_get_flags: int (struct tdb_context *) +tdb_get_logging_private: void *(struct tdb_context *) +tdb_get_seqnum: int (struct tdb_context *) +tdb_hash_size: int (struct tdb_context *) +tdb_increment_seqnum_nonblock: void (struct tdb_context *) +tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) +tdb_lockall: int (struct tdb_context *) +tdb_lockall_mark: int (struct tdb_context *) +tdb_lockall_nonblock: int (struct tdb_context *) +tdb_lockall_read: int (struct tdb_context *) +tdb_lockall_read_nonblock: int (struct tdb_context *) +tdb_lockall_unmark: int (struct tdb_context *) +tdb_log_fn: tdb_log_func (struct tdb_context *) +tdb_map_size: size_t (struct tdb_context *) +tdb_name: const char *(struct tdb_context *) +tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_null: dptr = 0xXXXX, dsize = 0 +tdb_open: struct tdb_context *(const char *, int, int, int, mode_t) +tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func) +tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_printfreelist: int (struct tdb_context *) +tdb_remove_flags: void (struct tdb_context *, unsigned int) +tdb_reopen: int (struct tdb_context *) +tdb_reopen_all: int (int) +tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_runtime_check_for_robust_mutexes: bool (void) +tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) +tdb_set_max_dead: void (struct tdb_context *, int) +tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) +tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_storev: int (struct tdb_context *, TDB_DATA, const TDB_DATA *, int, int) +tdb_summary: char *(struct tdb_context *) +tdb_transaction_active: bool (struct tdb_context *) +tdb_transaction_cancel: int (struct tdb_context *) +tdb_transaction_commit: int (struct tdb_context *) +tdb_transaction_prepare_commit: int (struct tdb_context *) +tdb_transaction_start: int (struct tdb_context *) +tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) +tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_traverse_chain: int (struct tdb_context *, unsigned int, tdb_traverse_func, void *) +tdb_traverse_key_chain: int (struct tdb_context *, TDB_DATA, tdb_traverse_func, void *) +tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) +tdb_unlockall: int (struct tdb_context *) +tdb_unlockall_read: int (struct tdb_context *) +tdb_validate_freelist: int (struct tdb_context *, int *) +tdb_wipe_all: int (struct tdb_context *)
View file
_service:tar_scm:tdb-1.4.7.tar.gz/ABI/tdb-1.4.7.sigs
Added
@@ -0,0 +1,73 @@ +tdb_add_flags: void (struct tdb_context *, unsigned int) +tdb_append: int (struct tdb_context *, TDB_DATA, TDB_DATA) +tdb_chainlock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA) +tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock: int (struct tdb_context *, TDB_DATA) +tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA) +tdb_check: int (struct tdb_context *, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_close: int (struct tdb_context *) +tdb_delete: int (struct tdb_context *, TDB_DATA) +tdb_dump_all: void (struct tdb_context *) +tdb_enable_seqnum: void (struct tdb_context *) +tdb_error: enum TDB_ERROR (struct tdb_context *) +tdb_errorstr: const char *(struct tdb_context *) +tdb_exists: int (struct tdb_context *, TDB_DATA) +tdb_fd: int (struct tdb_context *) +tdb_fetch: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_firstkey: TDB_DATA (struct tdb_context *) +tdb_freelist_size: int (struct tdb_context *) +tdb_get_flags: int (struct tdb_context *) +tdb_get_logging_private: void *(struct tdb_context *) +tdb_get_seqnum: int (struct tdb_context *) +tdb_hash_size: int (struct tdb_context *) +tdb_increment_seqnum_nonblock: void (struct tdb_context *) +tdb_jenkins_hash: unsigned int (TDB_DATA *) +tdb_lock_nonblock: int (struct tdb_context *, int, int) +tdb_lockall: int (struct tdb_context *) +tdb_lockall_mark: int (struct tdb_context *) +tdb_lockall_nonblock: int (struct tdb_context *) +tdb_lockall_read: int (struct tdb_context *) +tdb_lockall_read_nonblock: int (struct tdb_context *) +tdb_lockall_unmark: int (struct tdb_context *) +tdb_log_fn: tdb_log_func (struct tdb_context *) +tdb_map_size: size_t (struct tdb_context *) +tdb_name: const char *(struct tdb_context *) +tdb_nextkey: TDB_DATA (struct tdb_context *, TDB_DATA) +tdb_null: dptr = 0xXXXX, dsize = 0 +tdb_open: struct tdb_context *(const char *, int, int, int, mode_t) +tdb_open_ex: struct tdb_context *(const char *, int, int, int, mode_t, const struct tdb_logging_context *, tdb_hash_func) +tdb_parse_record: int (struct tdb_context *, TDB_DATA, int (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_printfreelist: int (struct tdb_context *) +tdb_remove_flags: void (struct tdb_context *, unsigned int) +tdb_reopen: int (struct tdb_context *) +tdb_reopen_all: int (int) +tdb_repack: int (struct tdb_context *) +tdb_rescue: int (struct tdb_context *, void (*)(TDB_DATA, TDB_DATA, void *), void *) +tdb_runtime_check_for_robust_mutexes: bool (void) +tdb_set_logging_function: void (struct tdb_context *, const struct tdb_logging_context *) +tdb_set_max_dead: void (struct tdb_context *, int) +tdb_setalarm_sigptr: void (struct tdb_context *, volatile sig_atomic_t *) +tdb_store: int (struct tdb_context *, TDB_DATA, TDB_DATA, int) +tdb_storev: int (struct tdb_context *, TDB_DATA, const TDB_DATA *, int, int) +tdb_summary: char *(struct tdb_context *) +tdb_transaction_active: bool (struct tdb_context *) +tdb_transaction_cancel: int (struct tdb_context *) +tdb_transaction_commit: int (struct tdb_context *) +tdb_transaction_prepare_commit: int (struct tdb_context *) +tdb_transaction_start: int (struct tdb_context *) +tdb_transaction_start_nonblock: int (struct tdb_context *) +tdb_transaction_write_lock_mark: int (struct tdb_context *) +tdb_transaction_write_lock_unmark: int (struct tdb_context *) +tdb_traverse: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_traverse_chain: int (struct tdb_context *, unsigned int, tdb_traverse_func, void *) +tdb_traverse_key_chain: int (struct tdb_context *, TDB_DATA, tdb_traverse_func, void *) +tdb_traverse_read: int (struct tdb_context *, tdb_traverse_func, void *) +tdb_unlock: int (struct tdb_context *, int, int) +tdb_unlockall: int (struct tdb_context *) +tdb_unlockall_read: int (struct tdb_context *) +tdb_validate_freelist: int (struct tdb_context *, int *) +tdb_wipe_all: int (struct tdb_context *)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/bin/waf -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/bin/waf
Changed
@@ -32,7 +32,7 @@ import os, sys, inspect -VERSION="2.0.21" +VERSION="2.0.24" REVISION="x" GIT="x" INSTALL="x" @@ -164,4 +164,3 @@ from waflib import Scripting Scripting.waf_entry_point(cwd, VERSION, wafdir0) -
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/compare_config_h4.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/compare_config_h4.sh
Changed
@@ -3,8 +3,8 @@ # compare the generated config.h from a waf build with existing samba # build -grep "^.define" bin/default/source4/include/config.h | sort > waf-config.h -grep "^.define" $HOME/samba_old/source4/include/config.h | sort > old-config.h +grep "^.define" bin/default/source4/include/config.h | sort >waf-config.h +grep "^.define" $HOME/samba_old/source4/include/config.h | sort >old-config.h comm -23 old-config.h waf-config.h
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/compare_generated.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/compare_generated.sh
Changed
@@ -10,41 +10,40 @@ strip_file() { - in_file=$1 - out_file=$2 - cat $in_file | - grep -v 'The following definitions come from' | - grep -v 'Automatically generated at' | - grep -v 'Generated from' | - sed 's|/home/tnagy/samba/source4||g' | - sed 's|/home/tnagy/samba/|../|g' | - sed 's|bin/default/source4/||g' | - sed 's|bin/default/|../|g' | - sed 's/define _____/define ___/g' | - sed 's/define __*/define _/g' | - sed 's/define _DEFAULT_/define _/g' | - sed 's/define _SOURCE4_/define ___/g' | - sed 's/define ___/define _/g' | - sed 's/ifndef ___/ifndef _/g' | - sed 's|endif /* ____|endif /* __|g' | - sed s/__DEFAULT_SOURCE4/__/ | - sed s/__DEFAULT_SOURCE4/__/ | - sed s/__DEFAULT/____/ > $out_file + in_file=$1 + out_file=$2 + cat $in_file | + grep -v 'The following definitions come from' | + grep -v 'Automatically generated at' | + grep -v 'Generated from' | + sed 's|/home/tnagy/samba/source4||g' | + sed 's|/home/tnagy/samba/|../|g' | + sed 's|bin/default/source4/||g' | + sed 's|bin/default/|../|g' | + sed 's/define _____/define ___/g' | + sed 's/define __*/define _/g' | + sed 's/define _DEFAULT_/define _/g' | + sed 's/define _SOURCE4_/define ___/g' | + sed 's/define ___/define _/g' | + sed 's/ifndef ___/ifndef _/g' | + sed 's|endif /* ____|endif /* __|g' | + sed s/__DEFAULT_SOURCE4/__/ | + sed s/__DEFAULT_SOURCE4/__/ | + sed s/__DEFAULT/____/ >$out_file } compare_file() { - f=$f - bname=$(basename $f) - t1=/tmp/$bname.old.$$ - t2=/tmp/$bname.new.$$ - strip_file $old_build/$f $t1 - strip_file bin/default/$f $t2 - diff -u -b $t1 $t2 2>&1 - rm -f $t1 $t2 + f=$f + bname=$(basename $f) + t1=/tmp/$bname.old.$$ + t2=/tmp/$bname.new.$$ + strip_file $old_build/$f $t1 + strip_file bin/default/$f $t2 + diff -u -b $t1 $t2 2>&1 + rm -f $t1 $t2 } for f in $gen_files; do - compare_file $f + compare_file $f done -
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/compare_install.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/compare_install.sh
Changed
@@ -3,6 +3,6 @@ prefix1="$1" prefix2="$2" -(cd $prefix1 && find . ) | sort > p1.txt -(cd $prefix2 && find . ) | sort > p2.txt +(cd $prefix1 && find .) | sort >p1.txt +(cd $prefix2 && find .) | sort >p2.txt diff -u p12.txt
View file
_service:tar_scm:tdb-1.4.7.tar.gz/buildtools/devel_env.sh
Added
@@ -0,0 +1,7 @@ +# This file can be sourced using +# +# source buildtools/devel_env.sh + +# Setup python path for lsp server +PYTHONPATH="$(pwd)/third_party/waf:$(pwd)/python:$(pwd)/bin/python:$(pwd)/selftest:${PYTHONPATH}" +export PYTHONPATH
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/scripts/Makefile.waf -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/scripts/Makefile.waf
Changed
@@ -1,7 +1,7 @@ # simple makefile wrapper to run waf -WAF_BINARY=BUILDTOOLS/bin/waf -WAF=WAF_MAKE=1 $(WAF_BINARY) +WAF_BINARY=$(PYTHON) BUILDTOOLS/bin/waf +WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) all: $(WAF) build
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/scripts/abi_gen.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/scripts/abi_gen.sh
Changed
@@ -6,16 +6,21 @@ GDBSCRIPT="gdb_syms.$$" ( -cat <<EOF + cat <<EOF set height 0 set width 0 EOF -nm "$SHAREDLIB" | cut -d' ' -f2- | egrep '^BDGTRVWS' | grep -v @ | egrep -v ' (__bss_start|_edata|_init|_fini|_end)' | cut -c3- | sort | while read s; do - echo "echo $s: " - echo p $s -done -) > $GDBSCRIPT + + # On older linker versions _init|_fini symbols are not hidden. + objdump --dynamic-syms "${SHAREDLIB}" | + awk '$0 !~ /.hidden/ {if ($2 == "g" && $3 ~ /D(F|O)/ && $4 ~ /(.bss|.rodata|.text)/) print $NF}' | + sort | + while read -r s; do + echo "echo $s: " + echo p "${s}" + done +) >$GDBSCRIPT # forcing the terminal avoids a problem on Fedora12 -TERM=none gdb -n -batch -x $GDBSCRIPT "$SHAREDLIB" < /dev/null +TERM=none gdb -n -batch -x $GDBSCRIPT "$SHAREDLIB" </dev/null rm -f $GDBSCRIPT
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/scripts/autogen-waf.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/scripts/autogen-waf.sh
Changed
@@ -1,6 +1,6 @@ #!/bin/sh -p=`dirname $0` +p=$(dirname $0) echo "Setting up for waf build" @@ -13,12 +13,12 @@ echo "Setting up configure" rm -f $p/configure $p/include/config*.h* -sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure +sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" <"$p/$d/scripts/configure.waf" >$p/configure chmod +x $p/configure echo "Setting up Makefile" rm -f $p/makefile $p/Makefile -sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/Makefile +sed "s|BUILDTOOLS|$d|g" <"$p/$d/scripts/Makefile.waf" >$p/Makefile echo "done. Now run $p/configure or $p/configure.developer then make." if $p != "." ; then
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/scripts/configure.waf -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/scripts/configure.waf
Changed
@@ -1,6 +1,6 @@ #!/bin/sh -PREVPATH=`dirname $0` +PREVPATH=$(dirname $0) WAF=BUILDTOOLS/bin/waf @@ -9,6 +9,13 @@ JOBS=1 export JOBS +# Make sure we don't have any library preloaded. +unset LD_PRELOAD + +# Make sure we get stable hashes +PYTHONHASHSEED=1 +export PYTHONHASHSEED + cd BUILDPATH || exit 1 -$WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba3.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba3.py
Changed
@@ -35,14 +35,14 @@ # the extra_includes list is relative to the source3 directory extra_includes = '.', 'include', 'lib' - # local heimdal paths only included when USING_SYSTEM_KRB5 is not set - if not bld.CONFIG_SET("USING_SYSTEM_KRB5"): - extra_includes += '../source4/heimdal/lib/com_err', - '../source4/heimdal/lib/krb5', - '../source4/heimdal/lib/gssapi', - '../source4/heimdal/lib/gssapi/gssapi', - '../source4/heimdal_build/include', - '../bin/default/source4/heimdal/lib/asn1' + # local heimdal paths must only be included when using our embedded Heimdal + if bld.CONFIG_SET("USING_EMBEDDED_HEIMDAL"): + extra_includes += '../third_party/heimdal/lib/com_err', + '../third_party/heimdal/lib/base', + '../third_party/heimdal/lib/krb5', + '../third_party/heimdal/lib/gssapi/gssapi', + '../third_party/heimdal_build/include', + '../bin/default/third_party/heimdal/lib/asn1' if bld.CONFIG_SET('USING_SYSTEM_TDB'): (tdb_includes, tdb_ldflags, tdb_cpppath) = library_flags(bld, 'tdb') @@ -85,6 +85,11 @@ return bld.SAMBA_LIBRARY(name, *args, **kwargs) Build.BuildContext.SAMBA3_LIBRARY = SAMBA3_LIBRARY +def SAMBA3_PLUGIN(bld, name, *args, **kwargs): + s3_fix_kwargs(bld, kwargs) + return bld.SAMBA_PLUGIN(name, *args, **kwargs) +Build.BuildContext.SAMBA3_PLUGIN = SAMBA3_PLUGIN + def SAMBA3_MODULE(bld, name, *args, **kwargs): s3_fix_kwargs(bld, kwargs) return bld.SAMBA_MODULE(name, *args, **kwargs)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_abi.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_abi.py
Changed
@@ -142,7 +142,7 @@ abi_gen = os.path.join(topsrc, 'buildtools/scripts/abi_gen.sh') abi_file = "%s/%s-%s.sigs" % (self.abi_directory, self.version_libname, - self.vnum) + self.abi_vnum) tsk = self.create_task('abi_check', self.link_task.outputs0) tsk.ABI_FILE = abi_file @@ -157,6 +157,46 @@ if not symname in symmap: symmapsymname = version +def version_script_map_process_file(fname, version, abi_match): + '''process one standard version_script file, adding the symbols to the + abi_match''' + in_section = False + in_global = False + in_local = False + for _line in Utils.readf(fname).splitlines(): + line = _line.strip() + if line == "": + continue + if line.startswith("#"): + continue + if line.endswith(" {"): + in_section = True + continue + if line == "};": + assert in_section + in_section = False + in_global = False + in_local = False + continue + if not in_section: + continue + if line == "global:": + in_global = True + in_local = False + continue + if line == "local:": + in_global = False + in_local = True + continue + + symname = line.split(";")0 + assert symname != "" + if in_local: + if symname == "*": + continue + symname = "!%s" % symname + if not symname in abi_match: + abi_match.append(symname) def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match): """Write a vscript file for a library in --version-script format. @@ -214,21 +254,51 @@ symmap = {} versions = + abi_match = list(task.env.ABI_MATCH) for f in task.inputs: fname = f.abspath(task.env) basename = os.path.basename(fname) - version = basenamelen(task.env.LIBNAME)+1:-len(".sigs") - versions.append(version) - abi_process_file(fname, version, symmap) + if basename.endswith(".sigs"): + version = basenamelen(task.env.LIBNAME)+1:-len(".sigs") + versions.append(version) + abi_process_file(fname, version, symmap) + continue + if basename == "version-script.map": + version_script_map_process_file(fname, task.env.VERSION, abi_match) + continue + raise Errors.WafError('Unsupported input "%s"' % fname) + if task.env.PRIVATE_LIBRARY: + # For private libraries we need to inject + # each public symbol explicitly into the + # abi match array and remove all explicit + # versioning so that each exported symbol + # is tagged with the private library tag. + for s in symmap: + abi_match.append(s) + symmap = {} + versions = f = open(tgt, mode='w') try: abi_write_vscript(f, task.env.LIBNAME, task.env.VERSION, versions, - symmap, task.env.ABI_MATCH) + symmap, abi_match) finally: f.close() +def VSCRIPT_MAP_PRIVATE(bld, libname, orig_vscript, version, private_vscript): + version = version.replace("-", "_").replace("+","_").upper() + t = bld.SAMBA_GENERATOR(private_vscript, + rule=abi_build_vscript, + source=orig_vscript, + group='vscripts', + target=private_vscript) + t.env.ABI_MATCH = + t.env.VERSION = version + t.env.LIBNAME = libname + t.env.PRIVATE_LIBRARY = True + t.vars = 'LIBNAME', 'VERSION', 'ABI_MATCH', 'PRIVATE_LIBRARY' +Build.BuildContext.VSCRIPT_MAP_PRIVATE = VSCRIPT_MAP_PRIVATE -def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None): +def ABI_VSCRIPT(bld, libname, abi_directory, version, vscript, abi_match=None, private_library=False): '''generate a vscript file for our public libraries''' if abi_directory: source = bld.path.ant_glob('%s/%s-0-9*.sigs' % (abi_directory, libname), flat=True) @@ -238,6 +308,9 @@ else: source = '' + if private_library is None: + private_library = False + libname = os.path.basename(libname) version = os.path.basename(version) libname = libname.replace("-", "_").replace("+","_").upper() @@ -255,5 +328,6 @@ t.env.ABI_MATCH = abi_match t.env.VERSION = version t.env.LIBNAME = libname - t.vars = 'LIBNAME', 'VERSION', 'ABI_MATCH' + t.env.PRIVATE_LIBRARY = private_library + t.vars = 'LIBNAME', 'VERSION', 'ABI_MATCH', 'PRIVATE_LIBRARY' Build.BuildContext.ABI_VSCRIPT = ABI_VSCRIPT
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_autoconf.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_autoconf.py
Changed
@@ -212,7 +212,7 @@ @conf -def CHECK_DECLS(conf, vars, reverse=False, headers=None, always=False): +def CHECK_DECLS(conf, vars, reverse=False, headers=None, lib=None, always=False): '''check a list of variable declarations, using the HAVE_DECL_xxx form of define @@ -227,6 +227,7 @@ if not CHECK_VARIABLE(conf, v, define=define, headers=headers, + lib=lib, msg='Checking for declaration of %s' % v, always=always): if not CHECK_CODE(conf, @@ -238,6 +239,7 @@ msg='Checking for declaration of %s (as enum)' % v, local_include=False, headers=headers, + lib=lib, define=define, always=always): ret = False @@ -342,6 +344,23 @@ return ret @conf +def CHECK_SIGN(conf, v, headers=None): + '''check the sign of a type''' + define_name = v.upper().replace(' ', '_') + for op, signed in ('<', 'signed'), + ('>', 'unsigned'): + if CHECK_CODE(conf, + f'static int test_array1 - 2 * !((({v})-1) {op} 0);', + define=f'{define_name}_{signed.upper()}', + quote=False, + headers=headers, + local_include=False, + msg=f"Checking if '{v}' is {signed}"): + return True + + return False + +@conf def CHECK_VALUEOF(conf, v, headers=None, define=None): '''check the value of a variable/define''' ret = True
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_bundled.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_bundled.py
Changed
@@ -5,19 +5,9 @@ from waflib.Configure import conf from wafsamba import samba_utils -def PRIVATE_NAME(bld, name, private_extension, private_library): +def PRIVATE_NAME(bld, name): '''possibly rename a library to include a bundled extension''' - if not private_library: - return name - - # we now use the same private name for libraries as the public name. - # see http://git.samba.org/?p=tridge/junkcode.git;a=tree;f=shlib for a - # demonstration that this is the right thing to do - # also see http://lists.samba.org/archive/samba-technical/2011-January/075816.html - if private_extension: - return name - extension = bld.env.PRIVATE_EXTENSION if extension and name.startswith('%s' % extension): @@ -95,20 +85,22 @@ return False return True -@conf -def LIB_MUST_BE_BUNDLED(conf, libname): - if libname in conf.env.BUNDLED_LIBS: +def __LIB_MUST_BE(liblist, libname): + if libname in liblist: return True - if '!%s' % libname in conf.env.BUNDLED_LIBS: + if '!%s' % libname in liblist: return False - if 'ALL' in conf.env.BUNDLED_LIBS: + if 'ALL' in liblist: return True return False @conf +def LIB_MUST_BE_BUNDLED(conf, libname): + return __LIB_MUST_BE(conf.env.BUNDLED_LIBS, libname) + +@conf def LIB_MUST_BE_PRIVATE(conf, libname): - return ('ALL' in conf.env.PRIVATE_LIBS or - libname in conf.env.PRIVATE_LIBS) + return __LIB_MUST_BE(conf.env.PRIVATE_LIBS, libname) @conf def CHECK_BUNDLED_SYSTEM_PKG(conf, libname, minversion='0.0.0',
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_cross.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_cross.py
Changed
@@ -134,7 +134,7 @@ cross_answers_incomplete = True add_answer(ca_file, msg, ans) (retcode, retstring) = ans - args = '/bin/sh', '-c', "echo -n '%s'; exit %d" % (retstring, retcode) + args = '/bin/sh', '-c', "printf %%s '%s'; exit %d" % (retstring, retcode) real_Popen.__init__(*(obj, args), **kw)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_deps.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_deps.py
Changed
@@ -2,12 +2,11 @@ import os, sys, re -from waflib import Build, Options, Logs, Utils, Errors +from waflib import Build, Options, Logs, Utils, Errors, Task from waflib.Logs import debug from waflib.Configure import conf from waflib import ConfigSet -from samba_bundled import BUILTIN_LIBRARY from samba_utils import LOCAL_CACHE, TO_LIST, get_tgt_list, unique_list from samba_autoconf import library_flags @@ -78,7 +77,7 @@ the full dependency list for a target until we have all of the targets declared. ''' - if self.samba_type in 'LIBRARY', 'BINARY', 'PYTHON': + if self.samba_type in 'LIBRARY', 'PLUGIN', 'BINARY', 'PYTHON': self.uselib = list(self.final_syslibs) self.uselib_local = list(self.final_libs) self.add_objects = list(self.final_objects) @@ -102,7 +101,7 @@ debug('deps: computed dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s', self.sname, self.uselib, self.uselib_local, self.add_objects) - if self.samba_type in 'SUBSYSTEM': + if self.samba_type in 'SUBSYSTEM', 'BUILTIN': # this is needed for the cflags of libs that come from pkg_config self.uselib = list(self.final_syslibs) self.uselib.extend(list(self.direct_syslibs)) @@ -284,7 +283,7 @@ # build a list of targets that each source file is part of for t in tgt_list: - if not targetst.sname in 'LIBRARY', 'BINARY', 'PYTHON' : + if not targetst.sname in 'LIBRARY', 'PLUGIN', 'BINARY', 'PYTHON' : continue for obj in t.add_objects: t2 = t.bld.get_tgen_by_name(obj) @@ -354,7 +353,7 @@ targets = LOCAL_CACHE(bld, 'TARGET_TYPE') for t in tgt_list: - if not targetst.sname in 'LIBRARY', 'BINARY', 'PYTHON', 'SUBSYSTEM': + if not targetst.sname in 'LIBRARY', 'PLUGIN', 'BINARY', 'PYTHON', 'SUBSYSTEM', 'BUILTIN': continue debug('deps: final dependencies for target %s: uselib=%s uselib_local=%s add_objects=%s', t.sname, t.uselib, getattr(t, 'uselib_local', ), getattr(t, 'add_objects', )) @@ -376,6 +375,58 @@ t.samba_includes_extended = TO_LIST(t.samba_includes): t.cflags = getattr(t, 'samba_cflags', '') +def replace_builtin_subsystem_deps(bld, tgt_list): + '''replace dependencies based on builtin subsystems/libraries + + ''' + + targets = LOCAL_CACHE(bld, 'TARGET_TYPE') + + # If either the target or the dependency require builtin linking + # we should replace the dependency + for t in tgt_list: + t_require_builtin_deps = getattr(t, 'samba_require_builtin_deps', False) + if t_require_builtin_deps: + debug("deps: target %s: requires builtin dependencies..." % (t.sname)) + else: + debug("deps: target %s: does not require builtin dependencies..." % (t.sname)) + + replacing = {} + + for dep in t.samba_deps_extended: + bld.ASSERT(dep in targets, "target %s: dependency target %s not declared" % (t.sname, dep)) + dtype = targetsdep + bld.ASSERT(dtype != 'BUILTIN', "target %s: dependency target %s is BUILTIN" % (t.sname, dep)) + bld.ASSERT(dtype != 'PLUGIN', "target %s: dependency target %s is PLUGIN" % (t.sname, dep)) + if dtype not in 'SUBSYSTEM', 'LIBRARY': + debug("deps: target %s: keep %s dependency %s" % (t.sname, dtype, dep)) + continue + dt = bld.get_tgen_by_name(dep) + bld.ASSERT(dt is not None, "target %s: dependency target %s not found by name" % (t.sname, dep)) + dt_require_builtin_deps = getattr(dt, 'samba_require_builtin_deps', False) + if not dt_require_builtin_deps and not t_require_builtin_deps: + # both target and dependency don't require builtin linking + continue + sdt = getattr(dt, 'samba_builtin_subsystem', None) + if not t_require_builtin_deps: + if sdt is None: + debug("deps: target %s: dependency %s requires builtin deps only" % (t.sname, dep)) + continue + debug("deps: target %s: dependency %s requires builtin linking" % (t.sname, dep)) + bld.ASSERT(sdt is not None, "target %s: dependency target %s is missing samba_builtin_subsystem" % (t.sname, dep)) + sdep = sdt.sname + bld.ASSERT(sdep in targets, "target %s: builtin dependency target %s (from %s) not declared" % (t.sname, sdep, dep)) + sdt = targetssdep + bld.ASSERT(sdt == 'BUILTIN', "target %s: builtin dependency target %s (from %s) is not BUILTIN" % (t.sname, sdep, dep)) + replacingdep = sdep + + for i in range(len(t.samba_deps_extended)): + dep = t.samba_deps_extendedi + if dep in replacing: + sdep = replacingdep + debug("deps: target %s: replacing dependency %s with builtin subsystem %s" % (t.sname, dep, sdep)) + t.samba_deps_extendedi = sdep + def replace_grouping_libraries(bld, tgt_list): '''replace dependencies based on grouping libraries @@ -446,7 +497,12 @@ t.direct_syslibs.add(d) if d in syslib_deps: for implied in TO_LIST(syslib_depsd): - if BUILTIN_LIBRARY(bld, implied): + if targetsimplied == 'SUBSYSTEM': + it = bld.get_tgen_by_name(implied) + sit = getattr(it, 'samba_builtin_subsystem', None) + if sit: + implied = sit.sname + if targetsimplied == 'BUILTIN': t.direct_objects.add(implied) elif targetsimplied == 'SYSLIB': t.direct_syslibs.add(implied) @@ -463,8 +519,13 @@ sys.exit(1) if t2.samba_type in 'LIBRARY', 'MODULE' : t.direct_libs.add(d) - elif t2.samba_type in 'SUBSYSTEM', 'ASN1', 'PYTHON' : + elif t2.samba_type in 'SUBSYSTEM', 'BUILTIN', 'ASN1', 'PYTHON' : t.direct_objects.add(d) + elif t2.samba_type in 'PLUGIN' : + Logs.error('Implicit dependency %s in %s is of type %s' % ( + d, t.sname, t2.samba_type)) + sys.exit(1) + debug('deps: built direct dependencies') @@ -654,10 +715,10 @@ # expand indirect subsystem and library loops for loop in loops.copy(): t = bld.get_tgen_by_name(loop) - if t.samba_type in 'SUBSYSTEM': + if t.samba_type in 'SUBSYSTEM', 'BUILTIN': loopsloop = loopsloop.union(t.indirect_objects) loopsloop = loopsloop.union(t.direct_objects) - if t.samba_type in 'LIBRARY','PYTHON': + if t.samba_type in 'LIBRARY', 'PLUGIN', 'PYTHON': loopsloop = loopsloop.union(t.indirect_libs) loopsloop = loopsloop.union(t.direct_libs) if loop in loopsloop: @@ -698,6 +759,8 @@ def reduce_objects(bld, tgt_list): '''reduce objects by looking for indirect object dependencies''' + targets = LOCAL_CACHE(bld, 'TARGET_TYPE') + rely_on = {} for t in tgt_list: @@ -705,7 +768,7 @@ changed = False - for type in 'BINARY', 'PYTHON', 'LIBRARY': + for type in 'BINARY', 'PYTHON', 'LIBRARY', 'PLUGIN': for t in tgt_list: if t.samba_type != type: continue # if we will indirectly link to a target then we don't need it @@ -718,8 +781,13 @@ dup = dup.difference(rely_ont.sname) if dup: # Do not remove duplicates of BUILTINS - d = next(iter(dup)) - if BUILTIN_LIBRARY(bld, d): + for d in iter(dup.copy()): + dtype = targetsd + if dtype == 'BUILTIN': + debug('deps: BUILTIN SKIP: removing dups from %s of type %s: %s also in %s %s', + t.sname, t.samba_type, d, t2.samba_type, l) + dup.remove(d) + if len(dup) == 0: continue debug('deps: removing dups from %s of type %s: %s also in %s %s', @@ -729,6 +797,19 @@ if not l in rely_on: rely_onl = set() rely_onl = rely_onl.union(dup) + for n in iter(new.copy()): + # if we got the builtin version as well + # as the native one, we keep using the + # builtin one and remove the rest. + # Otherwise our check_duplicate_sources() + # checks would trigger! + if n.endswith('.builtin.objlist'): + unused = n.replace('.builtin.objlist', '.objlist') + if unused in new: + new.remove(unused) + unused = n.replace('.builtin.objlist', '')
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_dist.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_dist.py
Changed
@@ -109,7 +109,7 @@ """ repo = path while repo != "/": - if os.path.isdir(os.path.join(repo, ".git")): + if os.path.exists(os.path.join(repo, ".git")): ls_files_cmd = 'git', 'ls-files', '--full-name', os.path.relpath(path, repo) cwd = None
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_patterns.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_patterns.py
Changed
@@ -32,112 +32,142 @@ def write_build_options_header(fp): '''write preamble for build_options.c''' - fp.write("/*\n") - fp.write(" Unix SMB/CIFS implementation.\n") - fp.write(" Build Options for Samba Suite\n") - fp.write(" Copyright (C) Vance Lankhaar <vlankhaar@linux.ca> 2003\n") - fp.write(" Copyright (C) Andrew Bartlett <abartlet@samba.org> 2001\n") - fp.write("\n") - fp.write(" This program is free software; you can redistribute it and/or modify\n") - fp.write(" it under the terms of the GNU General Public License as published by\n") - fp.write(" the Free Software Foundation; either version 3 of the License, or\n") - fp.write(" (at your option) any later version.\n") - fp.write("\n") - fp.write(" This program is distributed in the hope that it will be useful,\n") - fp.write(" but WITHOUT ANY WARRANTY; without even the implied warranty of\n") - fp.write(" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n") - fp.write(" GNU General Public License for more details.\n") - fp.write("\n") - fp.write(" You should have received a copy of the GNU General Public License\n") - fp.write(" along with this program; if not, see <http://www.gnu.org/licenses/>.\n") - fp.write("*/\n") - fp.write("\n") - fp.write("#include \"includes.h\"\n") - fp.write("#include \"dynconfig/dynconfig.h\"\n") - fp.write("#include \"lib/cluster_support.h\"\n") - - fp.write("\n") - fp.write("static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);\n") - fp.write("void build_options(bool screen);\n") - fp.write("\n") - fp.write("\n") - fp.write("/****************************************************************************\n") - fp.write("helper function for build_options\n") - fp.write("****************************************************************************/\n") - fp.write("static int output(bool screen, const char *format, ...)\n") - fp.write("{\n") - fp.write(" char *ptr = NULL;\n") - fp.write(" int ret = 0;\n") - fp.write(" va_list ap;\n") - fp.write(" \n") - fp.write(" va_start(ap, format);\n") - fp.write(" ret = vasprintf(&ptr,format,ap);\n") - fp.write(" va_end(ap);\n") - fp.write("\n") - fp.write(" if (screen) {\n") - fp.write(" d_printf(\"%s\", ptr ? ptr : \"\");\n") - fp.write(" } else {\n") - fp.write(" DEBUG(4,(\"%s\", ptr ? ptr : \"\"));\n") - fp.write(" }\n") - fp.write(" \n") - fp.write(" SAFE_FREE(ptr);\n") - fp.write(" return ret;\n") - fp.write("}\n") - fp.write("\n") - fp.write("/****************************************************************************\n") - fp.write("options set at build time for the samba suite\n") - fp.write("****************************************************************************/\n") - fp.write("void build_options(bool screen)\n") - fp.write("{\n") - fp.write(" if ((DEBUGLEVEL < 4) && (!screen)) {\n") - fp.write(" return;\n") - fp.write(" }\n") - fp.write("\n") - fp.write("\n") - fp.write(" /* Output various paths to files and directories */\n") - fp.write(" output(screen,\"\\nPaths:\\n\");\n") - fp.write(" output(screen,\" SBINDIR: %s\\n\", get_dyn_SBINDIR());\n") - fp.write(" output(screen,\" BINDIR: %s\\n\", get_dyn_BINDIR());\n") - fp.write(" output(screen,\" CONFIGFILE: %s\\n\", get_dyn_CONFIGFILE());\n") - fp.write(" output(screen,\" LOGFILEBASE: %s\\n\", get_dyn_LOGFILEBASE());\n") - fp.write(" output(screen,\" LMHOSTSFILE: %s\\n\",get_dyn_LMHOSTSFILE());\n") - fp.write(" output(screen,\" LIBDIR: %s\\n\",get_dyn_LIBDIR());\n") - fp.write(" output(screen,\" DATADIR: %s\\n\",get_dyn_DATADIR());\n") - fp.write(" output(screen,\" SAMBA_DATADIR: %s\\n\",get_dyn_SAMBA_DATADIR());\n") - fp.write(" output(screen,\" MODULESDIR: %s\\n\",get_dyn_MODULESDIR());\n") - fp.write(" output(screen,\" SHLIBEXT: %s\\n\",get_dyn_SHLIBEXT());\n") - fp.write(" output(screen,\" LOCKDIR: %s\\n\",get_dyn_LOCKDIR());\n") - fp.write(" output(screen,\" STATEDIR: %s\\n\",get_dyn_STATEDIR());\n") - fp.write(" output(screen,\" CACHEDIR: %s\\n\",get_dyn_CACHEDIR());\n") - fp.write(" output(screen,\" PIDDIR: %s\\n\", get_dyn_PIDDIR());\n") - fp.write(" output(screen,\" SMB_PASSWD_FILE: %s\\n\",get_dyn_SMB_PASSWD_FILE());\n") - fp.write(" output(screen,\" PRIVATE_DIR: %s\\n\",get_dyn_PRIVATE_DIR());\n") - fp.write(" output(screen,\" BINDDNS_DIR: %s\\n\",get_dyn_BINDDNS_DIR());\n") - fp.write("\n") + fp.write("/*\n" + " Unix SMB/CIFS implementation.\n" + " Build Options for Samba Suite\n" + " Copyright (C) Vance Lankhaar <vlankhaar@linux.ca> 2003\n" + " Copyright (C) Andrew Bartlett <abartlet@samba.org> 2001\n" + "\n" + " This program is free software; you can redistribute it and/or modify\n" + " it under the terms of the GNU General Public License as published by\n" + " the Free Software Foundation; either version 3 of the License, or\n" + " (at your option) any later version.\n" + "\n" + " This program is distributed in the hope that it will be useful,\n" + " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + " GNU General Public License for more details.\n" + "\n" + " You should have received a copy of the GNU General Public License\n" + " along with this program; if not, see <http://www.gnu.org/licenses/>.\n" + "*/\n" + "\n" + "#include \"includes.h\"\n" + "#include \"dynconfig/dynconfig.h\"\n" + "#include \"lib/cluster_support.h\"\n" + + "\n" + "static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);\n" + "void build_options(bool screen);\n" + "\n" + "\n" + "/****************************************************************************\n" + "helper function for build_options\n" + "****************************************************************************/\n" + "static int output(bool screen, const char *format, ...)\n" + "{\n" + " char *ptr = NULL;\n" + " int ret = 0;\n" + " va_list ap;\n" + " \n" + " va_start(ap, format);\n" + " ret = vasprintf(&ptr,format,ap);\n" + " va_end(ap);\n" + "\n" + " if (screen) {\n" + " d_printf(\"%s\", ptr ? ptr : \"\");\n" + " } else {\n" + " DEBUG(4,(\"%s\", ptr ? ptr : \"\"));\n" + " }\n" + " \n" + " SAFE_FREE(ptr);\n" + " return ret;\n" + "}\n" + "\n" + "/****************************************************************************\n" + "options set at build time for the samba suite\n" + "****************************************************************************/\n" + "void build_options(bool screen)\n" + "{\n" + " if ((DEBUGLEVEL < 4) && (!screen)) {\n" + " return;\n" + " }\n" + "\n" + "\n" + " /* Output various paths to files and directories */\n" + " output(screen,\"\\nPaths:\\n\"\n" + " \" SBINDIR: %s\\n\"\n" + " \" BINDIR: %s\\n\"\n" + " \" CONFIGFILE: %s\\n\"\n" + " \" LOGFILEBASE: %s\\n\"\n" + " \" LMHOSTSFILE: %s\\n\"\n" + " \" LIBDIR: %s\\n\"\n" + " \" DATADIR: %s\\n\"\n" + " \" SAMBA_DATADIR: %s\\n\"\n" + " \" MODULESDIR: %s\\n\"\n" + " \" SHLIBEXT: %s\\n\"\n" + " \" LOCKDIR: %s\\n\"\n" + " \" STATEDIR: %s\\n\"\n" + " \" CACHEDIR: %s\\n\"\n" + " \" PIDDIR: %s\\n\"\n" + " \" SMB_PASSWD_FILE: %s\\n\"\n" + " \" PRIVATE_DIR: %s\\n\"\n" + " \" BINDDNS_DIR: %s\\n\",\n" + " get_dyn_SBINDIR(),\n" + " get_dyn_BINDIR(),\n" + " get_dyn_CONFIGFILE(),\n" + " get_dyn_LOGFILEBASE(),\n" + " get_dyn_LMHOSTSFILE(),\n" + " get_dyn_LIBDIR(),\n" + " get_dyn_DATADIR(),\n" + " get_dyn_SAMBA_DATADIR(),\n" + " get_dyn_MODULESDIR(),\n" + " get_dyn_SHLIBEXT(),\n" + " get_dyn_LOCKDIR(),\n" + " get_dyn_STATEDIR(),\n" + " get_dyn_CACHEDIR(),\n" + " get_dyn_PIDDIR(),\n" + " get_dyn_SMB_PASSWD_FILE(),\n" + " get_dyn_PRIVATE_DIR(),\n" + " get_dyn_BINDDNS_DIR());\n" + "\n") def write_build_options_footer(fp): - fp.write(" /* Output the sizes of the various cluster features */\n") - fp.write(" output(screen, \"\\n%s\", cluster_support_features());\n") - fp.write("\n") - fp.write(" /* Output the sizes of the various types */\n") - fp.write(" output(screen, \"\\nType sizes:\\n\");\n") - fp.write(" output(screen, \" sizeof(char): %lu\\n\",(unsigned long)sizeof(char));\n") - fp.write(" output(screen, \" sizeof(int): %lu\\n\",(unsigned long)sizeof(int));\n") - fp.write(" output(screen, \" sizeof(long): %lu\\n\",(unsigned long)sizeof(long));\n") - fp.write(" output(screen, \" sizeof(long long): %lu\\n\",(unsigned long)sizeof(long long));\n") - fp.write(" output(screen, \" sizeof(uint8_t): %lu\\n\",(unsigned long)sizeof(uint8_t));\n") - fp.write(" output(screen, \" sizeof(uint16_t): %lu\\n\",(unsigned long)sizeof(uint16_t));\n") - fp.write(" output(screen, \" sizeof(uint32_t): %lu\\n\",(unsigned long)sizeof(uint32_t));\n") - fp.write(" output(screen, \" sizeof(short): %lu\\n\",(unsigned long)sizeof(short));\n")
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_perl.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_perl.py
Changed
@@ -28,7 +28,6 @@ return v except IndexError: conf.end_msg(False, 'YELLOW') - pass return None vendor_prefix = check_perl_config_var('vendorprefix')
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_python.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_python.py
Changed
@@ -7,9 +7,6 @@ @conf def SAMBA_CHECK_PYTHON(conf, version=(3,6,0)): - if conf.env.enable_fuzzing: - version=(3,5,0) - # enable tool to build python extensions if conf.env.HAVE_PYTHON_H: conf.check_python_version(version)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_third_party.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_third_party.py
Changed
@@ -44,5 +44,5 @@ @conf def CHECK_PAM_WRAPPER(conf): - return conf.CHECK_BUNDLED_SYSTEM_PKG('pam_wrapper', minversion='1.1.2') + return conf.CHECK_BUNDLED_SYSTEM_PKG('pam_wrapper', minversion='1.1.4') Build.BuildContext.CHECK_PAM_WRAPPER = CHECK_PAM_WRAPPER
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/samba_utils.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/samba_utils.py
Changed
@@ -465,8 +465,7 @@ 'CleanContext', 'InstallContext', 'UninstallContext', - 'ListContext', - 'ClangDbContext': + 'ListContext': return ctx.recurse(relpath) if 'waflib.extras.compat15' in sys.modules: return ctx.recurse(relpath) @@ -658,7 +657,7 @@ tgt_list = for tgt in targets: type = targetstgt - if not type in 'SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON': + if not type in 'SUBSYSTEM', 'BUILTIN', 'MODULE', 'BINARY', 'LIBRARY', 'PLUGIN', 'ASN1', 'PYTHON': continue t = bld.get_tgen_by_name(tgt) if t is None:
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/stale_files.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/stale_files.py
Changed
@@ -69,7 +69,7 @@ objpath = os.path.normpath(output.abspath(bld.env)) expected.append(objpath) for t in tlist: - if ttype in 'LIBRARY','MODULE': + if ttype in 'LIBRARY', 'PLUGIN', 'MODULE': t = samba_utils.apply_pattern(t, bld.env.shlib_PATTERN) if ttype == 'PYTHON': t = samba_utils.apply_pattern(t, bld.env.pyext_PATTERN)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/symbols.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/symbols.py
Changed
@@ -252,7 +252,7 @@ bld.env.public_symbolsname = bld.env.public_symbolsname.union(t.public_symbols) else: bld.env.public_symbolsname = t.public_symbols - if t.samba_type == 'LIBRARY': + if t.samba_type in 'LIBRARY', 'PLUGIN': for dep in t.add_objects: t2 = bld.get_tgen_by_name(dep) bld.ASSERT(t2 is not None, "Library '%s' has unknown dependency '%s'" % (name, dep)) @@ -265,7 +265,7 @@ bld.env.used_symbolsname = bld.env.used_symbolsname.union(t.used_symbols) else: bld.env.used_symbolsname = t.used_symbols - if t.samba_type == 'LIBRARY': + if t.samba_type in 'LIBRARY', 'PLUGIN': for dep in t.add_objects: t2 = bld.get_tgen_by_name(dep) bld.ASSERT(t2 is not None, "Library '%s' has unknown dependency '%s'" % (name, dep)) @@ -281,7 +281,7 @@ bld.env.library_dict = {} for t in tgt_list: - if t.samba_type in 'LIBRARY', 'PYTHON' : + if t.samba_type in 'LIBRARY', 'PLUGIN', 'PYTHON' : linkpath = os.path.realpath(t.link_task.outputs0.abspath(bld.env)) bld.env.library_dictlinkpath = t.sname @@ -296,7 +296,7 @@ syslibs = {} objmap = {} for t in tgt_list: - if getattr(t, 'uselib', ) and t.samba_type in 'LIBRARY', 'BINARY', 'PYTHON' : + if getattr(t, 'uselib', ) and t.samba_type in 'LIBRARY', 'PLUGIN', 'BINARY', 'PYTHON' : for lib in t.uselib: if lib in 'PYEMBED', 'PYEXT': lib = "python" @@ -386,10 +386,10 @@ t.in_library = for t in tgt_list: - if t.samba_type in 'LIBRARY' : + if t.samba_type in 'LIBRARY', 'PLUGIN': for obj in t.samba_deps_extended: t2 = bld.get_tgen_by_name(obj) - if t2 and t2.samba_type in 'SUBSYSTEM', 'ASN1' : + if t2 and t2.samba_type in 'SUBSYSTEM', 'BUILTIN', 'ASN1' : if not t.sname in t2.in_library: t2.in_library.append(t.sname) bld.env.done_build_library_names = True
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/test_duplicate_symbol.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/test_duplicate_symbol.sh
Changed
@@ -5,6 +5,9 @@ subunit_start_test duplicate_symbols +PYTHONHASHSEED=1 +export PYTHONHASHSEED + if $PYTHON ./buildtools/bin/waf build --dup-symbol-check; then subunit_pass_test duplicate_symbols else
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/wafsamba.py -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/wafsamba.py
Changed
@@ -38,7 +38,7 @@ os.environ'PYTHONUNBUFFERED' = '1' -if Context.HEXVERSION not in (0x2001500,): +if Context.HEXVERSION not in (0x2001800,): Logs.error(''' Please use the version of waf that comes with Samba, not a system installed version. See http://wiki.samba.org/index.php/Waf @@ -55,11 +55,12 @@ mkdir_p(os.path.join(conf.env.BUILD_DIRECTORY, LIB_PATH)) mkdir_p(os.path.join(conf.env.BUILD_DIRECTORY, LIB_PATH, "private")) mkdir_p(os.path.join(conf.env.BUILD_DIRECTORY, "modules")) + mkdir_p(os.path.join(conf.env.BUILD_DIRECTORY, "plugins")) mkdir_p(os.path.join(conf.env.BUILD_DIRECTORY, 'python/samba/dcerpc')) # this allows all of the bin/shared and bin/python targets # to be expressed in terms of build directory paths mkdir_p(os.path.join(conf.env.BUILD_DIRECTORY, 'default')) - for (source, target) in ('shared', 'shared'), ('modules', 'modules'), ('python', 'python'): + for (source, target) in ('shared', 'shared'), ('modules', 'modules'), ('plugins', 'plugins'), ('python', 'python'): link_target = os.path.join(conf.env.BUILD_DIRECTORY, 'default/' + target) if not os.path.lexists(link_target): symlink('../' + source, link_target) @@ -122,25 +123,56 @@ pyembed=False, pyext=False, target_type='LIBRARY', - bundled_extension=False, bundled_name=None, link_name=None, abi_directory=None, abi_match=None, + orig_vscript_map=None, hide_symbols=False, manpages=None, private_library=False, grouping_library=False, + require_builtin_deps=False, + provide_builtin_linking=False, + builtin_cflags='', allow_undefined_symbols=False, allow_warnings=False, enabled=True): '''define a Samba library''' + # We support: + # - LIBRARY: this can be use to link via -llibname + # - MODULE: this is module from SAMBA_MODULE() + # - PLUGIN: this is plugin for external consumers to be + # loaded via dlopen() + # - PYTHON: a python C binding library + # + if target_type not in 'LIBRARY', 'MODULE', 'PLUGIN', 'PYTHON': + raise Errors.WafError("target_type%s not supported in SAMBA_LIBRARY('%s')" % + (target_type, libname)) + + if require_builtin_deps: + # For now we only support require_builtin_deps only for libraries, plugins + if target_type not in 'LIBRARY', 'PLUGIN': + raise Errors.WafError("target_type%s not supported SAMBA_LIBRARY('%s', require_builtin_deps=True)" % + (target_type, libname)) + if private_library and public_headers: raise Errors.WafError("private library '%s' must not have public header files" % libname) - if LIB_MUST_BE_PRIVATE(bld, libname): + if orig_vscript_map and not private_library: + raise Errors.WafError("public library '%s' must not have orig_vscript_map" % + libname) + + if orig_vscript_map and abi_directory: + raise Errors.WafError("private library '%s' with orig_vscript_map must not have abi_directory" % + libname) + if orig_vscript_map and abi_match: + raise Errors.WafError("private library '%s' with orig_vscript_map must not have abi_match" % + libname) + + if LIB_MUST_BE_PRIVATE(bld, libname) and target_type not in 'PLUGIN': private_library = True if not enabled: @@ -162,10 +194,26 @@ target=empty_c) source=empty_c + samba_deps = deps + ' ' + public_deps + samba_deps = TO_LIST(samba_deps) + if BUILTIN_LIBRARY(bld, libname): - obj_target = libname + builtin_target = libname + '.builtin.objlist' + builtin_cflags_end = '-D_PUBLIC_=_PRIVATE_' + empty_target = libname + obj_target = None else: + if provide_builtin_linking: + builtin_target = libname + '.builtin.objlist' + builtin_cflags_end = '-D_PUBLIC_=_PRIVATE_' + else: + builtin_target = None + empty_target = None obj_target = libname + '.objlist' + if require_builtin_deps: + # hide the builtin deps from the callers + samba_deps = TO_LIST('') + dep_target = obj_target if group == 'libraries': subsystem_group = 'main' @@ -175,27 +223,51 @@ # first create a target for building the object files for this library # by separating in this way, we avoid recompiling the C files # separately for the install library and the build library - bld.SAMBA_SUBSYSTEM(obj_target, - source = source, - deps = deps, - public_deps = public_deps, - includes = includes, - public_headers = public_headers, - public_headers_install = public_headers_install, - private_headers= private_headers, - header_path = header_path, - cflags = cflags, - cflags_end = cflags_end, - group = subsystem_group, - autoproto = autoproto, - autoproto_extra_source=autoproto_extra_source, - depends_on = depends_on, - hide_symbols = hide_symbols, - allow_warnings = allow_warnings, - pyembed = pyembed, - pyext = pyext, - local_include = local_include, - global_include = global_include) + if builtin_target: + __t = __SAMBA_SUBSYSTEM_BUILTIN(bld, builtin_target, source, + deps=deps, + public_deps=public_deps, + includes=includes, + header_path=header_path, + builtin_cflags=builtin_cflags, + builtin_cflags_end=builtin_cflags_end, + group=group, + depends_on=depends_on, + local_include=local_include, + global_include=global_include, + allow_warnings=allow_warnings) + builtin_subsystem = __t + else: + builtin_subsystem = None + if obj_target: + bld.SAMBA_SUBSYSTEM(obj_target, + source = source, + deps = deps, + public_deps = public_deps, + includes = includes, + public_headers = public_headers, + public_headers_install = public_headers_install, + private_headers= private_headers, + header_path = header_path, + cflags = cflags, + cflags_end = cflags_end, + group = subsystem_group, + autoproto = autoproto, + autoproto_extra_source=autoproto_extra_source, + depends_on = depends_on, + hide_symbols = hide_symbols, + allow_warnings = allow_warnings, + pyembed = pyembed, + pyext = pyext, + local_include = local_include, + __require_builtin_deps=require_builtin_deps, + global_include = global_include) + else: + et = bld.SAMBA_SUBSYSTEM(empty_target, + source=, + __force_empty=True, + __require_builtin_deps=True) + et.samba_builtin_subsystem = builtin_subsystem if BUILTIN_LIBRARY(bld, libname): return @@ -204,9 +276,7 @@ return # the library itself will depend on that object target - deps += ' ' + public_deps - deps = TO_LIST(deps) - deps.append(obj_target) + samba_deps.append(dep_target) realname = bld.map_shlib_extension(realname, python=(target_type=='PYTHON')) link_name = bld.map_shlib_extension(link_name, python=(target_type=='PYTHON')) @@ -223,6 +293,8 @@ raise Errors.WafError("public library '%s' must have header files" % libname) + abi_vnum = vnum +
View file
_service:tar_scm:tdb-1.4.5.tar.gz/buildtools/wafsamba/wscript -> _service:tar_scm:tdb-1.4.7.tar.gz/buildtools/wafsamba/wscript
Changed
@@ -8,6 +8,10 @@ from samba_utils import symlink from optparse import SUPPRESS_HELP +phs = os.environ.get("PYTHONHASHSEED", None) +if phs != "1": + raise Errors.WafError('''PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!''') + # this forces configure to be re-run if any of the configure # sections of the build scripts change. We have to check # for this in sys.argv as options have not yet been parsed when @@ -30,11 +34,37 @@ gr = opt.option_group('library handling options') gr.add_option('--bundled-libraries', - help=("comma separated list of bundled libraries. May include !LIBNAME to disable bundling a library. Can be 'NONE' or 'ALL' auto"), + help=(f'''comma separated list of bundled libraries. + +{Context.g_module.APPNAME} includes copies of externally maintained +system libraries (such as popt, cmokca) as well as Samba-maintained +libraries that can be found on the system already (such as talloc, +tdb). + +This option, most useful for packagers, controls if each library +should be forced to be obtained from inside Samba (bundled), forced to +be obtained from the system (bundling disabled, ensuing that +dependency errors are not silently missed) or if that choice should be +automatic (best for end users). + +May include !LIBNAME to disable bundling a library. + +Can be 'NONE' or 'ALL' auto'''), action="store", dest='BUNDLED_LIBS', default='') gr.add_option('--private-libraries', - help=("comma separated list of normally public libraries to build instead as private libraries. May include !LIBNAME to disable making a library private. Can be 'NONE' or 'ALL' auto"), + help=(f'''comma separated list of normally public libraries to build instead as private libraries. + +By default {Context.g_module.APPNAME} will publish a number of public +libraries for use by other software. For Samba this would include +libwbclient, libsmbclient and others. + +This allows that to be disabled, to ensure that other software does +not use these libraries and they are placed in a private filesystem +prefix. + +May include !LIBNAME to disable making a library private in order to +limit the effect of 'ALL' '''), action="store", dest='PRIVATE_LIBS', default='') extension_default = default_value('PRIVATE_EXTENSION_DEFAULT') @@ -48,12 +78,33 @@ action="store", dest='PRIVATE_EXTENSION_EXCEPTION', default=extension_exception) builtin_default = default_value('BUILTIN_LIBRARIES_DEFAULT') - gr.add_option('--builtin-libraries', - help=("command separated list of libraries to build directly into binaries %s" % builtin_default), - action="store", dest='BUILTIN_LIBRARIES', default=builtin_default) + gr.add_option('--builtin-libraries', help=( +f'''comma separated list of libraries to build directly into binaries. + +By default {Context.g_module.APPNAME} will build a large number of +shared libraries, to reduce binary size. This overrides this +behaviour and essentially statically links the specified libraries into +each binary {builtin_default}'''), + action="store", + dest='BUILTIN_LIBRARIES', default=builtin_default) gr.add_option('--minimum-library-version', - help=("list of minimum system library versions (LIBNAME1:version,LIBNAME2:version)"), + help=( +f'''list of minimum system library versions for otherwise bundled +libraries. + +{Context.g_module.APPNAME} by default requires that, in order to match +what is tested in our continuous integration (CI) test-suite, that the +versions of libraries that we include match that found on the system, +before we will select not to 'bundle'. + +This option, possibly useful for packagers, allows that specified +version to be overridden (say, if it is absolutely known that a the +newer version included in this tarball has no relevant changes). + +Use this with extreme care + +(LIBNAME1:version,LIBNAME2:version)'''), action="store", dest='MINIMUM_LIBRARY_VERSION', default='') gr.add_option('--disable-rpath', @@ -66,7 +117,13 @@ help=("Disable use of rpath for private library path in installed files"), action="store_true", dest='disable_rpath_private_install', default=False) gr.add_option('--nonshared-binary', - help=("Disable use of shared libs for the listed binaries"), + help=( +f'''Disable use of shared libaries internal to {Context.g_module.APPNAME} for the listed binaries. + +The resulting binaries are 'statically linked' with regard to components provided by +{Context.g_module.APPNAME}, but remain dynamically linked to (eg) libc.so and libgnutls.so + +Currently the only tested value is 'smbtorture,smbd/smbd' for Samba'''), action="store", dest='NONSHARED_BINARIES', default='') gr.add_option('--disable-symbol-versions', help=("Disable use of the --version-script linker option"), @@ -132,9 +189,6 @@ action="store_true", dest='undefined_sanitizer', default=False) - gr.add_option('--enable-clangdb', - help=("Enable use of clang_compilation_database"), - action="store_true", dest='enable_clangdb', default=False) gr.add_option('--enable-libfuzzer', help=("Build fuzzing binaries (use ADDITIONAL_CFLAGS to specify compiler options for libFuzzer or use CC=honggfuzz/hfuzz-cc)"), action="store_true", dest='enable_libfuzzer', default=False) @@ -272,6 +326,8 @@ conf.env.PRIVATE_EXTENSION = Options.options.PRIVATE_EXTENSION conf.env.PRIVATE_EXTENSION_EXCEPTION = Options.options.PRIVATE_EXTENSION_EXCEPTION.split(',') + conf.env.PRIVATE_VERSION = "%s_%s_%s" % (Context.g_module.APPNAME, + Context.g_module.VERSION, conf.env.PRIVATE_EXTENSION) conf.env.CROSS_COMPILE = Options.options.CROSS_COMPILE conf.env.CROSS_EXECUTE = Options.options.CROSS_EXECUTE @@ -542,7 +598,10 @@ conf.CHECK_HEADERS('strings.h inttypes.h stdint.h unistd.h minix/config.h', add_headers=True) conf.CHECK_HEADERS('ctype.h', add_headers=True) - if sys.platform != 'darwin': + if sys.platform == 'darwin': + conf.DEFINE('_DARWIN_C_SOURCE', 1, add_to_cflags=True) + conf.DEFINE('_DARWIN_UNLIMITED_GETGROUPS', 1, add_to_cflags=True) + else: conf.CHECK_HEADERS('standards.h', add_headers=True) conf.CHECK_HEADERS('stdbool.h stdint.h stdarg.h vararg.h', add_headers=True) @@ -660,13 +719,10 @@ conf.DEFINE('FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION', 1) conf.env.FUZZ_TARGET_LDFLAGS = Options.options.FUZZ_TARGET_LDFLAGS - conf.env.enable_clangdb = Options.options.enable_clangdb - if conf.env.enable_clangdb: - conf.load('clang_compilation_database') - # Create a symlink of the compile db for clangd - symlink(os.path.join(conf.bldnode.abspath(), 'default/compile_commands.json'), - os.path.join(conf.srcnode.abspath(), 'compile_commands.json'), - force=True) + # Create a symlink of the compile db for clangd + symlink(os.path.join(conf.bldnode.abspath(), 'default/compile_commands.json'), + os.path.join(conf.srcnode.abspath(), 'compile_commands.json'), + force=True) conf.SAMBA_BUILD_ENV()
View file
_service:tar_scm:tdb-1.4.5.tar.gz/common/tdb.c -> _service:tar_scm:tdb-1.4.7.tar.gz/common/tdb.c
Changed
@@ -64,6 +64,15 @@ return; } +#if defined(HAVE___ATOMIC_ADD_FETCH) && defined(HAVE___ATOMIC_ADD_LOAD) + if (tdb->map_ptr != NULL) { + uint32_t *pseqnum = (uint32_t *)( + TDB_SEQNUM_OFS + (char *)tdb->map_ptr); + __atomic_add_fetch(pseqnum, 1, __ATOMIC_SEQ_CST); + return; + } +#endif + if (tdb_nest_lock(tdb, TDB_SEQNUM_OFS, F_WRLCK, TDB_LOCK_WAIT|TDB_LOCK_PROBE) != 0) { return; @@ -838,6 +847,21 @@ { tdb_off_t seqnum=0; + if (tdb->transaction != NULL) { + tdb_ofs_read(tdb, TDB_SEQNUM_OFS, &seqnum); + return seqnum; + } + +#if defined(HAVE___ATOMIC_ADD_FETCH) && defined(HAVE___ATOMIC_ADD_LOAD) + if (tdb->map_ptr != NULL) { + uint32_t *pseqnum = (uint32_t *)( + TDB_SEQNUM_OFS + (char *)tdb->map_ptr); + uint32_t ret; + __atomic_load(pseqnum, &ret,__ATOMIC_SEQ_CST); + return ret; + } +#endif + tdb_ofs_read(tdb, TDB_SEQNUM_OFS, &seqnum); return seqnum; }
View file
_service:tar_scm:tdb-1.4.5.tar.gz/configure -> _service:tar_scm:tdb-1.4.7.tar.gz/configure
Changed
@@ -1,6 +1,6 @@ #!/bin/sh -PREVPATH=`dirname $0` +PREVPATH=$(dirname $0) if -f $PREVPATH/../../buildtools/bin/waf ; then WAF=../../buildtools/bin/waf @@ -16,6 +16,13 @@ JOBS=1 export JOBS +# Make sure we don't have any library preloaded. +unset LD_PRELOAD + +# Make sure we get stable hashes +PYTHONHASHSEED=1 +export PYTHONHASHSEED + cd . || exit 1 $PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/configure -> _service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/configure
Changed
@@ -1,6 +1,6 @@ #!/bin/sh -PREVPATH=`dirname $0` +PREVPATH=$(dirname $0) if -f $PREVPATH/../../buildtools/bin/waf ; then WAF=../../buildtools/bin/waf @@ -16,6 +16,13 @@ JOBS=1 export JOBS +# Make sure we don't have any library preloaded. +unset LD_PRELOAD + +# Make sure we get stable hashes +PYTHONHASHSEED=1 +export PYTHONHASHSEED + cd . || exit 1 $PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/replace.h -> _service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/replace.h
Changed
@@ -703,7 +703,7 @@ #ifdef HAVE__Bool #define bool _Bool #else -typedef int bool; +#error Need a real boolean type #endif #endif @@ -982,10 +982,59 @@ # endif /* HAVE_FALLTHROUGH_ATTRIBUTE */ #endif /* FALL_THROUGH */ -bool nss_wrapper_enabled(void); -bool nss_wrapper_hosts_enabled(void); -bool socket_wrapper_enabled(void); -bool uid_wrapper_enabled(void); +struct __rep_cwrap_enabled_state { + const char *fnname; + bool cached; + bool retval; +}; + +static inline bool __rep_cwrap_enabled_fn(struct __rep_cwrap_enabled_state *state) +{ + bool (*__wrapper_enabled_fn)(void) = NULL; + + if (state->cached) { + return state->retval; + } + state->retval = false; + state->cached = true; + + __wrapper_enabled_fn = (bool (*)(void))dlsym(RTLD_DEFAULT, state->fnname); + if (__wrapper_enabled_fn == NULL) { + return state->retval; + } + + state->retval = __wrapper_enabled_fn(); + return state->retval; +} + +static inline bool nss_wrapper_enabled(void) +{ + struct __rep_cwrap_enabled_state state = { + .fnname = "nss_wrapper_enabled", + }; + return __rep_cwrap_enabled_fn(&state); +} +static inline bool nss_wrapper_hosts_enabled(void) +{ + struct __rep_cwrap_enabled_state state = { + .fnname = "nss_wrapper_hosts_enabled", + }; + return __rep_cwrap_enabled_fn(&state); +} +static inline bool socket_wrapper_enabled(void) +{ + struct __rep_cwrap_enabled_state state = { + .fnname = "socket_wrapper_enabled", + }; + return __rep_cwrap_enabled_fn(&state); +} +static inline bool uid_wrapper_enabled(void) +{ + struct __rep_cwrap_enabled_state state = { + .fnname = "uid_wrapper_enabled", + }; + return __rep_cwrap_enabled_fn(&state); +} static inline bool _hexcharval(char c, uint8_t *val) {
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/tests/os2_delete.c -> _service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/tests/os2_delete.c
Changed
@@ -66,8 +66,8 @@ char namesREADDIR_SIZE256; /* scan, remembering offsets */ - for (i=0, de=readdir(d); - de && i < READDIR_SIZE; + for (i=0, de=readdir(d); + de && i < READDIR_SIZE; de=readdir(d), i++) { offsetsi = telldir(d); /* strlcpy not available here */ @@ -106,7 +106,7 @@ d = opendir(TESTDIR "/test0.txt"); if (d != NULL) FAILED("opendir() on file succeed"); if (errno != ENOTDIR) FAILED("opendir() on file didn't give ENOTDIR"); - closedir(d); + if (d != NULL) closedir(d); d = opendir(TESTDIR);
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/tests/testsuite.c -> _service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/tests/testsuite.c
Changed
@@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. libreplace tests @@ -8,7 +8,7 @@ ** NOTE! The following LGPL license applies to the talloc ** library. This does NOT imply that all of Samba is released ** under the LGPL - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -127,7 +127,7 @@ return false; } if (strcmp(tmp, "bl") != 0) { - printf("failure: strlcat \nexpected \"bl\", got \"%s\"\n\n", + printf("failure: strlcat \nexpected \"bl\", got \"%s\"\n\n", tmp); return false; } @@ -179,7 +179,7 @@ free(x); printf("success: strdup\n"); return true; -} +} static int test_setlinebuf(void) { @@ -308,6 +308,8 @@ static int test_strnlen(void) { + char longlen20 = { 0 }; + printf("test: strnlen\n"); if (strnlen("bla", 2) != 2) { printf("failure: strnlen \nunexpected length\n\n"); @@ -319,7 +321,9 @@ return false; } - if (strnlen("some text", 20) != 9) { + memcpy(longlen, "some text", 10); + + if (strnlen(longlen, 20) != 9) { printf("failure: strnlen \nunexpected length\n\n"); return false; } @@ -774,7 +778,7 @@ return true; } -/* +/* FIXME: Types: bool
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/timegm.c -> _service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/timegm.c
Changed
@@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. *
View file
_service:tar_scm:tdb-1.4.5.tar.gz/lib/replace/wscript -> _service:tar_scm:tdb-1.4.7.tar.gz/lib/replace/wscript
Changed
@@ -153,8 +153,9 @@ msg='Checking for O_DIRECT flag to open(2)') conf.CHECK_TYPES('"long long" intptr_t uintptr_t ptrdiff_t comparison_fn_t') - conf.CHECK_TYPE('_Bool', define='HAVE__Bool') - conf.CHECK_TYPE('bool', define='HAVE_BOOL') + if not conf.CHECK_TYPE('bool', define='HAVE_BOOL'): + if not conf.CHECK_TYPE('_Bool', define='HAVE__Bool'): + raise Errors.WafError('Samba requires a genuine boolean type') conf.CHECK_TYPE('int8_t', 'char') conf.CHECK_TYPE('uint8_t', 'unsigned char') @@ -299,6 +300,13 @@ msg='Checking for __sync_fetch_and_add compiler builtin') conf.CHECK_CODE(''' + int i; + (void)__sync_add_and_fetch(&i, 1); + ''', + 'HAVE___SYNC_ADD_AND_FETCH', + msg='Checking for __sync_add_and_fetch compiler builtin') + + conf.CHECK_CODE(''' int32_t i; atomic_add_32(&i, 1); ''', @@ -306,6 +314,22 @@ headers='stdint.h sys/atomic.h', msg='Checking for atomic_add_32 compiler builtin') + conf.CHECK_CODE(''' + uint32_t i,j; + j = __atomic_add_fetch(&i,1,__ATOMIC_SEQ_CST) + ''', + 'HAVE___ATOMIC_ADD_FETCH', + headers='stdint.h', + msg='Checking for __atomic_add_fetch compiler builtin') + + conf.CHECK_CODE(''' + uint32_t i,j; + __atomic_load(&i,&j,__ATOMIC_SEQ_CST) + ''', + 'HAVE___ATOMIC_ADD_LOAD', + headers='stdint.h', + msg='Checking for __atomic_load compiler builtin') + # Check for thread fence. */ tf = conf.CHECK_CODE('atomic_thread_fence(memory_order_seq_cst);', 'HAVE_ATOMIC_THREAD_FENCE', @@ -456,14 +480,11 @@ conf.CHECK_FUNCS('getprogname') if not conf.CHECK_FUNCS('copy_file_range'): conf.CHECK_CODE(''' -#include <sys/syscall.h> -#include <unistd.h> syscall(SYS_copy_file_range,0,NULL,0,NULL,0,0); ''', 'HAVE_SYSCALL_COPY_FILE_RANGE', + headers='sys/syscall.h unistd.h', msg='Checking whether we have copy_file_range system call') - if conf.CONFIG_SET('HAVE_COPY_FILE_RANGE') or conf.CONFIG_SET('HAVE_SYSCALL_COPY_FILE_RANGE'): - conf.DEFINE('USE_COPY_FILE_RANGE', 1) conf.SET_TARGET_TYPE('attr', 'EMPTY') @@ -885,7 +906,6 @@ ) REPLACE_SOURCE = REPLACE_HOSTCC_SOURCE - REPLACE_SOURCE += ' cwrap.c' if not bld.CONFIG_SET('HAVE_DLOPEN'): REPLACE_SOURCE += ' dlfcn.c' if not bld.CONFIG_SET('HAVE_POLL'): REPLACE_SOURCE += ' poll.c' @@ -913,6 +933,7 @@ # at the moment: # hide_symbols=bld.BUILTIN_LIBRARY('replace'), private_library=True, + provide_builtin_linking=True, deps='dl attr' + extra_libs) replace_test_cflags = ''
View file
_service:tar_scm:tdb-1.4.5.tar.gz/pytdb.c -> _service:tar_scm:tdb-1.4.7.tar.gz/pytdb.c
Changed
@@ -577,7 +577,7 @@ { "add_flags", (PyCFunction)obj_add_flags, METH_VARARGS, "S.add_flags(flags) -> None" }, { "remove_flags", (PyCFunction)obj_remove_flags, METH_VARARGS, "S.remove_flags(flags) -> None" }, #if PY_MAJOR_VERSION >= 3 - { "keys", (PyCFunction)tdb_object_iter, METH_NOARGS, "S.iterkeys() -> iterator" }, + { "keys", (PyCFunction)tdb_object_iter, METH_NOARGS, "S.keys() -> iterator" }, #else { "iterkeys", (PyCFunction)tdb_object_iter, METH_NOARGS, "S.iterkeys() -> iterator" }, #endif
View file
_service:tar_scm:tdb-1.4.5.tar.gz/test/test_tdbbackup.sh -> _service:tar_scm:tdb-1.4.7.tar.gz/test/test_tdbbackup.sh
Changed
@@ -4,29 +4,32 @@ if $# -lt 1 ; then echo "Usage: $0 LDBFILE" - exit 1; + exit 1 fi LDBFILE=$1 -timestamp() { - date -u +'time: %Y-%m-%d %H:%M:%S.%6NZ' | sed 's/\..*NZ$/.000000Z/' +timestamp() +{ + date -u +'time: %Y-%m-%d %H:%M:%S.%6NZ' | sed 's/\..*NZ$/.000000Z/' } -subunit_fail_test () { - timestamp - printf 'failure: %s \n' "$1" - cat - - echo "" +subunit_fail_test() +{ + timestamp + printf 'failure: %s \n' "$1" + cat - + echo "" } -testit () { +testit() +{ name="$1" shift cmdline="$@" timestamp printf 'test: %s\n' "$1" - output=`$cmdline 2>&1` + output=$($cmdline 2>&1) status=$? if x$status = x0 ; then timestamp @@ -37,16 +40,16 @@ return $status } -$BINDIR/tdbdump $LDBFILE | sort > orig_dump +$BINDIR/tdbdump $LDBFILE | sort >orig_dump testit "normal tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak -$BINDIR/tdbdump $LDBFILE.bak | sort > bak_dump +$BINDIR/tdbdump $LDBFILE.bak | sort >bak_dump testit "cmp between tdbdumps of original and backup" cmp orig_dump bak_dump rm $LDBFILE.bak rm bak_dump testit "readonly tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak -r -$BINDIR/tdbdump $LDBFILE.bak | sort > bak_dump +$BINDIR/tdbdump $LDBFILE.bak | sort >bak_dump testit "cmp between tdbdumps of original and back dbs" cmp orig_dump bak_dump rm $LDBFILE.bak rm bak_dump
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/update.sh
Added
@@ -0,0 +1,81 @@ +#!/bin/bash + +if $# -lt 1 ; then + echo "Usage: update.sh VERSION" + exit 1 +fi + +WAF_VERSION="${1}" +WAF_GIT="https://gitlab.com/ita1024/waf.git" +WAF_UPDATE_SCRIPT="$(readlink -f "$0")" +WAF_SAMBA_DIR="$(dirname "${WAF_UPDATE_SCRIPT}")" +WAF_TMPDIR=$(mktemp --tmpdir -d waf-XXXXXXXX) + +echo "VERSION: ${WAF_VERSION}" +echo "GIT URL: ${WAF_GIT}" +echo "WAF SAMBA DIR: ${WAF_SAMBA_DIR}" +echo "WAF TMP DIR: ${WAF_TMPDIR}" + +cleanup_tmpdir() { + popd 2>/dev/null || true + rm -rf "$WAF_TMPDIR" +} +trap cleanup_tmpdir SIGINT + +cleanup_and_exit() { + cleanup_tmpdir + if test "$1" = 0 -o -z "$1" ; then + exit 0 + else + exit "$1" + fi +} + +# Checkout the git tree +mkdir -p "${WAF_TMPDIR}" +pushd "${WAF_TMPDIR}" || cleanup_and_exit 1 + +git clone "${WAF_GIT}" +ret=$? +if $ret -ne 0 ; then + echo "ERROR: Failed to clone repository" + cleanup_and_exit 1 +fi + + +pushd waf || cleanup_and_exit 1 +git checkout -b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}" +ret=$? +if $ret -ne 0 ; then + echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository" + cleanup_and_exit 1 +fi +popd || cleanup_and_exit 1 + +popd || cleanup_and_exit 1 + +# Update waflib +pushd "${WAF_SAMBA_DIR}" || cleanup_and_exit 1 +pwd + +rm -rf waflib/ +rsync -av "${WAF_TMPDIR}/waf/waflib" . +ret=$? +if $ret -ne 0 ; then + echo "ERROR: Failed copy waflib" + cleanup_and_exit 1 +fi +chmod -x waflib/Context.py + +git add waflib + +popd || cleanup_and_exit 1 + +echo +echo "Now please change VERSION in buildtools/bin/waf and" +echo "Context.HEXVERSION in buildtools/wafsamba/wafsamba.py" +grep WAFVERSION "${WAF_SAMBA_DIR}/waflib/Context.py" +grep HEXVERSION "${WAF_SAMBA_DIR}/waflib/Context.py" +echo + +cleanup_and_exit 0
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Build.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Build.py
Changed
@@ -1066,9 +1066,9 @@ else: dest = os.path.normpath(Utils.subst_vars(self.install_to, self.env)) if not os.path.isabs(dest): - dest = os.path.join(self.env.PREFIX, dest) + dest = os.path.join(self.env.PREFIX, dest) if destdir and Options.options.destdir: - dest = os.path.join(Options.options.destdir, os.path.splitdrive(dest)1.lstrip(os.sep)) + dest = Options.options.destdir.rstrip(os.sep) + os.sep + os.path.splitdrive(dest)1.lstrip(os.sep) return dest def copy_fun(self, src, tgt):
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Context.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Context.py
Changed
@@ -18,13 +18,13 @@ import imp # the following 3 constants are updated on each new release (do not touch) -HEXVERSION=0x2001500 +HEXVERSION=0x2001800 """Constant updated on new releases""" -WAFVERSION="2.0.21" +WAFVERSION="2.0.24" """Constant updated on new releases""" -WAFREVISION="edde20a6425a5c3eb6b47d5f3f5c4fbc93fed5f4" +WAFREVISION="1af97c71f5a6756abf36d0f78ed8fd551596d7cb" """Git revision when the waf version is updated""" WAFNAME="waf" @@ -144,7 +144,7 @@ :type fun: string .. inheritance-diagram:: waflib.Context.Context waflib.Build.BuildContext waflib.Build.InstallContext waflib.Build.UninstallContext waflib.Build.StepContext waflib.Build.ListContext waflib.Configure.ConfigurationContext waflib.Scripting.Dist waflib.Scripting.DistCheck waflib.Build.CleanContext - + :top-classes: waflib.Context.Context """ errors = Errors
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Runner.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Runner.py
Changed
@@ -71,7 +71,7 @@ """Task to execute""" self.spawner = spawner """Coordinator object""" - self.setDaemon(1) + self.daemon = True self.start() def run(self): """ @@ -98,7 +98,7 @@ """:py:class:`waflib.Runner.Parallel` producer instance""" self.sem = Utils.threading.Semaphore(master.numjobs) """Bounded semaphore that prevents spawning more than *n* concurrent consumers""" - self.setDaemon(1) + self.daemon = True self.start() def run(self): """
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/TaskGen.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/TaskGen.py
Changed
@@ -631,12 +631,8 @@ cls.scan = self.scan elif has_deps: def scan(self): - nodes = - for x in self.generator.to_list(getattr(self.generator, 'deps', None)): - node = self.generator.path.find_resource(x) - if not node: - self.generator.bld.fatal('Could not find %r (was it declared?)' % x) - nodes.append(node) + deps = getattr(self.generator, 'deps', None) + nodes = self.generator.to_nodes(deps) return nodes, cls.scan = scan
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/c_config.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/c_config.py
Changed
@@ -69,6 +69,7 @@ '__sh__' : 'sh', '__xtensa__' : 'xtensa', '__e2k__' : 'e2k', +'__riscv' : 'riscv', } @conf
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/ccroot.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/ccroot.py
Changed
@@ -128,6 +128,7 @@ Base class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute *link_task*. See :py:func:`waflib.Tools.ccroot.apply_link`. .. inheritance-diagram:: waflib.Tools.ccroot.stlink_task waflib.Tools.c.cprogram waflib.Tools.c.cshlib waflib.Tools.cxx.cxxstlib waflib.Tools.cxx.cxxprogram waflib.Tools.cxx.cxxshlib waflib.Tools.d.dprogram waflib.Tools.d.dshlib waflib.Tools.d.dstlib waflib.Tools.ccroot.fake_shlib waflib.Tools.ccroot.fake_stlib waflib.Tools.asm.asmprogram waflib.Tools.asm.asmshlib waflib.Tools.asm.asmstlib + :top-classes: waflib.Tools.ccroot.link_task """ color = 'YELLOW'
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/compiler_c.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/compiler_c.py
Changed
@@ -36,18 +36,19 @@ from waflib.Logs import debug c_compiler = { -'win32': 'msvc', 'gcc', 'clang', -'cygwin': 'gcc', 'clang', -'darwin': 'clang', 'gcc', -'aix': 'xlc', 'gcc', 'clang', -'linux': 'gcc', 'clang', 'icc', -'sunos': 'suncc', 'gcc', -'irix': 'gcc', 'irixcc', -'hpux': 'gcc', -'osf1V': 'gcc', -'gnu': 'gcc', 'clang', -'java': 'gcc', 'msvc', 'clang', 'icc', -'default':'clang', 'gcc', +'win32': 'msvc', 'gcc', 'clang', +'cygwin': 'gcc', 'clang', +'darwin': 'clang', 'gcc', +'aix': 'xlc', 'gcc', 'clang', +'linux': 'gcc', 'clang', 'icc', +'sunos': 'suncc', 'gcc', +'irix': 'gcc', 'irixcc', +'hpux': 'gcc', +'osf1V': 'gcc', +'gnu': 'gcc', 'clang', +'java': 'gcc', 'msvc', 'clang', 'icc', +'gnukfreebsd': 'gcc', 'clang', +'default': 'clang', 'gcc', } """ Dict mapping platform names to Waf tools finding specific C compilers::
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/compiler_cxx.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/compiler_cxx.py
Changed
@@ -37,18 +37,19 @@ from waflib.Logs import debug cxx_compiler = { -'win32': 'msvc', 'g++', 'clang++', -'cygwin': 'g++', 'clang++', -'darwin': 'clang++', 'g++', -'aix': 'xlc++', 'g++', 'clang++', -'linux': 'g++', 'clang++', 'icpc', -'sunos': 'sunc++', 'g++', -'irix': 'g++', -'hpux': 'g++', -'osf1V': 'g++', -'gnu': 'g++', 'clang++', -'java': 'g++', 'msvc', 'clang++', 'icpc', -'default': 'clang++', 'g++' +'win32': 'msvc', 'g++', 'clang++', +'cygwin': 'g++', 'clang++', +'darwin': 'clang++', 'g++', +'aix': 'xlc++', 'g++', 'clang++', +'linux': 'g++', 'clang++', 'icpc', +'sunos': 'sunc++', 'g++', +'irix': 'g++', +'hpux': 'g++', +'osf1V': 'g++', +'gnu': 'g++', 'clang++', +'java': 'g++', 'msvc', 'clang++', 'icpc', +'gnukfreebsd': 'g++', 'clang++', +'default': 'clang++', 'g++' } """ Dict mapping the platform names to Waf tools finding specific C++ compilers::
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/msvc.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/msvc.py
Changed
@@ -109,6 +109,21 @@ opt.add_option('--msvc_targets', type='string', help = 'msvc targets, eg: "x64,arm"', default='') opt.add_option('--no-msvc-lazy', action='store_false', help = 'lazily check msvc target environments', default=True, dest='msvc_lazy') +class MSVCVersion(object): + def __init__(self, ver): + m = re.search('^(.*)\s+(\d+.\d+)', ver) + if m: + self.name = m.group(1) + self.number = float(m.group(2)) + else: + self.name = ver + self.number = 0. + + def __lt__(self, other): + if self.number == other.number: + return self.name < other.name + return self.number < other.number + @conf def setup_msvc(conf, versiondict): """ @@ -125,7 +140,7 @@ platforms=Utils.to_list(conf.env.MSVC_TARGETS) or i for i,j in all_msvc_platforms+all_icl_platforms+all_wince_platforms desired_versions = getattr(Options.options, 'msvc_version', '').split(',') if desired_versions == '': - desired_versions = conf.env.MSVC_VERSIONS or list(reversed(sorted(versiondict.keys()))) + desired_versions = conf.env.MSVC_VERSIONS or list(sorted(versiondict.keys(), key=MSVCVersion, reverse=True)) # Override lazy detection by evaluating after the fact. lazy_detect = getattr(Options.options, 'msvc_lazy', True) @@ -193,7 +208,7 @@ echo INCLUDE=%%INCLUDE%% echo LIB=%%LIB%%;%%LIBPATH%% """ % (vcvars,target)) - sout = conf.cmd_and_log('cmd.exe', '/E:on', '/V:on', '/C', batfile.abspath()) + sout = conf.cmd_and_log('cmd.exe', '/E:on', '/V:on', '/C', batfile.abspath(), stdin=getattr(Utils.subprocess, 'DEVNULL', None)) lines = sout.splitlines() if not lines0:
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/python.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/python.py
Changed
@@ -315,7 +315,7 @@ conf.fatal('Could not find the python executable') # so we actually do all this for compatibility reasons and for obtaining pyext_PATTERN below - v = 'prefix SO LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split() + v = 'prefix SO EXT_SUFFIX LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split() try: lst = conf.get_python_variables("get_config_var('%s') or ''" % x for x in v) except RuntimeError: @@ -327,8 +327,8 @@ dct = dict(zip(v, lst)) x = 'MACOSX_DEPLOYMENT_TARGET' if dctx: - envx = conf.environx = dctx - env.pyext_PATTERN = '%s' + dct'SO' # not a mistake + envx = conf.environx = str(dctx) + env.pyext_PATTERN = '%s' + (dct'EXT_SUFFIX' or dct'SO') # SO is deprecated in 3.5 and removed in 3.11 # Try to get pythonX.Y-config @@ -416,9 +416,14 @@ if not result: path = os.path.join(dct'prefix', "libs") - conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY name rather than pythonX.Y (win32)\n") + conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY rather than pythonX.Y (win32)\n") result = conf.check(lib=name, uselib='PYEMBED', libpath=path, mandatory=False, msg='Checking for library %s in $prefix/libs' % name) + if not result: + path = os.path.normpath(os.path.join(dct'INCLUDEPY', '..', 'libs')) + conf.to_log("\n\n# try again with -L$INCLUDEPY/../libs, and pythonXY rather than pythonX.Y (win32)\n") + result = conf.check(lib=name, uselib='PYEMBED', libpath=path, mandatory=False, msg='Checking for library %s in $INCLUDEPY/../libs' % name) + if result: break # do not forget to set LIBPATH_PYEMBED
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/qt5.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/qt5.py
Changed
@@ -566,7 +566,7 @@ # at the end, try to find qmake in the paths given # keep the one with the highest version cand = None - prev_ver = '5', '0', '0' + prev_ver = '0', '0', '0' for qmk in ('qmake-qt5', 'qmake5', 'qmake'): try: qmake = self.find_program(qmk, path_list=paths) @@ -580,7 +580,7 @@ else: if version: new_ver = version.split('.') - if new_ver > prev_ver: + if new_ver0 == '5' and new_ver > prev_ver: cand = qmake prev_ver = new_ver @@ -783,8 +783,8 @@ pat = self.env.cxxstlib_PATTERN if Utils.unversioned_sys_platform() == 'darwin': pat = r"%s\.framework" - re_qt = re.compile(pat%'Qt5?(?P<name>.*)'+'$') - for x in dirlst: + re_qt = re.compile(pat % 'Qt5?(?P<name>\\w+)' + '$') + for x in sorted(dirlst): m = re_qt.match(x) if m: self.qt5_vars.append("Qt5%s" % m.group('name'))
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/tex.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/tex.py
Changed
@@ -90,6 +90,7 @@ Compiles a tex/latex file. .. inheritance-diagram:: waflib.Tools.tex.latex waflib.Tools.tex.xelatex waflib.Tools.tex.pdflatex + :top-classes: waflib.Tools.tex.tex """ bibtex_fun, _ = Task.compile_fun('${BIBTEX} ${BIBTEXFLAGS} ${SRCFILE}', shell=False)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/waf_unit_test.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/waf_unit_test.py
Changed
@@ -206,7 +206,7 @@ self.ut_exec = getattr(self.generator, 'ut_exec', self.inputs0.abspath()) ut_cmd = getattr(self.generator, 'ut_cmd', False) if ut_cmd: - self.ut_exec = shlex.split(ut_cmd % ' '.join(self.ut_exec)) + self.ut_exec = shlex.split(ut_cmd % Utils.shell_escape(self.ut_exec)) return self.exec_command(self.ut_exec)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Tools/winres.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Tools/winres.py
Changed
@@ -4,10 +4,12 @@ "Process *.rc* files for C/C++: X{.rc -> .res|.rc.o}" +import os import re from waflib import Task from waflib.TaskGen import extension from waflib.Tools import c_preproc +from waflib import Utils @extension('.rc') def rc_file(self, node): @@ -61,6 +63,39 @@ tmp.start(self.inputs0, self.env) return (tmp.nodes, tmp.names) + def exec_command(self, cmd, **kw): + if self.env.WINRC_TGT_F == '/fo': + # Since winres include paths may contain spaces, they do not fit in + # response files and are best passed as environment variables + replace_cmd = + incpaths = + while cmd: + # filter include path flags + flag = cmd.pop(0) + if flag.upper().startswith('/I'): + if len(flag) == 2: + incpaths.append(cmd.pop(0)) + else: + incpaths.append(flag2:) + else: + replace_cmd.append(flag) + cmd = replace_cmd + if incpaths: + # append to existing environment variables in INCLUDE + env = kw'env' = dict(kw.get('env') or self.env.env or os.environ) + pre_includes = env.get('INCLUDE', '') + env'INCLUDE' = pre_includes + os.pathsep + os.pathsep.join(incpaths) + + return super(winrc, self).exec_command(cmd, **kw) + + def quote_flag(self, flag): + if self.env.WINRC_TGT_F == '/fo': + # winres does not support quotes around flags in response files + return flag + + return super(winrc, self).quote_flag(flag) + + def configure(conf): """ Detects the programs RC or windres, depending on the C/C++ compiler in use
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/Utils.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/Utils.py
Changed
@@ -11,7 +11,7 @@ from __future__ import with_statement -import atexit, os, sys, errno, inspect, re, datetime, platform, base64, signal, functools, time +import atexit, os, sys, errno, inspect, re, datetime, platform, base64, signal, functools, time, shlex try: import cPickle @@ -577,10 +577,13 @@ fu = fu.upper() return fu -re_sh = re.compile('\\s|\'|"') -""" -Regexp used for shell_escape below -""" +# shlex.quote didn't exist until python 3.3. Prior to that it was a non-documented +# function in pipes. +try: + shell_quote = shlex.quote +except AttributeError: + import pipes + shell_quote = pipes.quote def shell_escape(cmd): """ @@ -589,7 +592,7 @@ """ if isinstance(cmd, str): return cmd - return ' '.join(repr(x) if re_sh.search(x) else x for x in cmd) + return ' '.join(shell_quote(x) for x in cmd) def h_list(lst): """
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/clang_compilation_database.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/clang_compilation_database.py
Changed
@@ -29,22 +29,9 @@ Task.Task.keep_last_cmd = True -@TaskGen.feature('c', 'cxx') -@TaskGen.after_method('process_use') -def collect_compilation_db_tasks(self): - "Add a compilation database entry for compiled tasks" - if not isinstance(self.bld, ClangDbContext): - return - - tup = tuple(y for y in Task.classes.get(x) for x in ('c', 'cxx') if y) - for task in getattr(self, 'compiled_tasks', ): - if isinstance(task, tup): - self.bld.clang_compilation_database_tasks.append(task) - class ClangDbContext(Build.BuildContext): '''generates compile_commands.json by request''' cmd = 'clangdb' - clang_compilation_database_tasks = def write_compilation_database(self): """ @@ -78,6 +65,8 @@ Build dry run """ self.restore() + self.cur_tasks = + self.clang_compilation_database_tasks = if not self.all_envs: self.load_envs() @@ -103,8 +92,21 @@ lst = tg else: lst = tg.tasks for tsk in lst: + if tsk.__class__.__name__ == "swig": + tsk.runnable_status() + if hasattr(tsk, 'more_tasks'): + lst.extend(tsk.more_tasks) + # Not all dynamic tasks can be processed, in some cases + # one may have to call the method "run()" like this: + #elif tsk.__class__.__name__ == 'src2c': + # tsk.run() + # if hasattr(tsk, 'more_tasks'): + # lst.extend(tsk.more_tasks) + tup = tuple(y for y in Task.classes.get(x) for x in ('c', 'cxx') if y) if isinstance(tsk, tup): + self.clang_compilation_database_tasks.append(tsk) + tsk.nocache = True old_exec = tsk.exec_command tsk.exec_command = exec_command tsk.run() @@ -124,7 +126,7 @@ Invoke clangdb command before build """ if self.cmd.startswith('build'): - Scripting.run_command('clangdb') + Scripting.run_command(self.cmd.replace('build','clangdb')) old_execute_build(self)
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/classic_runner.py
Added
@@ -0,0 +1,68 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Thomas Nagy, 2021 (ita) + +from waflib import Utils, Runner + +""" +Re-enable the classic threading system from waf 1.x + +def configure(conf): + conf.load('classic_runner') +""" + +class TaskConsumer(Utils.threading.Thread): + """ + Task consumers belong to a pool of workers + + They wait for tasks in the queue and then use ``task.process(...)`` + """ + def __init__(self, spawner): + Utils.threading.Thread.__init__(self) + """ + Obtain :py:class:`waflib.Task.TaskBase` instances from this queue. + """ + self.spawner = spawner + self.daemon = True + self.start() + + def run(self): + """ + Loop over the tasks to execute + """ + try: + self.loop() + except Exception: + pass + + def loop(self): + """ + Obtain tasks from :py:attr:`waflib.Runner.TaskConsumer.ready` and call + :py:meth:`waflib.Task.TaskBase.process`. If the object is a function, execute it. + """ + master = self.spawner.master + while 1: + if not master.stop: + try: + tsk = master.ready.get() + if tsk: + tsk.log_display(tsk.generator.bld) + master.process_task(tsk) + else: + break + finally: + master.out.put(tsk) + +class Spawner(object): + """ + Daemon thread that consumes tasks from :py:class:`waflib.Runner.Parallel` producer and + spawns a consuming thread :py:class:`waflib.Runner.Consumer` for each + :py:class:`waflib.Task.Task` instance. + """ + def __init__(self, master): + self.master = master + """:py:class:`waflib.Runner.Parallel` producer instance""" + + self.pool = TaskConsumer(self) for i in range(master.numjobs) + +Runner.Spawner = Spawner
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/color_gcc.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/color_gcc.py
Changed
@@ -19,7 +19,7 @@ func = frame.f_code.co_name if func == 'exec_command': cmd = frame.f_locals.get('cmd') - if isinstance(cmd, list) and ('gcc' in cmd0 or 'g++' in cmd0): + if isinstance(cmd, list) and (len(cmd) > 0) and ('gcc' in cmd0 or 'g++' in cmd0): lines = for line in rec.msg.splitlines(): if 'warning: ' in line:
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/eclipse.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/eclipse.py
Changed
@@ -10,6 +10,9 @@ def options(opt): opt.load('eclipse') +To add additional targets beside standard ones (configure, dist, install, check) +the environment ECLIPSE_EXTRA_TARGETS can be set (ie. to 'test', 'lint', 'docs') + $ waf configure eclipse """ @@ -25,6 +28,8 @@ cdt_bld = oe_cdt + '.build.core' extbuilder_dir = '.externalToolBuilders' extbuilder_name = 'Waf_Builder.launch' +settings_dir = '.settings' +settings_name = 'language.settings.xml' class eclipse(Build.BuildContext): cmd = 'eclipse' @@ -131,9 +136,11 @@ path = p.path_from(self.srcnode) if (path.startswith("/")): - cpppath.append(path) + if path not in cpppath: + cpppath.append(path) else: - workspace_includes.append(path) + if path not in workspace_includes: + workspace_includes.append(path) if is_cc and path not in source_dirs: source_dirs.append(path) @@ -156,6 +163,61 @@ project = self.impl_create_javaproject(javasrcpath, javalibpath) self.write_conf_to_xml('.classpath', project) + # Create editor language settings to have correct standards applied in IDE, as per project configuration + try: + os.mkdir(settings_dir) + except OSError: + pass # Ignore if dir already exists + + lang_settings = Document() + project = lang_settings.createElement('project') + + # Language configurations for C and C++ via cdt + if hasc: + configuration = self.add(lang_settings, project, 'configuration', + {'id' : 'org.eclipse.cdt.core.default.config.1', 'name': 'Default'}) + + extension = self.add(lang_settings, configuration, 'extension', {'point': 'org.eclipse.cdt.core.LanguageSettingsProvider'}) + + provider = self.add(lang_settings, extension, 'provider', + { 'copy-of': 'extension', + 'id': 'org.eclipse.cdt.ui.UserLanguageSettingsProvider'}) + + provider = self.add(lang_settings, extension, 'provider-reference', + { 'id': 'org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider', + 'ref': 'shared-provider'}) + + provider = self.add(lang_settings, extension, 'provider-reference', + { 'id': 'org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider', + 'ref': 'shared-provider'}) + + # C and C++ are kept as separated providers so appropriate flags are used also in mixed projects + if self.env.CC: + provider = self.add(lang_settings, extension, 'provider', + { 'class': 'org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector', + 'console': 'false', + 'id': 'org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector.1', + 'keep-relative-paths' : 'false', + 'name': 'CDT GCC Built-in Compiler Settings', + 'parameter': '%s %s ${FLAGS} -E -P -v -dD "${INPUTS}"'%(self.env.CC0,' '.join(self.env'CFLAGS')), + 'prefer-non-shared': 'true' }) + + self.add(lang_settings, provider, 'language-scope', { 'id': 'org.eclipse.cdt.core.gcc'}) + + if self.env.CXX: + provider = self.add(lang_settings, extension, 'provider', + { 'class': 'org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector', + 'console': 'false', + 'id': 'org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector.2', + 'keep-relative-paths' : 'false', + 'name': 'CDT GCC Built-in Compiler Settings', + 'parameter': '%s %s ${FLAGS} -E -P -v -dD "${INPUTS}"'%(self.env.CXX0,' '.join(self.env'CXXFLAGS')), + 'prefer-non-shared': 'true' }) + self.add(lang_settings, provider, 'language-scope', { 'id': 'org.eclipse.cdt.core.g++'}) + + lang_settings.appendChild(project) + self.write_conf_to_xml('%s%s%s'%(settings_dir, os.path.sep, settings_name), lang_settings) + def impl_create_project(self, executable, appname, hasc, hasjava, haspython, waf_executable): doc = Document() projectDescription = doc.createElement('projectDescription') @@ -341,6 +403,8 @@ addTargetWrap('dist', False) addTargetWrap('install', False) addTargetWrap('check', False) + for addTgt in self.env.ECLIPSE_EXTRA_TARGETS or : + addTargetWrap(addTgt, False) storageModule = self.add(doc, cproject, 'storageModule', {'moduleId': 'cdtBuildSystem', @@ -348,6 +412,12 @@ self.add(doc, storageModule, 'project', {'id': '%s.null.1'%appname, 'name': appname}) + storageModule = self.add(doc, cproject, 'storageModule', + {'moduleId': 'org.eclipse.cdt.core.LanguageSettingsProviders'}) + + storageModule = self.add(doc, cproject, 'storageModule', + {'moduleId': 'scannerConfiguration'}) + doc.appendChild(cproject) return doc
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/gccdeps.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/gccdeps.py
Changed
@@ -29,13 +29,6 @@ # Third-party tools are allowed to add extra names in here with append() supported_compilers = 'gas', 'gcc', 'icc', 'clang' -def scan(self): - if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: - return super(self.derived_gccdeps, self).scan() - nodes = self.generator.bld.node_deps.get(self.uid(), ) - names = - return (nodes, names) - re_o = re.compile(r"\.o$") re_splitter = re.compile(r'(?<!\\)\s+') # split by space, except when spaces are escaped @@ -61,28 +54,30 @@ else: # Not hashable, assume it is a list and join into a string node_lookup_key = (base_node, os.path.sep.join(path)) + try: - lock.acquire() node = cached_nodesnode_lookup_key except KeyError: - node = base_node.find_resource(path) - cached_nodesnode_lookup_key = node - finally: - lock.release() + # retry with lock on cache miss + with lock: + try: + node = cached_nodesnode_lookup_key + except KeyError: + node = cached_nodesnode_lookup_key = base_node.find_resource(path) + return node def post_run(self): if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: return super(self.derived_gccdeps, self).post_run() - name = self.outputs0.abspath() - name = re_o.sub('.d', name) + deps_filename = self.outputs0.abspath() + deps_filename = re_o.sub('.d', deps_filename) try: - txt = Utils.readf(name) + deps_txt = Utils.readf(deps_filename) except EnvironmentError: Logs.error('Could not find a .d dependency file, are cflags/cxxflags overwritten?') raise - #os.remove(name) # Compilers have the choice to either output the file's dependencies # as one large Makefile rule: @@ -102,15 +97,16 @@ # So the first step is to sanitize the input by stripping out the left- # hand side of all these lines. After that, whatever remains are the # implicit dependencies of task.outputs0 - txt = '\n'.join(remove_makefile_rule_lhs(line) for line in txt.splitlines()) + deps_txt = '\n'.join(remove_makefile_rule_lhs(line) for line in deps_txt.splitlines()) # Now join all the lines together - txt = txt.replace('\\\n', '') + deps_txt = deps_txt.replace('\\\n', '') - val = txt.strip() - val = x.replace('\\ ', ' ') for x in re_splitter.split(val) if x + dep_paths = deps_txt.strip() + dep_paths = x.replace('\\ ', ' ') for x in re_splitter.split(dep_paths) if x - nodes = + resolved_nodes = + unresolved_names = bld = self.generator.bld # Dynamically bind to the cache @@ -119,39 +115,41 @@ except AttributeError: cached_nodes = bld.cached_nodes = {} - for x in val: + for path in dep_paths: node = None - if os.path.isabs(x): - node = path_to_node(bld.root, x, cached_nodes) + if os.path.isabs(path): + node = path_to_node(bld.root, path, cached_nodes) else: # TODO waf 1.9 - single cwd value - path = getattr(bld, 'cwdx', bld.bldnode) + base_node = getattr(bld, 'cwdx', bld.bldnode) # when calling find_resource, make sure the path does not contain '..' - x = k for k in Utils.split_path(x) if k and k != '.' - while '..' in x: - idx = x.index('..') + path = k for k in Utils.split_path(path) if k and k != '.' + while '..' in path: + idx = path.index('..') if idx == 0: - x = x1: - path = path.parent + path = path1: + base_node = base_node.parent else: - del xidx - del xidx-1 + del pathidx + del pathidx-1 - node = path_to_node(path, x, cached_nodes) + node = path_to_node(base_node, path, cached_nodes) if not node: - raise ValueError('could not find %r for %r' % (x, self)) + raise ValueError('could not find %r for %r' % (path, self)) + if id(node) == id(self.inputs0): # ignore the source file, it is already in the dependencies # this way, successful config tests may be retrieved from the cache continue - nodes.append(node) - Logs.debug('deps: gccdeps for %s returned %s', self, nodes) + resolved_nodes.append(node) - bld.node_depsself.uid() = nodes - bld.raw_depsself.uid() = + Logs.debug('deps: gccdeps for %s returned %s', self, resolved_nodes) + + bld.node_depsself.uid() = resolved_nodes + bld.raw_depsself.uid() = unresolved_names try: del self.cache_sig @@ -160,6 +158,14 @@ Task.Task.post_run(self) +def scan(self): + if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: + return super(self.derived_gccdeps, self).scan() + + resolved_nodes = self.generator.bld.node_deps.get(self.uid(), ) + unresolved_names = + return (resolved_nodes, unresolved_names) + def sig_implicit_deps(self): if not self.__class__.__name__ in self.env.ENABLE_GCCDEPS: return super(self.derived_gccdeps, self).sig_implicit_deps()
View file
_service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/haxe.py
Added
@@ -0,0 +1,131 @@ +import os, re +from waflib import Utils, Task, Errors +from waflib.TaskGen import extension, taskgen_method, feature +from waflib.Configure import conf + +@conf +def libname_haxe(self, libname): + return libname + +@conf +def check_lib_haxe(self, libname, uselib_store=None): + haxe_libs = node.name for node in self.root.find_node('haxe_libraries').ant_glob() + changed = False + self.start_msg('Checking for library %s' % libname) + if libname + '.hxml' in haxe_libs: + self.end_msg('yes') + else: + changed = True + try: + cmd = self.env.LIX + '+lib', libname + res = self.cmd_and_log(cmd) + if (res): + raise Errors.WafError(res) + else: + self.end_msg('downloaded', color = 'YELLOW') + except Errors.WafError as e: + self.end_msg('no', color = 'RED') + self.fatal('Getting %s has failed' % libname) + + postfix = uselib_store if uselib_store else libname.upper() + self.env'LIB_' + postfix += self.libname_haxe(libname) + return changed + +@conf +def check_libs_haxe(self, libnames, uselib_store=None): + changed = False + for libname in Utils.to_list(libnames): + if self.check_lib_haxe(libname, uselib_store): + changed = True + return changed + +@conf +def ensure_lix_pkg(self, *k, **kw): + if kw.get('compiler') == 'hx': + if isinstance(kw.get('libs'), list) and len(kw.get('libs')): + changed = self.check_libs_haxe(kw.get('libs'), kw.get('uselib_store')) + if changed: + try: + cmd = self.env.LIX + 'download' + res = self.cmd_and_log(cmd) + if (res): + raise Errors.WafError(res) + except Errors.WafError as e: + self.fatal('lix download has failed') + else: + self.check_lib_haxe(kw.get('lib'), kw.get('uselib_store')) + +@conf +def haxe(bld, *k, **kw): + task_gen = bld(*k, **kw) + +class haxe(Task.Task): + vars = 'HAXE', 'HAXE_VERSION', 'HAXEFLAGS' + ext_out = '.hl', '.c', '.h' + + def run(self): + cmd = self.env.HAXE + self.env.HAXEFLAGS + return self.exec_command(cmd, stdout = open(os.devnull, 'w')) + +@taskgen_method +def init_haxe_task(self, node): + def addflags(flags): + self.env.append_value('HAXEFLAGS', flags) + + if node.suffix() == '.hxml': + addflags(self.path.abspath() + '/' + node.name) + else: + addflags('-main', node.name) + addflags('-hl', self.path.get_bld().make_node(self.target).abspath()) + addflags('-cp', self.path.abspath()) + addflags('-D', 'resourcesPath=%s' % getattr(self, 'res', '')) + if hasattr(self, 'use'): + for dep in self.use: + if self.env'LIB_' + dep: + for lib in self.env'LIB_' + dep: addflags('-lib', lib) + +@extension('.hx', '.hxml') +def haxe_file(self, node): + if len(self.source) > 1: + self.bld.fatal('Use separate task generators for multiple files') + + try: + haxetask = self.haxetask + except AttributeError: + haxetask = self.haxetask = self.create_task('haxe') + self.init_haxe_task(node) + + haxetask.inputs.append(node) + haxetask.outputs.append(self.path.get_bld().make_node(self.target)) + +@conf +def find_haxe(self, min_version): + npx = self.env.NPX = self.find_program('npx') + self.env.LIX = npx + 'lix' + npx_haxe = self.env.HAXE = npx + 'haxe' + try: + output = self.cmd_and_log(npx_haxe + '-version') + except Errors.WafError: + haxe_version = None + else: + ver = re.search(r'\d+.\d+.\d+', output).group().split('.') + haxe_version = tuple(int(x) for x in ver) + + self.msg('Checking for haxe version', + haxe_version, haxe_version and haxe_version >= min_version) + if npx_haxe and haxe_version < min_version: + self.fatal('haxe version %r is too old, need >= %r' % (haxe_version, min_version)) + + self.env.HAXE_VERSION = haxe_version + return npx_haxe + +@conf +def check_haxe(self, min_version=(4,1,4)): + if self.env.HAXE_MINVER: + min_version = self.env.HAXE_MINVER + find_haxe(self, min_version) + +def configure(self): + self.env.HAXEFLAGS = + self.check_haxe() + self.add_os_flags('HAXEFLAGS', dup = False)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/msvcdeps.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/msvcdeps.py
Changed
@@ -32,7 +32,6 @@ from waflib.TaskGen import feature, before_method lock = threading.Lock() -nodes = {} # Cache the path -> Node lookup PREPROCESSOR_FLAG = '/showIncludes' INCLUDE_PATTERN = 'Note: including file:' @@ -50,23 +49,47 @@ if taskgen.env.get_flat(flag).find(PREPROCESSOR_FLAG) < 0: taskgen.env.append_value(flag, PREPROCESSOR_FLAG) + +def get_correct_path_case(base_path, path): + ''' + Return a case-corrected version of ``path`` by searching the filesystem for + ``path``, relative to ``base_path``, using the case returned by the filesystem. + ''' + components = Utils.split_path(path) + + corrected_path = '' + if os.path.isabs(path): + corrected_path = components.pop(0).upper() + os.sep + + for part in components: + part = part.lower() + search_path = os.path.join(base_path, corrected_path) + if part == '..': + corrected_path = os.path.join(corrected_path, part) + search_path = os.path.normpath(search_path) + continue + + for item in sorted(os.listdir(search_path)): + if item.lower() == part: + corrected_path = os.path.join(corrected_path, item) + break + else: + raise ValueError("Can't find %r in %r" % (part, search_path)) + + return corrected_path + + def path_to_node(base_node, path, cached_nodes): ''' Take the base node and the path and return a node Results are cached because searching the node tree is expensive The following code is executed by threads, it is not safe, so a lock is needed... ''' - # normalize the path because ant_glob() does not understand - # parent path components (..) + # normalize the path to remove parent path components (..) path = os.path.normpath(path) # normalize the path case to increase likelihood of a cache hit - path = os.path.normcase(path) - - # ant_glob interprets and () characters, so those must be replaced - path = path.replace('', '?').replace('', '?').replace('(', '(').replace(')', ')') - - node_lookup_key = (base_node, path) + node_lookup_key = (base_node, os.path.normcase(path)) try: node = cached_nodesnode_lookup_key @@ -76,8 +99,8 @@ try: node = cached_nodesnode_lookup_key except KeyError: - node_list = base_node.ant_glob(path, ignorecase=True, remove=False, quiet=True, regex=False) - node = cached_nodesnode_lookup_key = node_list0 if node_list else None + path = get_correct_path_case(base_node.abspath(), path) + node = cached_nodesnode_lookup_key = base_node.find_node(path) return node @@ -89,9 +112,9 @@ if getattr(self, 'cached', None): return Task.Task.post_run(self) - bld = self.generator.bld - unresolved_names = resolved_nodes = + unresolved_names = + bld = self.generator.bld # Dynamically bind to the cache try: @@ -124,11 +147,14 @@ continue if id(node) == id(self.inputs0): - # Self-dependency + # ignore the source file, it is already in the dependencies + # this way, successful config tests may be retrieved from the cache continue resolved_nodes.append(node) + Logs.debug('deps: msvcdeps for %s returned %s', self, resolved_nodes) + bld.node_depsself.uid() = resolved_nodes bld.raw_depsself.uid() = unresolved_names
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/msvs.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/msvs.py
Changed
@@ -787,8 +787,12 @@ self.collect_dirs() default_project = getattr(self, 'default_project', None) def sortfun(x): - if x.name == default_project: + # folders should sort to the top + if getattr(x, 'VS_GUID_SOLUTIONFOLDER', None): return '' + # followed by the default project + elif x.name == default_project: + return ' ' return getattr(x, 'path', None) and x.path.win32path() or x.name self.all_projects.sort(key=sortfun)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/swig.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/swig.py
Changed
@@ -17,7 +17,7 @@ SWIG_EXTS = '.swig', '.i' -re_module = re.compile(r'%module(?:\s*\(.*\))?\s+(.+)', re.M) +re_module = re.compile(r'%module(?:\s*\(.*\))?\s+(^\r\n+)', re.M) re_1 = re.compile(r'^%module.*?\s+(\w+)\s*?$', re.M) re_2 = re.compile(r'#%(?:include|import(?:\(module=".*"\))+|python(?:begin|code)) <"(.*)">', re.M)
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/extras/wafcache.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/extras/wafcache.py
Changed
@@ -31,6 +31,7 @@ gsutil cp gs://mybucket/bb/bbbbb/2 build/somefile * WAFCACHE_NO_PUSH: if set, disables pushing to the cache * WAFCACHE_VERBOSITY: if set, displays more detailed cache operations +* WAFCACHE_STATS: if set, displays cache usage statistics on exit File cache specific options: Files are copied using hard links by default; if the cache is located @@ -69,6 +70,7 @@ EVICT_MAX_BYTES = int(os.environ.get('WAFCACHE_EVICT_MAX_BYTES', 10**10)) WAFCACHE_NO_PUSH = 1 if os.environ.get('WAFCACHE_NO_PUSH') else 0 WAFCACHE_VERBOSITY = 1 if os.environ.get('WAFCACHE_VERBOSITY') else 0 +WAFCACHE_STATS = 1 if os.environ.get('WAFCACHE_STATS') else 0 OK = "ok" re_waf_cmd = re.compile('(?P<src>%{SRC})|(?P<tgt>%{TGT})') @@ -93,6 +95,9 @@ sig = self.signature() ssig = Utils.to_hex(self.uid() + sig) + if WAFCACHE_STATS: + self.generator.bld.cache_reqs += 1 + files_to = node.abspath() for node in self.outputs err = cache_command(ssig, , files_to) if err.startswith(OK): @@ -100,6 +105,8 @@ Logs.pprint('CYAN', ' Fetched %r from cache' % files_to) else: Logs.debug('wafcache: fetched %r from cache', files_to) + if WAFCACHE_STATS: + self.generator.bld.cache_hits += 1 else: if WAFCACHE_VERBOSITY: Logs.pprint('YELLOW', ' No cache entry %s' % files_to) @@ -117,11 +124,17 @@ if WAFCACHE_NO_PUSH or getattr(self, 'cached', None) or not self.outputs: return + files_from = + for node in self.outputs: + path = node.abspath() + if not os.path.isfile(path): + return + files_from.append(path) + bld = self.generator.bld sig = self.signature() ssig = Utils.to_hex(self.uid() + sig) - files_from = node.abspath() for node in self.outputs err = cache_command(ssig, files_from, ) if err.startswith(OK): @@ -129,6 +142,8 @@ Logs.pprint('CYAN', ' Successfully uploaded %s to cache' % files_from) else: Logs.debug('wafcache: Successfully uploaded %r to cache', files_from) + if WAFCACHE_STATS: + self.generator.bld.cache_puts += 1 else: if WAFCACHE_VERBOSITY: Logs.pprint('RED', ' Error caching step results %s: %s' % (files_from, err)) @@ -193,6 +208,10 @@ if getattr(cls, 'nocache', None) or getattr(cls, 'has_cache', False): return + full_name = "%s.%s" % (cls.__module__, cls.__name__) + if full_name in ('waflib.Tools.ccroot.vnum', 'waflib.Build.inst'): + return + m1 = getattr(cls, 'run', None) def run(self): if getattr(self, 'nocache', False): @@ -208,9 +227,6 @@ return m2(self) ret = m2(self) self.put_files_cache() - if hasattr(self, 'chmod'): - for node in self.outputs: - os.chmod(node.abspath(), self.chmod) return ret cls.post_run = post_run cls.has_cache = True @@ -242,6 +258,19 @@ """ Called during the build process to enable file caching """ + if WAFCACHE_STATS: + # Init counter for statistics and hook to print results at the end + bld.cache_reqs = bld.cache_hits = bld.cache_puts = 0 + + def printstats(bld): + hit_ratio = 0 + if bld.cache_reqs > 0: + hit_ratio = (bld.cache_hits / bld.cache_reqs) * 100 + Logs.pprint('CYAN', ' wafcache stats: requests: %s, hits, %s, ratio: %.2f%%, writes %s' % + (bld.cache_reqs, bld.cache_hits, hit_ratio, bld.cache_puts) ) + + bld.add_post_fun(printstats) + if process_pool: # already called once return @@ -320,7 +349,10 @@ size = 0 for fname in os.listdir(path): - size += os.lstat(os.path.join(path, fname)).st_size + try: + size += os.lstat(os.path.join(path, fname)).st_size + except OSError: + pass lst.append((os.stat(path).st_mtime, size, path)) lst.sort(key=lambda x: x0) @@ -331,7 +363,7 @@ _, tmp_size, path = lst.pop() tot -= tmp_size - tmp = path + '.tmp' + tmp = path + '.remove' try: shutil.rmtree(tmp) except OSError: @@ -339,12 +371,12 @@ try: os.rename(path, tmp) except OSError: - sys.stderr.write('Could not rename %r to %r' % (path, tmp)) + sys.stderr.write('Could not rename %r to %r\n' % (path, tmp)) else: try: shutil.rmtree(tmp) except OSError: - sys.stderr.write('Could not remove %r' % tmp) + sys.stderr.write('Could not remove %r\n' % tmp) sys.stderr.write("Cache trimmed: %r bytes in %r folders left\n" % (tot, len(lst))) @@ -371,8 +403,8 @@ try: fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) except EnvironmentError: - sys.stderr.write('another process is running!\n') - pass + if WAFCACHE_VERBOSITY: + sys.stderr.write('wafcache: another cleaning process is running\n') else: # now dow the actual cleanup lru_trim() @@ -443,7 +475,10 @@ else: # attempt trimming if caching was successful: # we may have things to trim! - lru_evict() + try: + lru_evict() + except Exception: + return traceback.format_exc() return OK def copy_from_cache(self, sig, files_from, files_to): @@ -481,7 +516,7 @@ out, err = proc.communicate() if proc.returncode: raise OSError('Error copy %r to %r using: %r (exit %r):\n out:%s\n err:%s' % ( - source, target, cmd, proc.returncode, out.decode(), err.decode())) + source, target, cmd, proc.returncode, out.decode(errors='replace'), err.decode(errors='replace'))) def copy_to_cache(self, sig, files_from, files_to): try:
View file
_service:tar_scm:tdb-1.4.5.tar.gz/third_party/waf/waflib/fixpy2.py -> _service:tar_scm:tdb-1.4.7.tar.gz/third_party/waf/waflib/fixpy2.py
Changed
@@ -56,7 +56,7 @@ @subst('Runner.py') def r4(code): "generator syntax" - return code.replace('next(self.biter)', 'self.biter.next()') + return code.replace('next(self.biter)', 'self.biter.next()').replace('self.daemon = True', 'self.setDaemon(1)') @subst('Context.py') def r5(code):
View file
_service:tar_scm:tdb-1.4.7.tar.gz/tools/tdbtortseq.c
Added
@@ -0,0 +1,123 @@ +/* + * Unix SMB/CIFS implementation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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/>. + */ + +#include "replace.h" +#include "system/filesys.h" +#include <tdb.h> +#include <stdio.h> +#include <errno.h> +#include "system/wait.h" + +#define NPROCS 500 +#define NUMOPS 1000000 + +int main(void) +{ + pid_t pidsNPROCS; + struct tdb_context *tdb = NULL; + int i; + uint32_t seqnum_before, seqnum_after; + + tdb = tdb_open("seqnum_test.tdb", + 10000, + TDB_CLEAR_IF_FIRST| + TDB_SEQNUM| + TDB_INCOMPATIBLE_HASH| + TDB_MUTEX_LOCKING, + O_CREAT|O_RDWR, + 0644); + if (tdb == NULL) { + perror("tdb_open failed"); + return 1; + } + seqnum_before = tdb_get_seqnum(tdb); + + for (i=0; i<NPROCS; i++) { + pidsi = fork(); + if (pidsi == -1) { + perror("fork failed"); + return 1; + } + if (pidsi == 0) { + pid_t mypid = getpid(); + int ret; + int j; + + ret = tdb_reopen(tdb); + if (ret != 0) { + perror("tdb_reopen failed"); + return 1; + } + + for (j=0; j<NUMOPS; j++) { + TDB_DATA key = { + .dptr = (uint8_t *)&mypid, + .dsize = sizeof(mypid), + }; + TDB_DATA value = { + .dptr = (uint8_t *)&j, + .dsize = sizeof(j), + }; + ret = tdb_store(tdb, key, value, 0); + if (ret == -1) { + perror("tdb_store failed"); + return 1; + } + } + + return 0; + } + } + + for (i=0; i<NPROCS; i++) { + int wstatus; + pid_t ret = waitpid(pidsi, &wstatus, 0); + + if (ret == -1) { + perror("waitpid failed"); + return 1; + } + + if (!WIFEXITED(wstatus)) { + fprintf(stderr, + "pid %d did not exit properly\n", + (int)pidsi); + return 1; + } + + if (WEXITSTATUS(wstatus) != 0) { + fprintf(stderr, + "pid %d returned %d\n", + (int)pidsi, + WEXITSTATUS(wstatus)); + return 1; + } + } + + seqnum_after = tdb_get_seqnum(tdb); + + printf("seqnum_before=%"PRIu32", seqnum_after=%"PRIu32"\n", + seqnum_before, + seqnum_after); + + if ((seqnum_after - seqnum_before) != (NPROCS*NUMOPS)) { + perror("incrementing seqnum failed"); + return 1; + } + + return 0; +}
View file
_service:tar_scm:tdb-1.4.5.tar.gz/wscript -> _service:tar_scm:tdb-1.4.7.tar.gz/wscript
Changed
@@ -1,7 +1,7 @@ #!/usr/bin/env python APPNAME = 'tdb' -VERSION = '1.4.5' +VERSION = '1.4.7' import sys, os @@ -145,6 +145,11 @@ 'tdb', install=False) + bld.SAMBA_BINARY('tdbtortseq', + 'tools/tdbtortseq.c', + 'tdb', + install=False) + bld.SAMBA_BINARY('tdbrestore', 'tools/tdbrestore.c', 'tdb', manpages='man/tdbrestore.8')
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2