Re: aclocal/dirlist

Stefan Fiedler <[email protected]>
Newsgroups gmane.linux.distributions.rock.devel
Message-ID <[email protected]>
Hi Stepan,

Am Mittwoch 12 Oktober 2005 18:26 schrieb Stepan Kasal:
> Hi,
>
> On Wed, Oct 12, 2005 at 05:20:28PM +0200, Stefan Fiedler wrote:
> > [ -z "`grep \"$aclocaldir\" $dirlist`" ] issues a warning if the file
> > doesn't exist. 2>/dev/null does the trick as well.
>
> oh.  But it's too many processes.  All of this, including
>
> > >   all_installed "opt/[^/]*/share/aclocal" | sed '....' |sort -u |
>
> can be done in one awk script, something like:
>
> all_installed "^opt/[^/]*/share/aclocal\(/\|$\)" |
I changed this line to
	all_installed ": opt/[^/]*/share/aclocal\(/\|$\)" |
>   gawk 'BEGIN {
> 		dirlist = "/usr/share/aclocal/dirlist"
> 		while ((getline d <dirlist) > 0)
> 			have[d]
> 		close(dirlist)
>  	}
> 	match($0, "^(opt/[^/]+/share/aclocal)(/|$)", a) &&
	match($0, "(opt/[^/]+/share/aclocal)(/|$)", a) &&
> 	  ! (a[1] in have) {
> 		print a[1] >>dirlist
		print "/"a[1] >>dirlist
> 		have[a[1]]
> 	}'
>

because entries in postinstall logs have the format
<pkgname>: <filename>
where filenames don't have a leading /.

> But there is a slight problem with your code:
> If a package creates /opt/foo/share/aclocal/subdir/bar.m4, then you
> add "/opt/foo/share/aclocal/subdir".  But this is not a good idea.
> (Note that /usr/share/aclocal is not searched recursively either.)
>
> Stefan, do you like the above code?
> Would you be so kind to test it and submit it to sm?

Yes, I like it. Afaics it produces the same result as my previous 
implementation and fixes the aclocal subdir problem you described.
I added the patch here: 
https://www.rocklinux.net/submaster/smadm.cgi?i=2005101220014616217

>
> Have a nice day,
> 	Stepan Kasal

Thanks for your help,
	Stefan Fiedler
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.