Compare commits

...

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

11 changed files with 94 additions and 168 deletions

3
.gitignore vendored
View File

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

View File

@ -1 +0,0 @@
06934bf1f6a92af4eaec6bc61e568cec5e068ba1 SOURCES/tree-1.8.0.tgz

View File

@ -1,16 +0,0 @@
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) {
- sprintf(buf,"%s%s%s",leftcode,norm_flgs,rightcode);
+ sprintf(buf,"%s0%s",leftcode,rightcode);
endcode = scopy(buf);
}

View File

@ -1,34 +0,0 @@
From cbfbad2607e99dc856ff82394a19ef489b135351 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 20 Sep 2021 09:36:04 +0200
Subject: [PATCH] tree: use correct FSF address in LICENSE
---
LICENSE | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/LICENSE b/LICENSE
index 5b6e7c6..3c9f912 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
--
2.31.1

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (tree-1.7.0.tgz) = b234fb1428ba75da72d7e4aeb24bf961e123332342593e441b29a0baa2270d12bb187d889c179d6463c940c8dce9fe9dffeb4ad3f06cf11f057b83234d7b4b4a

View File

@ -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"

12
tree-dircolors-ec.patch Normal file
View File

@ -0,0 +1,12 @@
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) {
- sprintf(buf,"%s%s%s",leftcode,norm_flgs,rightcode);
+ sprintf(buf,"%s0%s",leftcode,rightcode);
endcode = scopy(buf);
}

View File

@ -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 \

View File

@ -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);
}

View File

@ -4,18 +4,43 @@ Date: Tue, 6 Nov 2018 16:31:32 +0100
Subject: [PATCH] tree: fix programming mistakes detected by static analysis
---
html.c | 5 +++--
json.c | 11 +++++------
tree.c | 2 +-
unix.c | 5 +++--
xml.c | 11 +++++------
5 files changed, 17 insertions(+), 17 deletions(-)
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(-)
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);

View File

@ -1,111 +1,61 @@
Summary: File system tree viewer
Name: tree-pkg
Version: 1.8.0
Release: 10%{?dist}
# The entire source code is GPLv2+ except strverscmp.c which is LGPLv2+
License: GPLv2+ and LGPLv2+
Name: tree
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
# prevent rpmlint from reporting incorrect-fsf-address
# Sent upstream via email 20210920
Patch0: tree-license-fsf-addr.patch
# Preserve timestamp on man page.
# Sent upstream via email 20210920
Patch2: tree-preserve-timestamps.patch
# Document --du and --prune options in help output (bug #948991).
# Sent upstream via email 20210920
Patch4: tree-args.patch
# Use correct default for dircolors "ec" field (bug #812934).
# Sent upstream via email 20210920
Patch6: tree-dircolors-ec.patch
# Keep file size field length constant regardless of whether SI units
# are used (bug #997937).
# Sent upstream via email 20210920
Patch7: tree-size-field-len.patch
# fix programming mistakes detected by static analysis
# Sent upstream via email 20181106
# fix programming mistakes detected by static analysis (#1602718)
Patch8: tree-static-analysis.patch
%description
The source RPM package of tree, which has to be named differently due to
limitations of Pagure and Gitlab.
%package -n tree
Summary: File system tree viewer
%description -n tree
The tree utility recursively displays the contents of directories in a
tree-like format. Tree is basically a UNIX port of the DOS tree
utility.
%prep
%autosetup -p1 -n tree-%{version}
%autosetup -p1
# do not escape UTF-8 chars in file names by default in UTF-8 locale (#1480778)
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
%files -n tree
%files
%{_bindir}/tree
%{_mandir}/man1/tree.1*
%license LICENSE
%doc README
%doc README LICENSE
%changelog
* Fri Sep 17 2021 Kamil Dudka <kdudka@redhat.com> - 1.8.0-10
- reflect review comments from Fedora Review (#2001467)
* Fri Sep 03 2021 Kamil Dudka <kdudka@redhat.com> - 1.8.0-8
- source package renamed to tree-pkg to make it work with Pagure and Gitlab
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* 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