Compare commits
No commits in common. "c9-beta" and "c8s" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/tree-1.8.0.tgz
|
||||
SOURCES/tree-1.7.0.tgz
|
||||
|
@ -1 +1 @@
|
||||
06934bf1f6a92af4eaec6bc61e568cec5e068ba1 SOURCES/tree-1.8.0.tgz
|
||||
35bd212606e6c5d60f4d5062f4a59bb7b7b25949 SOURCES/tree-1.7.0.tgz
|
||||
|
@ -1,16 +1,12 @@
|
||||
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)
|
||||
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)
|
||||
" --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"
|
||||
|
@ -1,11 +1,7 @@
|
||||
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()
|
||||
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()
|
||||
if (!norm_flgs) norm_flgs = scopy("00");
|
||||
|
||||
if (!endcode) {
|
||||
|
@ -1,11 +1,7 @@
|
||||
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
|
||||
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
|
||||
install -d $(BINDIR)
|
||||
install -d $(MANDIR)
|
||||
if [ -e $(TREE_DEST) ]; then \
|
||||
|
@ -1,11 +1,7 @@
|
||||
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)
|
||||
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)
|
||||
|
||||
if (hflag || siflag) {
|
||||
for (idx=size<usize?0:1; size >= (usize*usize); idx++,size/=usize);
|
||||
@ -13,6 +9,6 @@ index 3b4a263..11072ce 100644
|
||||
- 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" : " %9lld", (long long int)size);
|
||||
} else return sprintf(buf, sizeof(off_t) == sizeof(long long)? " %11lld" : " %9ld", (long long int)size);
|
||||
}
|
||||
|
||||
|
@ -4,18 +4,43 @@ 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 +++++------
|
||||
5 files changed, 17 insertions(+), 17 deletions(-)
|
||||
6 files changed, 20 insertions(+), 20 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
|
||||
@@ -221,7 +221,7 @@ off_t html_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -220,7 +220,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 {
|
||||
@ -24,7 +49,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);
|
||||
@@ -254,7 +254,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -253,7 +253,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
{
|
||||
struct _info **dir;
|
||||
off_t size = 0;
|
||||
@ -33,7 +58,7 @@ index 75e2ed1..35fb525 100644
|
||||
|
||||
dir = getfulltree(d, lev, dev, &size, &err);
|
||||
|
||||
@@ -262,6 +262,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -261,6 +261,7 @@ off_t html_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
|
||||
htmlr_listdir(dir, d, dt, ft, lev);
|
||||
|
||||
@ -45,7 +70,7 @@ diff --git a/json.c b/json.c
|
||||
index 4b15e0d..8c71324 100644
|
||||
--- a/json.c
|
||||
+++ b/json.c
|
||||
@@ -98,8 +98,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -97,8 +97,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
while(*dir) {
|
||||
if (!noindent) json_indent(lev);
|
||||
|
||||
@ -55,7 +80,7 @@ index 4b15e0d..8c71324 100644
|
||||
for(t=0;ifmt[t];t++)
|
||||
if (ifmt[t] == mt) break;
|
||||
fprintf(outfile,"{\"type\":\"%s\"", ftype[t]);
|
||||
@@ -141,7 +140,7 @@ off_t json_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -140,7 +139,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 {
|
||||
@ -64,7 +89,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);
|
||||
@@ -181,7 +180,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -180,7 +179,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
{
|
||||
struct _info **dir;
|
||||
off_t size = 0;
|
||||
@ -73,7 +98,7 @@ index 4b15e0d..8c71324 100644
|
||||
|
||||
dir = getfulltree(d, lev, dev, &size, &err);
|
||||
|
||||
@@ -189,6 +188,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -188,6 +187,7 @@ off_t json_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
|
||||
jsonr_listdir(dir, d, dt, ft, lev);
|
||||
|
||||
@ -81,7 +106,7 @@ index 4b15e0d..8c71324 100644
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -211,8 +211,7 @@ void jsonr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
|
||||
@@ -210,8 +210,7 @@ void jsonr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
|
||||
while(*dir) {
|
||||
if (!noindent) json_indent(lev);
|
||||
|
||||
@ -95,20 +120,20 @@ diff --git a/tree.c b/tree.c
|
||||
index 03140fe..73dd101 100644
|
||||
--- a/tree.c
|
||||
+++ b/tree.c
|
||||
@@ -882,7 +882,7 @@ struct _info **unix_getfulltree(char *d, u_long lev, dev_t dev, off_t *size, cha
|
||||
@@ -851,7 +851,7 @@ struct _info **getfulltree(char *d, u_long lev, dev_t dev, off_t *size, char **e
|
||||
if (*(*dir)->lnk == '/')
|
||||
(*dir)->child = unix_getfulltree((*dir)->lnk,lev+1,dev,&((*dir)->size),&((*dir)->err));
|
||||
(*dir)->child = 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 = unix_getfulltree(path,lev+1,dev,&((*dir)->size),&((*dir)->err));
|
||||
(*dir)->child = 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
|
||||
@@ -129,7 +129,7 @@ off_t unix_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -128,7 +128,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 {
|
||||
@ -117,7 +142,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);
|
||||
@@ -162,7 +162,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -161,7 +161,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
{
|
||||
struct _info **dir;
|
||||
off_t size = 0;
|
||||
@ -126,7 +151,7 @@ index ca5f76f..9476307 100644
|
||||
|
||||
dir = getfulltree(d, lev, dev, &size, &err);
|
||||
|
||||
@@ -170,6 +170,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -169,6 +169,7 @@ off_t unix_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
|
||||
r_listdir(dir, d, dt, ft, lev);
|
||||
|
||||
@ -138,7 +163,7 @@ diff --git a/xml.c b/xml.c
|
||||
index 32f3c0c..512eed7 100644
|
||||
--- a/xml.c
|
||||
+++ b/xml.c
|
||||
@@ -106,8 +106,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -105,8 +105,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
while(*dir) {
|
||||
if (!noindent) xml_indent(lev);
|
||||
|
||||
@ -148,7 +173,7 @@ index 32f3c0c..512eed7 100644
|
||||
for(t=0;ifmt[t];t++)
|
||||
if (ifmt[t] == mt) break;
|
||||
fprintf(outfile,"<%s", ftype[t]);
|
||||
@@ -145,7 +144,7 @@ off_t xml_listdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -144,7 +143,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 {
|
||||
@ -157,7 +182,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);
|
||||
@@ -181,7 +180,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -180,7 +179,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
{
|
||||
struct _info **dir;
|
||||
off_t size = 0;
|
||||
@ -166,7 +191,7 @@ index 32f3c0c..512eed7 100644
|
||||
|
||||
dir = getfulltree(d, lev, dev, &size, &err);
|
||||
|
||||
@@ -189,6 +188,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
@@ -188,6 +187,7 @@ off_t xml_rlistdir(char *d, int *dt, int *ft, u_long lev, dev_t dev)
|
||||
|
||||
xmlr_listdir(dir, d, dt, ft, lev);
|
||||
|
||||
@ -174,7 +199,7 @@ index 32f3c0c..512eed7 100644
|
||||
return size;
|
||||
}
|
||||
|
||||
@@ -211,8 +211,7 @@ void xmlr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
|
||||
@@ -210,8 +210,7 @@ void xmlr_listdir(struct _info **dir, char *d, int *dt, int *ft, u_long lev)
|
||||
while(*dir) {
|
||||
if (!noindent) xml_indent(lev);
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
Summary: File system tree viewer
|
||||
Name: tree
|
||||
Version: 1.8.0
|
||||
Release: 6%{?dist}
|
||||
Version: 1.7.0
|
||||
Release: 15%{?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
|
||||
@ -22,7 +21,7 @@ Patch6: tree-dircolors-ec.patch
|
||||
# are used (bug #997937).
|
||||
Patch7: tree-size-field-len.patch
|
||||
|
||||
# fix programming mistakes detected by static analysis
|
||||
# fix programming mistakes detected by static analysis (#1602718)
|
||||
Patch8: tree-static-analysis.patch
|
||||
|
||||
%description
|
||||
@ -37,14 +36,15 @@ utility.
|
||||
sed -e 's/LINUX/__linux__/' -i tree.c
|
||||
|
||||
%build
|
||||
%set_build_flags
|
||||
%make_build CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)"
|
||||
make CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)" \
|
||||
LDFLAGS="$RPM_LD_FLAGS" %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT%{_bindir}
|
||||
|
||||
%make_install BINDIR=$RPM_BUILD_ROOT%{_bindir} \
|
||||
MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1
|
||||
make BINDIR=$RPM_BUILD_ROOT%{_bindir} \
|
||||
MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 \
|
||||
install
|
||||
|
||||
chmod -x $RPM_BUILD_ROOT%{_mandir}/man1/tree.1
|
||||
|
||||
@ -54,29 +54,8 @@ chmod -x $RPM_BUILD_ROOT%{_mandir}/man1/tree.1
|
||||
%doc README LICENSE
|
||||
|
||||
%changelog
|
||||
* 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
|
||||
* Wed Nov 07 2018 Kamil Dudka <kdudka@redhat.com> - 1.7.0-15
|
||||
- fix programming mistakes detected by static analysis (#1602718)
|
||||
|
||||
* Fri Feb 23 2018 Florian Weimer <fweimer@redhat.com> - 1.7.0-14
|
||||
- Use LDFLAGS from redhat-rpm-config
|
||||
|
Loading…
Reference in New Issue
Block a user