Debian Bug#934520: tree: --filefrom option doesn't recognize symbolic links

Hello there,

the following item had originally been filed via mail to the Debian Bug Tracking System (BTS) at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=934520 and then forwarded to ice+tree@mama.indstate.edu.

Now forwarding it here as well for reference.

Best regards, Flo

----- Forwarded message from Chentao Credungtao <chentaocredungtao@yahoo.com> -----

Date: Sun, 11 Aug 2019 23:08:33 +0100
From: Chentao Credungtao <chentaocredungtao@yahoo.com>
To: submit@bugs.debian.org
Subject: Bug#934520: tree: --filefrom option doesn't recognize symbolic links
Reply-To: Chentao Credungtao <chentaocredungtao@yahoo.com>, 934520@bugs.debian.org
Message-ID: <2a1f4e96-559e-e413-8a6a-7be08af3f080@yahoo.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Package: tree
Version: 1.8.0-1+b1
Severity: normal

Dear Maintainer,

tree introduced with its version 1.8 a --filefrom option, so a tree can be
build from a file.

There's a problem if the file contains a symbolic link.

Let's take the following test.tree file :

$ cat /tmp/test.tree
/tmp/test
/tmp/test/status -> /var/lib/logrotate/status
/tmp/test/t1
/tmp/test/t2

$ tree --fromfile /tmp/test.tree produces the following output :
/tmp/test.tree
????????? tmp
    ????????? test
        ????????? status ->
        ??????? ????????? var
        ???????     ????????? lib
        ???????         ????????? logrotate
        ???????             ????????? status
        ????????? t1
        ????????? t2

The symbolic link target (->) is treated like a subtree of the symlink,
which is wrong.

I had rather expected this outout :
$ tree /tmp/test
/tmp/test
????????? status -> /var/lib/logrotate/status
????????? t1
????????? t2



-- System Information:
Debian Release: 9.2
  APT prefers stable
  APT policy: (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-0.bpo.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages tree depends on:
ii  libc6  2.24-11+deb9u1

tree recommends no packages.

tree suggests no packages.

-- no debconf information

----- End forwarded message -----