Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Feb 1998 08:30:04 -0800 (PST)
From:      Bill Paul <wpaul@FreeBSD.ORG>
To:        tom@sdf.com, wpaul@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/5571
Message-ID:  <199802041630.IAA21152@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
Synopsis: /var/yp/Makefile does not use temporary files properly

State-Changed-From-To: open-closed
State-Changed-By: wpaul
State-Changed-When: Wed Feb 4 08:22:26 PST 1998
State-Changed-Why: 
I have modified Makefile.yp in both -current and the 2.2.5 branch so
that it no longer needs to create /tmp/ypmake. The reason I had that there
in the first place is kind of dump. In a Makefile, if I say:

FOO = 'echo $$$$'

this does not, as you might expect, assign the current PID ($$) to FOO
and keep it there so that it can be referenced as $(FOO), thus yielding
the same PID each time. Instead, every time you reference $(FOO), it
gets re-evaluated, so multiple references to $(FOO) yields different PIDs
each time, which is not what I want. I tried to work around this by
writing the PID to a file once so that I could call up the same value
a couple different times without it changing unexpectedly.

What I did now was to simply append the two commands that need to use $$
together using a semicolon (yp_mkdb -o foo.$$; mv foo.$$ foo) so that
both commands are executed in the same subshell and thus the PID won't
change.

-Bill



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