Re: aclocal/dirlist

Stepan Kasal <[email protected]>
Newsgroups gmane.linux.distributions.rock.devel
Message-ID <[email protected]>
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\(/\|$\)" |
  gawk 'BEGIN {
		dirlist = "/usr/share/aclocal/dirlist"
		while ((getline d <dirlist) > 0)
			have[d]
		close(dirlist)
 	}
	match($0, "^(opt/[^/]+/share/aclocal)(/|$)", a) &&
	  ! (a[1] in have) {
		print a[1] >>dirlist
		have[a[1]]
	}'

Sorry, this is not tested at all, I don't have an up-to-date ROCK at hand...

> mine -l prints directories without a trailing /

Sure.  I used:

> > $ mine -l |grep share.aclocal/*\$

it's a regexp, not glob.

> 	gnome2-dirtree: opt/gnome2/share/aclocal
> 	gnome14-dirtree: opt/gnome/share/aclocal

Well, I think it might be possible to have some gnome packages installed
(eg. glib), even though gnome2-dirtree is missing on the host.

> 	gettext: usr/share/aclocal

Why gettext?  Just because it won the lottery.

So, indeed, it's better to check for a file under aclocal, too.  Which is
what you implemented in
> https://www.rocklinux.net/submaster/smadm.cgi?i=2005101217145307686

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?

Have a nice day,
	Stepan Kasal
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.