Mailing List Archive

use of src->mythtv/mythtv symbolic link
This is probably a stupid question, but every time when I'm grepping for
some piece of code, grep searches the code tree twice, and on the second
run it detects src/src recursive directory loop.

What is the use of this symbolic link? Can we get rid of it?
Re: use of src->mythtv/mythtv symbolic link [ In reply to ]
On 2/14/20 11:07 AM, Hans Dingemans wrote:
> This is probably a stupid question, but every time when I'm grepping
> for some piece of code, grep searches the code tree twice, and on the
> second run it detects src/src recursive directory loop.
>
> What is the use of this symbolic link? Can we get rid of it?
>
I don't know what src is for, it gets created when you build. I have
never had the grep problem. I use egrep -r. -r follows symbolic links
only if they are on the command line. You must be using -R. Any reason
for using -R rather than -r?

FWIW I do a lot of greps, so I have a bash script as follows:

egrep -a -r -n "--include=*.c" "--include=*.cpp" "--include=*.h" \
  "--include=*.java" "--exclude=moc_*" "--include=*.xml"
--exclude-dir=build \
  --exclude-dir=.idea --exclude-dir=ffmpeg "$@" 2>&1 | less


Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: use of src->mythtv/mythtv symbolic link [ In reply to ]
On Fri, Feb 14, 2020 at 12:33 PM Peter Bennett <pb.mythtv@gmail.com> wrote:

>
>
> On 2/14/20 11:07 AM, Hans Dingemans wrote:
> > This is probably a stupid question, but every time when I'm grepping
> > for some piece of code, grep searches the code tree twice, and on the
> > second run it detects src/src recursive directory loop.
> >
> > What is the use of this symbolic link? Can we get rid of it?
> >
> I don't know what src is for, it gets created when you build. I have
> never had the grep problem. I use egrep -r. -r follows symbolic links
> only if they are on the command line. You must be using -R. Any reason
> for using -R rather than -r?
>
> FWIW I do a lot of greps, so I have a bash script as follows:
>
> egrep -a -r -n "--include=*.c" "--include=*.cpp" "--include=*.h" \
> "--include=*.java" "--exclude=moc_*" "--include=*.xml"
> --exclude-dir=build \
> --exclude-dir=.idea --exclude-dir=ffmpeg "$@" 2>&1 | less
>
>
> Peter
>
I guess the -R is just a bad habit I now have to get rid of, thanks for the
tip & the script!

Hans.
Re: use of src->mythtv/mythtv symbolic link [ In reply to ]
On 2/14/20 12:57 PM, Hans Dingemans wrote:
> I guess the -R is just a bad habit I now have to get rid of, thanks for the
> tip & the script!

I couldn't duplicate the double matches either. Even with -r. -R prints a
warning message for mythtv/src, but still doesn't search src.

Just another way:

git grep excludes ignored files/directories (.gitignore) or un-added files.
Note that after git add some_files, but before git commit, you must append
--cached to search them.

My favorite, but you don't have to create an alias:

git config --global alias.g "grep --files-with-matches --open-files-in-pager=vi"

Then: git g <search_string> finds files containing search_string and starts
the editor positioned at that string. Great if there aren't many matches, so I
sometimes use git grep <search_string> 1st. From vi[m], :n goes to the next
file and n searches for the same string.

You can use --open-files-in-pager=less rather than vi if you like. You can also
append directories to limit searches, e.g. ... programs libs.

--
Bill
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: use of src->mythtv/mythtv symbolic link [ In reply to ]
On Wed, Feb 19, 2020 at 10:04 AM Bill Meek <keemllib@gmail.com> wrote:

> On 2/14/20 12:57 PM, Hans Dingemans wrote:
> > I guess the -R is just a bad habit I now have to get rid of, thanks for
> the
> > tip & the script!
>
> I couldn't duplicate the double matches either. Even with -r. -R prints a
> warning message for mythtv/src, but still doesn't search src.
>
> Just another way:
>
> git grep excludes ignored files/directories (.gitignore) or un-added files.
> Note that after git add some_files, but before git commit, you must append
> --cached to search them.
>
> My favorite, but you don't have to create an alias:
>
> git config --global alias.g "grep --files-with-matches
> --open-files-in-pager=vi"
>
> Then: git g <search_string> finds files containing search_string and starts
> the editor positioned at that string. Great if there aren't many matches,
> so I
> sometimes use git grep <search_string> 1st. From vi[m], :n goes to the next
> file and n searches for the same string.
>
> You can use --open-files-in-pager=less rather than vi if you like. You can
> also
> append directories to limit searches, e.g. ... programs libs.
>
> --
> Bill
>
Thanks all for the "workarounds" on my question on the "src" symbolic link,
but nobody seems to know why it is there.

Since I am the "get rid of the root cause" kind of guy, I looked into it,
and found it has to do with a few lines in the ./configure script. The
script seems to be a copy of the FFmpeg configure script, but they already
differ, so I thought it might cause no harm to further adapt it; I removed
a variable SRC_LINK that is never used, and the entire mechanism to fill
the value of this variable. Side effect is the unnecessary src recursive
directory is not created anymore; please see the patch attached.

As can be expected, myth still builds like before...

Hans.