Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2024 17:54:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 278898] /usr/ports/Tools/scripts/redundant-opt-files.sh lists things that don't correspond to ports
Message-ID:  <bug-278898-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D278898

            Bug ID: 278898
           Summary: /usr/ports/Tools/scripts/redundant-opt-files.sh lists
                    things that don't correspond to ports
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: bob@vesterman.com

First, I'm sorry that this has the "Component" "Individual Port(s)", but th=
at's
the only option that the required Component field is giving me (even if I g=
et
here by clicking the link "File a new bug in the "Ports Framework" componen=
t of
the "Ports & Packages" product", with "Ports Framework" seemingly being the
appropriate component for this. With that said:

The script /usr/ports/Tools/scripts/redundant-opt-files.sh is described (in=
 its
source) as follows:

"This script checks every option file against the default options of its po=
rt.=20
If they are identical, it writes the full path of the ports option directory
(typically in /var/db/ports) to stdout."

Unfortunately, it seems to assume that every directory in /var/db/ports
corresponds to some port, even if it doesn't, even if it has a name that is=
n't
in the pkg_port format, even if it's a dotfile, and even if it doesn't even
contain an options file.

So, for example, right now I have two options directories in /var/db/ports:
games_xcowsay/options and ports-mgmt_synth/options. The former has all defa=
ult
options, while the latter has custom options. Given that, I would expect th=
is
script to output:

/var/db/ports/games_xcowsay

But instead, it outputs:

/var/db/ports/.svn
/var/db/ports/games_xcowsay
/var/db/ports/stowfiles

This is because I store my custom configuration using Subversion (hence .sv=
n)
and Stow (hence stowfiles):

$ ls /var/db/ports
.svn/             games_xcowsay/    ports-mgmt_synth@ stowfiles/

I assume that this sort of thing also happens when various other tools are =
used
on that directory (e.g. git).

Obviously this is not the most pressing issue in the world, but given that =
the
typical suggestions on the internet for using this script involve piping its
output to "rm -rf", perhaps it should be changed to not print out anything =
that
doesn't correspond to an actual port, with the pkg_port naming convention
corresponding to something that really exists at /usr/ports/pkg/port.

This is on 14.0-RELEASE-p6, by the way (I don't mean to imply not elsewhere=
 too
- just that I only know for sure it happens on that one).

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-278898-7788>