Compare commits

...

No commits in common. "c8s" and "c9-beta" have entirely different histories.
c8s ... c9-beta

8 changed files with 92 additions and 80 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/tree-1.7.0.tgz
SOURCES/tree-1.8.0.tgz

View File

@ -1 +1 @@
35bd212606e6c5d60f4d5062f4a59bb7b7b25949 SOURCES/tree-1.7.0.tgz
06934bf1f6a92af4eaec6bc61e568cec5e068ba1 SOURCES/tree-1.8.0.tgz

View File

@ -1,12 +1,16 @@
diff -up tree-1.6.0/tree.c.args tree-1.6.0/tree.c
--- tree-1.6.0/tree.c.args 2013-04-11 11:53:47.676572649 +0100
+++ tree-1.6.0/tree.c 2013-04-11 11:56:10.962350448 +0100
@@ -536,6 +536,8 @@ void usage(int n)
tree.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tree.c b/tree.c
index 5b56afe..3b4a263 100644
--- a/tree.c
+++ b/tree.c
@@ -653,6 +653,8 @@ void usage(int n)
" --filelimit # Do not descend dirs with more than # files in them.\n"
" --timefmt <f> Print and format time according to the format <f>.\n"
" -o filename Output to file instead of stdout.\n"
+ " --du Print directory sizes.\n"
+ " --prune Prune empty directories from the output.\n"
" -------- File options ---------\n"
" ------- File options -------\n"
" -q Print non-printable characters as '?'.\n"
" -N Print non-printable characters as is.\n"

View File

@ -1,7 +1,11 @@
diff -up tree-1.6.0/color.c.dircolors-ec tree-1.6.0/color.c
--- tree-1.6.0/color.c.dircolors-ec 2013-07-09 13:29:19.431819355 +0100
+++ tree-1.6.0/color.c 2013-07-09 13:29:48.820987889 +0100
@@ -190,7 +190,7 @@ void parse_dir_colors()
color.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/color.c b/color.c
index 67dedbe..bbcc9df 100644
--- a/color.c
+++ b/color.c
@@ -191,7 +191,7 @@ void parse_dir_colors()
if (!norm_flgs) norm_flgs = scopy("00");
if (!endcode) {

View File

@ -1,7 +1,11 @@
diff -up tree-1.6.0/Makefile.preserve-timestamps tree-1.6.0/Makefile
--- tree-1.6.0/Makefile.preserve-timestamps 2011-06-27 16:11:26.000000000 +0100
+++ tree-1.6.0/Makefile 2011-06-27 16:12:36.394443602 +0100
@@ -97,9 +97,9 @@ install: tree
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 842281e..ee7fbe6 100644
--- a/Makefile
+++ b/Makefile
@@ -112,9 +112,9 @@ install: tree
install -d $(BINDIR)
install -d $(MANDIR)
if [ -e $(TREE_DEST) ]; then \

View File

@ -1,7 +1,11 @@
diff -up tree-1.7.0/tree.c.size-field-len tree-1.7.0/tree.c
--- tree-1.7.0/tree.c.size-field-len 2014-04-25 16:30:51.539046882 +0100
+++ tree-1.7.0/tree.c 2014-04-25 16:32:20.098483921 +0100
@@ -1247,8 +1247,8 @@ int psize(char *buf, off_t size)
tree.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tree.c b/tree.c
index 3b4a263..11072ce 100644
--- a/tree.c
+++ b/tree.c
@@ -1280,8 +1280,8 @@ int psize(char *buf, off_t size)
if (hflag || siflag) {
for (idx=size<usize?0:1; size >= (usize*usize); idx++,size/=usize);
@ -9,6 +13,6 @@ diff -up tree-1.7.0/tree.c.size-field-len tree-1.7.0/tree.c
- else return sprintf(buf, ((size/usize) >= 10)? " %3.0f%c" : " %3.1f%c" , (float)size/(float)usize,unit[idx]);
+ if (!idx) return sprintf(buf, " %5d", (int)size);
+ else return sprintf(buf, ((size/usize) >= 10)? " %4.0f%c" : " %4.1f%c" , (float)size/(float)usize,unit[idx]);
} else return sprintf(buf, sizeof(off_t) == sizeof(long long)? " %11lld" : " %9ld", (long long int)size);
} else return sprintf(buf, sizeof(off_t) == sizeof(long long)? " %11lld" : " %9lld", (long long int)size);
}

View File

@ -4,43 +4,18 @@ Date: Tue, 6 Nov 2018 16:31:32 +0100
Subject: [PATCH] tree: fix programming mistakes detected by static analysis
---
color.c | 6 +++---
html.c | 5 +++--
json.c | 11 +++++------
tree.c | 2 +-
unix.c | 5 +++--
xml.c | 11 +++++------
6 files changed, 20 insertions(+), 20 deletions(-)
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/color.c b/color.c
index b4ef54e..04425dc 100644
--- a/color.c
+++ b/color.c
@@ -235,8 +235,8 @@ int cmd(char *s)
for(i=0;cmds[i].cmdnum;i++)
if (!strcmp(cmds[i].cmd,s)) return cmds[i].cmdnum;
- if (s[0] == '*') return DOT_EXTENSION;
- return ERROR;
+ if (s[0] == '*') return DOT_EXTENSION;
+ return ERROR;
}
int color(u_short mode, char *name, bool orphan, bool islink)
@@ -489,7 +489,7 @@ void initlinedraw(int flag)
for(linedraw=cstable;linedraw->name;++linedraw)
for(s=linedraw->name;*s;++s)
fprintf(stderr," %s\n",*s);
- return;
+ return;
}
if (charset) {
for(linedraw=cstable;linedraw->name;++linedraw)
diff --git a/html.c b/html.c
index 75e2ed1..35fb525 100644
--- a/html.c
+++ b/html.c
@@ -220,7 +220,7 @@ off_t html_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -221,7 +221,7 @@ off_t html_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
if (*(*dir)->lnk == '/')
listdir((*dir)->lnk,dt,ft,lev+1,dev);
else {
@ -49,7 +24,7 @@ index 75e2ed1..35fb525 100644
if (fflag && !strcmp(d,"/")) sprintf(path,"%s%s",d,(*dir)->lnk);
else sprintf(path,"%s/%s",d,(*dir)->lnk);
listdir(path,dt,ft,lev+1,dev);
@@ -253,7 +253,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -254,7 +254,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
{
struct _info **dir;
off_t size = 0;
@ -58,7 +33,7 @@ index 75e2ed1..35fb525 100644
dir = getfulltree(d, lev, dev, &size, &err);
@@ -261,6 +261,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -262,6 +262,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
htmlr_listdir(dir, d, dt, ft, lev);
@ -70,7 +45,7 @@ diff --git a/json.c b/json.c
index 4b15e0d..8c71324 100644
--- a/json.c
+++ b/json.c
@@ -97,8 +97,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -98,8 +98,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
while(*dir) {
if (!noindent) json_indent(lev);
@ -80,7 +55,7 @@ index 4b15e0d..8c71324 100644
for(t=0;ifmt[t];t++)
if (ifmt[t] == mt) break;
fprintf(outfile,"{\"type\":\"%s\"", ftype[t]);
@@ -140,7 +139,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -141,7 +140,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
if (*(*dir)->lnk == '/')
listdir((*dir)->lnk,dt,ft,lev+1,dev);
else {
@ -89,7 +64,7 @@ index 4b15e0d..8c71324 100644
if (fflag && !strcmp(d,"/")) sprintf(path,"%s%s",d,(*dir)->lnk);
else sprintf(path,"%s/%s",d,(*dir)->lnk);
listdir(path,dt,ft,lev+1,dev);
@@ -180,7 +179,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -181,7 +180,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
{
struct _info **dir;
off_t size = 0;
@ -98,7 +73,7 @@ index 4b15e0d..8c71324 100644
dir = getfulltree(d, lev, dev, &size, &err);
@@ -188,6 +187,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -189,6 +188,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
jsonr_listdir(dir, d, dt, ft, lev);
@ -106,7 +81,7 @@ index 4b15e0d..8c71324 100644
return size;
}
@@ -210,8 +210,7 @@ void jsonr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
@@ -211,8 +211,7 @@ void jsonr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
while(*dir) {
if (!noindent) json_indent(lev);
@ -120,20 +95,20 @@ diff --git a/tree.c b/tree.c
index 03140fe..73dd101 100644
--- a/tree.c
+++ b/tree.c
@@ -851,7 +851,7 @@ struct _info **getfulltree(char *d, u_long lev, dev_t dev, off_t *size, char **e
@@ -882,7 +882,7 @@ struct _info **unix_getfulltree(char *d, u_long lev, dev_t dev, off_t *size, cha
if (*(*dir)->lnk == '/')
(*dir)->child = getfulltree((*dir)->lnk,lev+1,dev,&((*dir)->size),&((*dir)->err));
(*dir)->child = unix_getfulltree((*dir)->lnk,lev+1,dev,&((*dir)->size),&((*dir)->err));
else {
- if (strlen(d)+strlen((*dir)->lnk)+2 > pathsize) path=xrealloc(path,pathsize=(strlen(d)+strlen((*dir)->name)+1024));
+ if (strlen(d)+strlen((*dir)->lnk)+2 > pathsize) path=xrealloc(path,pathsize=(strlen(d)+strlen((*dir)->lnk)+1024));
if (fflag && !strcmp(d,"/")) sprintf(path,"%s%s",d,(*dir)->lnk);
else sprintf(path,"%s/%s",d,(*dir)->lnk);
(*dir)->child = getfulltree(path,lev+1,dev,&((*dir)->size),&((*dir)->err));
(*dir)->child = unix_getfulltree(path,lev+1,dev,&((*dir)->size),&((*dir)->err));
diff --git a/unix.c b/unix.c
index ca5f76f..9476307 100644
--- a/unix.c
+++ b/unix.c
@@ -128,7 +128,7 @@ off_t unix_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -129,7 +129,7 @@ off_t unix_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
if (*(*dir)->lnk == '/')
listdir((*dir)->lnk,dt,ft,lev+1,dev);
else {
@ -142,7 +117,7 @@ index ca5f76f..9476307 100644
if (fflag && !strcmp(d,"/")) sprintf(path,"%s%s",d,(*dir)->lnk);
else sprintf(path,"%s/%s",d,(*dir)->lnk);
listdir(path,dt,ft,lev+1,dev);
@@ -161,7 +161,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -162,7 +162,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
{
struct _info **dir;
off_t size = 0;
@ -151,7 +126,7 @@ index ca5f76f..9476307 100644
dir = getfulltree(d, lev, dev, &size, &err);
@@ -169,6 +169,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -170,6 +170,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
r_listdir(dir, d, dt, ft, lev);
@ -163,7 +138,7 @@ diff --git a/xml.c b/xml.c
index 32f3c0c..512eed7 100644
--- a/xml.c
+++ b/xml.c
@@ -105,8 +105,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -106,8 +106,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
while(*dir) {
if (!noindent) xml_indent(lev);
@ -173,7 +148,7 @@ index 32f3c0c..512eed7 100644
for(t=0;ifmt[t];t++)
if (ifmt[t] == mt) break;
fprintf(outfile,"<%s", ftype[t]);
@@ -144,7 +143,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -145,7 +144,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
if (*(*dir)->lnk == '/')
listdir((*dir)->lnk,dt,ft,lev+1,dev);
else {
@ -182,7 +157,7 @@ index 32f3c0c..512eed7 100644
if (fflag && !strcmp(d,"/")) sprintf(path,"%s%s",d,(*dir)->lnk);
else sprintf(path,"%s/%s",d,(*dir)->lnk);
listdir(path,dt,ft,lev+1,dev);
@@ -180,7 +179,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -181,7 +180,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
{
struct _info **dir;
off_t size = 0;
@ -191,7 +166,7 @@ index 32f3c0c..512eed7 100644
dir = getfulltree(d, lev, dev, &size, &err);
@@ -188,6 +187,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
@@ -189,6 +188,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
xmlr_listdir(dir, d, dt, ft, lev);
@ -199,7 +174,7 @@ index 32f3c0c..512eed7 100644
return size;
}
@@ -210,8 +210,7 @@ void xmlr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
@@ -211,8 +211,7 @@ void xmlr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
while(*dir) {
if (!noindent) xml_indent(lev);

View File

@ -1,12 +1,13 @@
Summary: File system tree viewer
Name: tree
Version: 1.7.0
Release: 15%{?dist}
Version: 1.8.0
Release: 6%{?dist}
License: GPLv2+
URL: http://mama.indstate.edu/users/ice/tree/
Source: ftp://mama.indstate.edu/linux/tree/tree-%{version}.tgz
BuildRequires: gcc
BuildRequires: make
# Preserve timestamp on man page.
Patch2: tree-preserve-timestamps.patch
@ -21,7 +22,7 @@ Patch6: tree-dircolors-ec.patch
# are used (bug #997937).
Patch7: tree-size-field-len.patch
# fix programming mistakes detected by static analysis (#1602718)
# fix programming mistakes detected by static analysis
Patch8: tree-static-analysis.patch
%description
@ -36,15 +37,14 @@ utility.
sed -e 's/LINUX/__linux__/' -i tree.c
%build
make CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)" \
LDFLAGS="$RPM_LD_FLAGS" %{?_smp_mflags}
%set_build_flags
%make_build CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)"
%install
mkdir -p $RPM_BUILD_ROOT%{_bindir}
make BINDIR=$RPM_BUILD_ROOT%{_bindir} \
MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 \
install
%make_install BINDIR=$RPM_BUILD_ROOT%{_bindir} \
MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1
chmod -x $RPM_BUILD_ROOT%{_mandir}/man1/tree.1
@ -54,8 +54,29 @@ chmod -x $RPM_BUILD_ROOT%{_mandir}/man1/tree.1
%doc README LICENSE
%changelog
* Wed Nov 07 2018 Kamil Dudka <kdudka@redhat.com> - 1.7.0-15
- fix programming mistakes detected by static analysis (#1602718)
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Dec 13 2018 Kamil Dudka <kdudka@redhat.com> - 1.8.0-1
- update to the latest upstream release
* Wed Nov 07 2018 Kamil Dudka <kdudka@redhat.com> - 1.7.0-16
- fix programming mistakes detected by static analysis
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 23 2018 Florian Weimer <fweimer@redhat.com> - 1.7.0-14
- Use LDFLAGS from redhat-rpm-config