Hello community, here is the log from the commit of package diffstat checked in at Thu Jul 27 17:55:39 CEST 2006. -------- --- diffstat/diffstat.changes 2006-01-25 21:35:30.000000000 +0100 +++ diffstat/diffstat.changes 2006-07-27 16:29:58.000000000 +0200 @@ -1,0 +2,14 @@ +Thu Jul 27 15:33:59 CEST 2006 - mjancar@suse.cz + +- update to 1.43 + * fix to avoid modifying data which is being used by tsearch() for + ordering the binary tree (report by Adrian Bunk). + * do not ignore pathnames in /tmp/, since some tools create usable + pathnames for both old/new files there (Debian #376086). + * correct ifdef for fgetc_unlocked(). + * updated configure macros CF_GCC_VERSION, CF_PATH_SYNTAX and + CF_XOPEN_SOURCE + * add configure check for compress, gzip and bzip2 programs that may be + used to decompress files. + +------------------------------------------------------------------- Old: ---- diffstat-1.41.diff diffstat-1.41.tar.bz2 New: ---- diffstat-1.43.diff diffstat-1.43.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ diffstat.spec ++++++ --- /var/tmp/diff_new_pack.0zY3RU/_old 2006-07-27 17:55:31.000000000 +0200 +++ /var/tmp/diff_new_pack.0zY3RU/_new 2006-07-27 17:55:31.000000000 +0200 @@ -1,30 +1,30 @@ # -# spec file for package diffstat (Version 1.41) +# spec file for package diffstat (Version 1.43) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # -# Please submit bugfixes or comments via http://bugs.opensuse.org +# Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: diffstat -Version: 1.41 +Version: 1.43 Release: 1 Autoreqprov: on Group: Productivity/Text/Utilities License: distributable URL: http://dickey.his.com/diffstat/diffstat.html -Summary: A utility which provides statistics based on the output of diff +Summary: Utility That Provides Statistics Based on the Output of diff Source: %{name}-%{version}.tar.bz2 Patch: %{name}-%{version}.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -Diffstat reads the output of the diff command and displays a histogram -of the insertions, deletions and modifications in each file. +diffstat reads the output of the diff command and displays a histogram +of the insertions, deletions, and modifications in each file. @@ -58,6 +58,17 @@ %{_bindir}/* %changelog -n diffstat +* Thu Jul 27 2006 - mjancar@suse.cz +- update to 1.43 + * fix to avoid modifying data which is being used by tsearch() for + ordering the binary tree (report by Adrian Bunk). + * do not ignore pathnames in /tmp/, since some tools create usable + pathnames for both old/new files there (Debian #376086). + * correct ifdef for fgetc_unlocked(). + * updated configure macros CF_GCC_VERSION, CF_PATH_SYNTAX and + CF_XOPEN_SOURCE + * add configure check for compress, gzip and bzip2 programs that may be + used to decompress files. * Wed Jan 25 2006 - mls@suse.de - converted neededforbuild to BuildRequires * Thu Jan 12 2006 - mjancar@suse.cz ++++++ diffstat-1.41.diff -> diffstat-1.43.diff ++++++ ++++++ diffstat-1.41.tar.bz2 -> diffstat-1.43.tar.bz2 ++++++ ++++ 2464 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/diffstat-1.41/CHANGES new/diffstat-1.43/CHANGES --- old/diffstat-1.41/CHANGES 2005-08-24 21:27:30.000000000 +0200 +++ new/diffstat-1.43/CHANGES 2006-07-17 01:55:06.000000000 +0200 @@ -1,3 +1,23 @@ +16-Jul-2006 + diffstat 1.43 + + fix to avoid modifying data which is being used by tsearch() for + ordering the binary tree (report by Adrian Bunk). + +02-Jul-2006 + diffstat 1.42 + + do not ignore pathnames in /tmp/, since some tools create usable + pathnames for both old/new files there (Debian #376086). + + correct ifdef for fgetc_unlocked(). + + updated configure macros CF_GCC_VERSION, CF_PATH_SYNTAX and + CF_XOPEN_SOURCE + + add configure check for compress, gzip and bzip2 programs that may be + used to decompress files. + 24-Aug-2005 diffstat 1.41 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/diffstat-1.41/configure.in new/diffstat-1.43/configure.in --- old/diffstat-1.41/configure.in 2005-08-16 02:39:37.000000000 +0200 +++ new/diffstat-1.43/configure.in 2006-07-02 17:55:37.000000000 +0200 @@ -1,7 +1,7 @@ dnl Process this file with 'autoconf' to produce a 'configure' script -dnl $Id: configure.in,v 1.10 2005/08/16 00:39:37 tom Exp $ +dnl $Id: configure.in,v 1.11 2006/07/02 15:55:37 tom Exp $ AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.10 $) +AC_REVISION($Revision: 1.11 $) AC_INIT(diffstat.c) AC_CONFIG_HEADER(config.h:config_h.in) @@ -13,6 +13,11 @@ CF_PROG_EXT CF_WITH_INSTALL_PREFIX +with_full_paths=no +CF_PATH_PROG(COMPRESS, compress, gzip) +CF_PATH_PROG(GZIP, gzip) +CF_PATH_PROG(BZIP, bzip2) + CF_XOPEN_SOURCE CF_WITH_WARNINGS diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/diffstat-1.41/diffstat.c new/diffstat-1.43/diffstat.c --- old/diffstat-1.41/diffstat.c 2005-08-24 22:47:34.000000000 +0200 +++ new/diffstat-1.43/diffstat.c 2006-07-17 01:56:47.000000000 +0200 @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright 1994-2004,2005 by Thomas E. Dickey * + * Copyright 1994-2005,2006 by Thomas E. Dickey * * All Rights Reserved. * * * * Permission to use, copy, modify, and distribute this software and its * @@ -20,7 +20,7 @@ ******************************************************************************/ #ifndef NO_IDENT -static const char *Id = "$Id: diffstat.c,v 1.41 2005/08/24 20:47:34 tom Exp $"; +static const char *Id = "$Id: diffstat.c,v 1.43 2006/07/16 23:56:47 tom Exp $"; #endif /* @@ -28,6 +28,15 @@ * Author: T.E.Dickey * Created: 02 Feb 1992 * Modified: + * 16 Jul 2006, fix to avoid modifying which is being used by + * tsearch() for ordering the binary tree (report by + * Adrian Bunk). + * 02 Jul 2006, do not ignore pathnames in /tmp/, since some tools + * create usable pathnames for both old/new files + * there (Debian #376086). Correct ifdef for + * fgetc_unlocked(). Add configure check for + * compress, gzip and bzip2 programs that may be used + * to decompress files. * 24 Aug 2005, update usage message for -l, -r changes. * 15 Aug 2005, apply PLURAL() to num_files (Jean Delvare). * add -l option (request by Michael Burian). @@ -155,8 +164,8 @@ #undef HAVE_TSEARCH #endif -#ifdef HAVE_FGETC_LOCKED -#define MY_FGETC fgetc_locked +#ifdef HAVE_FGETC_UNLOCKED +#define MY_FGETC fgetc_unlocked #else #define MY_FGETC fgetc #endif @@ -174,6 +183,18 @@ #define EXIT_FAILURE 1 #endif +#ifndef COMPRESS_PATH +#define COMPRESS_PATH "" +#endif + +#ifndef GZIP_PATH +#define GZIP_PATH "" +#endif + +#ifndef BZIP_PATH +#define BZIP_PATH "" +#endif + /******************************************************************************/ #ifdef WIN32 @@ -293,19 +314,47 @@ return strcmp(p->name + p->base, q->name + q->base); } +static void +init_data(DATA * data, char *name, int base) +{ + memset(data, 0, sizeof(*data)); + data->name = name; + data->base = base; + data->cmt = Normal; +} + static DATA * new_data(char *name, int base) { DATA *r = (DATA *) xmalloc(sizeof(DATA)); - memset(r, 0, sizeof(*r)); - r->name = new_string(name); - r->base = base; - r->cmt = Normal; + init_data(r, new_string(name), base); return r; } +#ifdef HAVE_TSEARCH +static DATA * +add_tsearch_data(char *name, int base) +{ + DATA find; + DATA *result; + void *pp; + + init_data(&find, name, base); + if ((pp = tfind(&find, &sorted_data, compare_data)) != 0) { + result = *(DATA **) pp; + return result; + } + result = new_data(name, base); + (void) tsearch(result, &sorted_data, compare_data); + result->link = all_data; + all_data = result; + + return result; +} +#endif + static DATA * find_data(char *name) { @@ -328,14 +377,6 @@ TRACE(("base set to %d\n", base)); } - /* - * Setup parameter for compare_data(). - */ - memset(&find, 0, sizeof(find)); - find.name = name; - find.base = base; - find.cmt = Normal; - /* Insert into sorted list (usually sorted). If we are not sorting or * merging names, we fall off the end and link the new entry to the end of * the list. If the prefix option is used, the prefix is ignored by the @@ -346,18 +387,11 @@ */ #ifdef HAVE_TSEARCH if (use_tsearch) { - void *pp; - if ((pp = tfind(&find, &sorted_data, compare_data)) != 0) { - p = *(DATA **) pp; - return p; - } - r = new_data(name, base); - (void) tsearch(r, &sorted_data, compare_data); - r->link = all_data; - all_data = r; + r = add_tsearch_data(name, base); } else #endif { + init_data(&find, name, base); for (p = all_data, q = 0; p != 0; q = p, p = p->link) { int cmp = compare_data(p, &find); if (merge_names && (cmp == 0)) @@ -388,9 +422,10 @@ TRACE(("delink '%s'\n", data->name)); #ifdef HAVE_TSEARCH - if (use_tsearch) + if (use_tsearch) { if (tdelete(data, &sorted_data, compare_data) == 0) return 0; + } #endif for (p = all_data, q = 0; p != 0; q = p, p = p->link) { if (p == data) { @@ -482,11 +517,11 @@ static int can_be_merged(const char *path) { + int result = 0; if (strcmp(path, "") - && strcmp(path, "/dev/null") - && strncmp(path, "/tmp/", 5)) - return 1; - return 0; + && strcmp(path, "/dev/null")) + result = 1; + return result; } static int @@ -518,13 +553,36 @@ unsigned n; int matched = 0; int diff = 0; + int local = 0; - /* strip suffixes such as ".orig", ".bak" */ + /* + * Strip suffixes such as ".orig", ".bak", "~", etc. The current + * data for the merge is in 'path'. The previous data (in + * 'data->name') may also be a temporary filename (which would not + * be merged since it has no apparent relationship to the current). + */ if (len1 > len2) { if (!strncmp(data->name, path, len2)) { TRACE(("trimming data '%s' to '%.*s'\n", data->name, (int) len2, data->name)); - data->name[len1 = len2] = EOS; + len1 = len2; +#ifdef HAVE_TSEARCH + /* + * If we are using tsearch(), make a local copy of the data + * so we can trim it without interfering with tsearch's + * notion of the ordering of data. That will create some + * spurious empty data, so we add the changed() macro in a + * few places to skip over those. + */ + if (use_tsearch) { + char *trim = new_string(data->name); + trim[len1] = EOS; + data = add_tsearch_data(trim, data->base); + free(trim); + local = 1; + } else +#endif + data->name[len1] = EOS; } } else if (len1 < len2) { if (!strncmp(data->name, path, len1)) { @@ -548,7 +606,8 @@ && diff) path += len2 - matched + 1; - *freed = delink(data); + if (!local) + *freed = delink(data); TRACE(("merge @%d, prefix_opt=%d matched=%d diff=%d\n", __LINE__, prefix_opt, matched, diff)); } else if (!can_be_merged(path)) { @@ -1174,12 +1233,16 @@ } } +#define changed(p) (!merge_names || (p)->cmt != Normal || (InsOf(p) + DelOf(p) + ModOf(p)) != 0) + static void show_data(const DATA * p) { char *name = p->name + (prefix_opt >= 0 ? p->base : prefix_len); - if (table_opt) { + if (!changed(p)) { + ; + } else if (table_opt) { if (names_only) { printf("%s\n", name); } else { @@ -1234,6 +1297,9 @@ for (p = all_data; p; p = p->link) { int len = strlen(p->name); + if (!changed(p)) + continue; + /* * "-p0" gives the whole pathname unmodified. "-p1" strips * through the first path-separator, etc. @@ -1319,15 +1385,15 @@ size_t len = strlen(name); if (len > 2 && !strcmp(name + len - 2, ".Z")) { - verb = "compress -dc %s"; + verb = COMPRESS_PATH; } else if (len > 3 && !strcmp(name + len - 3, ".gz")) { - verb = "gzip -dc %s"; + verb = GZIP_PATH; } else if (len > 4 && !strcmp(name + len - 4, ".bz2")) { - verb = "bzip2 -dc %s"; + verb = BZIP_PATH; } - if (verb != 0) { - result = (char *) xmalloc(strlen(verb) + len); - sprintf(result, verb, name); + if (verb != 0 && *verb != '\0') { + result = (char *) xmalloc(strlen(verb) + 10 + len); + sprintf(result, "%s -dc %s", verb, name); } return result; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/diffstat-1.41/testing/run_test.sh new/diffstat-1.43/testing/run_test.sh --- old/diffstat-1.41/testing/run_test.sh 2005-08-14 19:50:38.000000000 +0200 +++ new/diffstat-1.43/testing/run_test.sh 2006-07-02 17:04:48.000000000 +0200 @@ -1,9 +1,16 @@ #!/bin/sh -# $Id: run_test.sh,v 1.11 2005/08/14 17:50:38 tom Exp $ +# $Id: run_test.sh,v 1.12 2006/07/02 15:04:48 tom Exp $ # Test-script for DIFFSTAT + +# change this for ad hoc testing of compression +#TYPE=.pat.Z +#TYPE=.pat.gz +#TYPE=.pat.bz2 +TYPE=.pat + if [ $# = 0 ] then - eval '"$0" *.pat' + eval '"$0" *${TYPE}' exit fi PATH=`cd ..;pwd`:$PATH; export PATH @@ -12,11 +19,11 @@ for item in $* do - echo "testing `basename $item .pat`" + echo "testing `basename $item $TYPE`" for OPTS in "" "-p1" "-p9" "-f0" "-u" "-k" "-r1" "-r2" do - NAME=`echo $item | sed -e 's/.pat$//'` - DATA=$NAME.pat + NAME=`echo $item | sed -e 's/'$TYPE'$//'` + DATA=${NAME}${TYPE} if [ ".$OPTS" != "." ] ; then NAME=$NAME`echo ./$OPTS|sed -e 's@./-@@'` fi ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit-unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit-help@opensuse.org