Subject: Problem installing MLINKS?
To: current-users <current-users@NetBSD.ORG>
From: Paul R. Goyette <paul@pgoyette.bdt.com>
List: current-users
Date: 06/05/1995 18:01:26
At the risk of looking totally foolish...

Just recently (last day or two) I've been experiencing a serious problem 
with installing parts of NetBSD.  Basically, any time I try to execute a 
"make install" command and the thing I'm installing attempts to define 
links to man pages (ie, sets symbol $(MLINKS) to something), the make 
aborts with a "Stop:  Error code 1" message.  I've added some echo 
commands to /usr/share/mk/bsd.man.mk and I've narrowed it down to the 
line indicated in the extract below (the echo commands are mine, not from 
the original).

	.if defined(MLINKS) && !empty(MLINKS)
		@set ${MLINKS}; \
		while test $$# -ge 2; do \
			name=$$1; \
			shift; \
			dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
			l=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0*; \
			echo $$l; \
  --->			z=`expr $$l : '.*0\.\(.*\)'`; \
			echo $$z; \
			name=$$1; \
			shift; \
			dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
			t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0$${z:+.}$${z}; \
			echo $$t -\> $$l; \
			rm -f $$t; \
			ln $$l $$t; \
		done; true
	.endif

Strangely enough, I can execute the z=`expr ...` command at the shell 
prompt interactively with no trouble, yet the make install fails _every_ 
time!  And the expr on the preceeding line (starting with l=) succeeds 
_every_ time, and with the correct result.

I've rebuild expr, make, and sh completely from scratch (using sources 
supped to yesterday morning), yet the problem persists.  For now, I've 
just bypassed the problem (by adding && defined(NOTYET) to the .if), but 
I'd really like to know what broke, and maybe how I managed to break it!

--------------------------------------------------------------------
| Paul Goyette            | Key available via finger or key server |
| Paul@pgoyette.bdt.com   | Fingerprint: 0E 40 D2 FC 2A 13 74 A0   |
|                         |              E4 69 D5 BE 65 E4 56 C6   |
--------------------------------------------------------------------