Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package tree for openSUSE:Factory checked in 
at 2022-02-17 23:40:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/tree (Old)
 and      /work/SRC/openSUSE:Factory/.tree.new.1958 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "tree"

Thu Feb 17 23:40:33 2022 rev:25 rq:955709 version:2.0.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/tree/tree.changes        2022-01-06 
15:51:04.240964251 +0100
+++ /work/SRC/openSUSE:Factory/.tree.new.1958/tree.changes      2022-02-17 
23:42:17.907700034 +0100
@@ -1,0 +2,9 @@
+Thu Feb 17 19:27:53 UTC 2022 - Andreas Stieger <andreas.stie...@gmx.de>
+
+- tree 2.0.2:
+  * stddata option now requires STDDATA_FD to be set
+  * Fix HTML url output issue
+  * Fix an error with * in the patchmatch code where *foo*bar
+    would match *foo alone
+
+-------------------------------------------------------------------

Old:
----
  tree-2.0.1.tgz

New:
----
  tree-2.0.2.tgz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ tree.spec ++++++
--- /var/tmp/diff_new_pack.yQH2Z1/_old  2022-02-17 23:42:18.471700030 +0100
+++ /var/tmp/diff_new_pack.yQH2Z1/_new  2022-02-17 23:42:18.475700029 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           tree
-Version:        2.0.1
+Version:        2.0.2
 Release:        0
 Summary:        File listing as a tree
 License:        GPL-2.0-or-later

++++++ tree-2.0.1.tgz -> tree-2.0.2.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/CHANGES new/tree-2.0.2/CHANGES
--- old/tree-2.0.1/CHANGES      2022-01-03 22:30:53.000000000 +0100
+++ new/tree-2.0.2/CHANGES      2022-02-16 22:45:05.000000000 +0100
@@ -1,3 +1,16 @@
+Version 2.0.2 (02/16/2022)
+  - Okay, apparently the stddata addition is causing havoc (who knew how many
+    scripts just haphazardly hand programs random file descriptors, that's
+    surely not a problem.)  Going forward the stddata option will only work
+    if the environment variable STDDATA_FD is present or set to the descriptor
+    to produce the JSON output on.
+  - Fix HTML url output issue. (Maxim Cournoyer)  It was definitely broken in
+    the 2.0.0 release, and this should normalize it with respect to older
+    versions, however I think it needs to be updated to work better.
+  - Update MANPATH for OS X (Michiel Beijen)
+  - Fixed an error with * in the patchmatch code where *foo*bar would match
+    *foo alone. (Josey Smith)
+
 Version 2.0.1 (01/03/2022)
   - Simplify Makefile and the following changes: prefix -> PREFIX,
     BINDIR -> DESTDIR, -O4 -> -O3, mode 644 for man page installation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/Makefile new/tree-2.0.2/Makefile
--- old/tree-2.0.1/Makefile     2022-01-03 20:11:10.000000000 +0100
+++ new/tree-2.0.2/Makefile     2022-02-16 22:45:43.000000000 +0100
@@ -21,10 +21,11 @@
 CC=gcc
 INSTALL=install
 
-VERSION=2.0.1
+VERSION=2.0.2
 TREE_DEST=tree
 DESTDIR=${PREFIX}/bin
 MAN=tree.1
+# Probably needs to be ${PREFIX}/share/man for most systems now
 MANDIR=${PREFIX}/man
 OBJS=tree.o list.o hash.o color.o file.o filter.o info.o unix.o xml.o json.o 
html.o strverscmp.o
 
@@ -62,7 +63,7 @@
 #CC=cc
 #CFLAGS=-O2 -Wall -fomit-frame-pointer -no-cpp-precomp
 #LDFLAGS=
-#MANDIR=/usr/share/man
+#MANDIR=${PREFIX}/share/man
 
 # Uncomment for HP/UX:
 #prefix=/opt
@@ -70,7 +71,7 @@
 # manpage of mbsrtowcs() requires C99 and the two defines
 #CFLAGS=+w -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200112 -AC99
 #LDFLAGS=
-#MANDIR=${prefix}/share/man
+#MANDIR=${PREFIX}/share/man
 
 # Uncomment for OS/2:
 #CFLAGS=-02 -Wall -fomit-frame-pointer -Zomf -Zsmall-conv
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/README new/tree-2.0.2/README
--- old/tree-2.0.1/README       2022-01-03 22:27:14.000000000 +0100
+++ new/tree-2.0.2/README       2022-02-16 22:50:42.000000000 +0100
@@ -210,7 +210,7 @@
 Alyssa Ross
   - Suggested adding support for BSD's CLICOLOR and CLICOLOR_FORCE environment
     variables.
-    
+
 Tom???? Ber??nek
   - Make sure we always use xmalloc / xrealloc
 
@@ -248,10 +248,18 @@
 Michiel Beijen (and others)
   - Suggest Support multiple -I and -P instances.
   - Suggest that / match directories in patterns (also Taylor Faubion)
+  - Suggested to update MANPATH for OS X
 
 Michal Vasilek
   - Various Makefile fixes
 
+Josey Smith
+  - Reported an error with * in the patchmatch code where *foo*bar would match
+    *foo alone.
+
+Maxim Cournoyer
+ - Reported HTML url output issue w/ 2.0.0-2.0.1
+
 And many others whom I've failed to keep track of.  I should have started
 this list years ago.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/color.c new/tree-2.0.2/color.c
--- old/tree-2.0.1/color.c      2022-01-03 20:09:33.000000000 +0100
+++ new/tree-2.0.2/color.c      2022-01-05 01:41:38.000000000 +0100
@@ -187,6 +187,8 @@
   };
   int i;
 
+  if (s == NULL) return ERROR;  // Probably can't happen
+
   if (s[0] == '*') return DOT_EXTENSION;
   for(i=0;cmds[i].cmdnum;i++) {
     if (!strcmp(cmds[i].cmd,s)) return cmds[i].cmdnum;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/doc/tree.1 new/tree-2.0.2/doc/tree.1
--- old/tree-2.0.1/doc/tree.1   2022-01-03 22:29:45.000000000 +0100
+++ new/tree-2.0.2/doc/tree.1   2022-02-15 01:18:37.000000000 +0100
@@ -422,6 +422,8 @@
 \fBLC_TIME\fP          Locale for timefmt output, see \fBstrftime\fP(3).
 .br
 \fBTZ\fP                       Timezone for timefmt output, see 
\fBstrftime\fP(3).
+.br
+\fBSTDDATA_FD\fP       Enable the stddata feature, optionally set descriptor 
to use.
 
 .SH AUTHOR
 Steve Baker (i...@mama.indstate.edu)
@@ -453,9 +455,11 @@
 Probably more.
 
 As of version 2.0.0, in Linux, tree will attempt to automatically output a
-compact JSON tree on file descriptor 3 (what I call stddata,) if present.  It
-is hoped that some day a better Linux/Unix shell may take advantage of this
-feature, though BSON would probably be a better format for this.
+compact JSON tree on file descriptor 3 (what I call stddata,) if present and 
the
+environment variable STDDATA_FD is defined or set to a positive non-zero file
+descriptor value to use to output on.  It is hoped that some day a better
+Linux/Unix shell may take advantage of this feature, though BSON would probably
+be a better format for this.
 
 .SH SEE ALSO
 .BR dircolors (1),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/html.c new/tree-2.0.2/html.c
--- old/tree-2.0.1/html.c       2022-01-03 20:09:50.000000000 +0100
+++ new/tree-2.0.2/html.c       2022-02-16 22:34:22.000000000 +0100
@@ -32,6 +32,8 @@
 extern char *endcode;
 extern const struct linedraw *linedraw;
 
+int htmldirlen = 0;
+
 char *class(struct _info *info)
 {
   return
@@ -122,7 +124,7 @@
        " </style>\n"
        "</head>\n"
        "<body>\n"
-       "\t<h1>%s</h1><p>\n\t",charset ? charset : "iso-8859-1", version, 
title, title);
+       "\t<h1>%s</h1><p>\n",charset ? charset : "iso-8859-1", version, title, 
title);
 }
 
 void html_outtro(void)
@@ -184,15 +186,22 @@
 
     if (!nolinks) {
       fprintf(outfile," href=\"%s",host);
-      if (dirname != NULL) url_encode(outfile, dirname+1);
-      putc('/',outfile);
-      url_encode(outfile, filename);
-      fprintf(outfile,"%s%s\"",(descend? "/00Tree.html" : ""), 
(file->isdir?"/":""));
+      if (dirname != NULL) {
+       int len = strlen(dirname);
+       int off = (len >= htmldirlen? htmldirlen : 0);
+       url_encode(outfile, dirname + off);
+       putc('/',outfile);
+       url_encode(outfile, filename);
+       fprintf(outfile,"%s%s\"",(descend > 1? "/00Tree.html" : ""), 
(file->isdir?"/":""));
+      } else {
+       fprintf(outfile,"%s\"",(descend > 1? "/00Tree.html" : ""));
+      }
     }
   }
   fprintf(outfile, ">");
-  
-  html_encode(outfile,filename);
+
+  if (dirname) html_encode(outfile,filename);
+  else html_encode(outfile, host);
 
   fprintf(outfile,"</a>");
   return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/list.c new/tree-2.0.2/list.c
--- old/tree-2.0.1/list.c       2022-01-03 20:13:51.000000000 +0100
+++ new/tree-2.0.2/list.c       2022-02-16 22:07:58.000000000 +0100
@@ -19,13 +19,14 @@
 #include "tree.h"
 
 extern bool dflag, lflag, pflag, sflag, Fflag, aflag, fflag, uflag, gflag;
-extern bool Dflag, inodeflag, devflag, Rflag, duflag, pruneflag, metafirst;
+extern bool Dflag, Hflag, inodeflag, devflag, Rflag, duflag, pruneflag, 
metafirst;
 extern bool hflag, siflag, noreport, noindent, force_color, xdev, nolinks, 
flimit;
 
 extern struct _info **(*getfulltree)(char *d, u_long lev, dev_t dev, off_t 
*size, char **err);
 extern int (*topsort)();
 extern FILE *outfile;
 extern int Level, *dirs, maxdirs, errors;
+extern int htmldirlen;
 
 extern bool colorize, linktargetcolor;
 extern char *endcode;
@@ -74,6 +75,7 @@
        if (j > 1 && dirname[i][j-1] == '/') dirname[i][--j] = 0;
       } while (j > 1 && dirname[i][j-1] == '/');
     }
+    if (Hflag) htmldirlen = strlen(dirname[i]);
 
     if ((n = lstat(dirname[i],&st)) >= 0) {
       saveino(st.st_ino, st.st_dev);
@@ -192,7 +194,7 @@
 
            memcpy(dirs, dirsave, sizeof(int) * (lev+1));
            free(dirsave);
-           htmldescend = 1;
+           htmldescend = 10;
          } else htmldescend = 0;
          descend = 0;
        }
@@ -219,7 +221,7 @@
       }
     } else tot.files++;
 
-    needsclosed = lc.printfile(dirname, filename, *dir, descend | htmldescend);
+    needsclosed = lc.printfile(dirname, filename, *dir, descend + htmldescend);
     if (err) lc.error(err);
 
     if (descend) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/tree.c new/tree-2.0.2/tree.c
--- old/tree-2.0.1/tree.c       2022-01-03 20:12:51.000000000 +0100
+++ new/tree-2.0.2/tree.c       2022-02-15 03:15:04.000000000 +0100
@@ -19,8 +19,8 @@
 
 #include "tree.h"
 
-char *version ="$Version: $ tree v2.0.1 (c) 1996 - 2022 by Steve Baker, Thomas 
Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro $";
-char *hversion="\t\t tree v2.0.1 %s 1996 - 2022 by Steve Baker and Thomas 
Moore <br>\n"
+char *version ="$Version: $ tree v2.0.2 (c) 1996 - 2022 by Steve Baker, Thomas 
Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro $";
+char *hversion="\t\t tree v2.0.2 %s 1996 - 2022 by Steve Baker and Thomas 
Moore <br>\n"
                      "\t\t HTML output hacked and copyleft %s 1998 by Francesc 
Rocher <br>\n"
                      "\t\t JSON output hacked and copyleft %s 2014 by Florian 
Sesser <br>\n"
                      "\t\t Charsets / OS/2 support %s 2001 by Kyosuke 
Tokoro\n";
@@ -135,14 +135,19 @@
 
 #ifdef __linux__
   // Output JSON automatically to "stddata" if present:
-  if (fcntl(STDDATA_FILENO, F_GETFD) >= 0) {
-    Jflag = noindent = TRUE;
-    _nl = "";
-    lc = (struct listingcalls){
-      json_intro, json_outtro, json_printinfo, json_printfile, json_error, 
json_newline,
-      json_close, json_report
-    };
-    outfile = fdopen(STDDATA_FILENO, "w");
+  char *stddata_fd = getenv(ENV_STDDATA_FD);
+  if (stddata_fd != NULL) {
+    int std_fd = atoi(stddata_fd);
+    if (std_fd <= 0) std_fd = STDDATA_FILENO;
+    if (fcntl(std_fd, F_GETFD) >= 0) {
+      Jflag = noindent = TRUE;
+      _nl = "";
+      lc = (struct listingcalls){
+       json_intro, json_outtro, json_printinfo, json_printfile, json_error, 
json_newline,
+       json_close, json_report
+      };
+      outfile = fdopen(std_fd, "w");
+    }
   }
 #endif
 
@@ -670,8 +675,13 @@
  */
 int patinclude(char *name, int isdir)
 {
+//  printf("%s ", name);
   for(int i=0; i < pattern; i++)
-    if (patmatch(name, patterns[i], isdir)) return 1;
+    if (patmatch(name, patterns[i], isdir)) {
+//      printf("included\n");
+      return 1;
+    }
+//  printf("failed include\n");
   return 0;
 }
 
@@ -1095,7 +1105,6 @@
   char pprev = 0;
 
   /* If a bar is found, call patmatch recursively on the two sub-patterns */
-
   if (bar) {
     /* If the bar is the first or last character, it's a syntax error */
     if (bar == pat || !bar[1]) {
@@ -1143,6 +1152,7 @@
     case '*':
       pat++;
       if(!*pat) return 1;
+      match = 0;
       /* "Support" ** for .gitignore support, mostly the same as *: */
       if (*pat == '*') {
        pat++;
@@ -1156,8 +1166,9 @@
        }
       } else {
        while(*buf && !(match = patmatch(buf++, pat, isdir)));
-       if (!*buf && !match) match = patmatch(buf, pat, isdir);
+//     if (!*buf && !match) match = patmatch(buf, pat, isdir);
       }
+      if (!*buf && !match) match = patmatch(buf, pat, isdir);
       return match;
     case '?':
       if(!*buf) return 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tree-2.0.1/tree.h new/tree-2.0.2/tree.h
--- old/tree-2.0.1/tree.h       2022-01-03 20:11:27.000000000 +0100
+++ new/tree-2.0.2/tree.h       2022-02-15 00:47:18.000000000 +0100
@@ -71,6 +71,7 @@
 
 #ifdef __linux__
 #include <fcntl.h>
+# define ENV_STDDATA_FD  "STDDATA_FD"
 # ifndef STDDATA_FILENO
 #  define STDDATA_FILENO 3
 # endif

Reply via email to