Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2021 17:00:31 +0200
From:      Michael Gmelin <freebsd@grem.de>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Files in /etc containing empty VCSId header
Message-ID:  <20210609170031.58adad10@bsd64.grem.de>
In-Reply-To: <2a0036767ef362e6f9f76c1c472029112de2937d.camel@freebsd.org>
References:  <202106082211.158MBrbe010419@gndrsh.dnsmgr.net> <ac82878fbd635cbdf19707e7daabe15cf753ea0f.camel@freebsd.org> <YMCBuudj3dn2IvJl@server.rulingia.com> <2a0036767ef362e6f9f76c1c472029112de2937d.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On Wed, 09 Jun 2021 08:23:20 -0600
Ian Lepore <ian@freebsd.org> wrote:

> On Wed, 2021-06-09 at 18:54 +1000, Peter Jeremy via freebsd-current
> wrote:
> > On 2021-Jun-08 17:13:45 -0600, Ian Lepore <ian@freebsd.org> wrote: =20
> > > On Tue, 2021-06-08 at 15:11 -0700, Rodney W. Grimes wrote: =20
> > > > There is a command for that which does or use to do a pretty
> > > > decent job of it called whereis(1). =20
> >=20
> > Thanks.  That looks useful.
> >  =20
> > > revolution > whereis ntp.conf
> > > ntp.conf:
> > > revolution > whereis netif
> > > netif:
> > > revolution > whereis services
> > > services:
> > >=20
> > > So how does that help me locate the origin of these files in the
> > > source
> > > tree? =20
> >=20
> > It works for me=E2=84=A2:
> > server% whereis ntp.conf
> > ntp.conf: /usr/src/usr.sbin/ntp/ntpd/ntp.conf
> > server% whereis netif  =20
> > netif: /usr/src/libexec/rc/rc.d/netif
> > server% whereis services
> > services: /usr/src/contrib/unbound/services
> >=20
> > Is your source tree somewhere other than /usr/src?
> >  =20
>=20
> My /usr/src is a symlink to the actual source tree on a different
> filesystem (but it is the source tree the running system was built
> from).  It seems odd that that would make whereis(1) not work.
>=20

whereis(1) falls back to using "locate" if it can't find the sources
directly, so e.g., in case of `whereis -s ls', it will get through the
results of `locate '*'/ls` and see if they match "^/usr/src" (or
whatever you gave as source dir using -S).

Therefore if

  locate '*'/ntp.conf | grep "^/usr/src"

gives you a result, then `whereis -s ntp.conf' will too.

See also
https://cgit.freebsd.org/src/tree/usr.bin/whereis/whereis.c#n607

Michael

(re-sent, as the previous mail bounced from the list)

--=20
Michael Gmelin



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