1998-08-14 00:16:07 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
pkgname=$1
|
|
|
|
|
1999-03-17 06:57:38 +00:00
|
|
|
BASENAME=${BASENAME:-%%BASENAME%%}
|
|
|
|
CP=${CP:-%%CP%%}
|
|
|
|
ECHO=${ECHO:-%%ECHO%%}
|
|
|
|
GREP=${GREP:-%%GREP%%}
|
|
|
|
SED=${SED:-%%SED%%}
|
|
|
|
TOUCH=${TOUCH:-%%TOUCH%%}
|
|
|
|
CUT=${CUT:-%%CUT%%}
|
|
|
|
DO_NADA=${DO_NADA:-%%DO_NADA%%}
|
|
|
|
CUT=/usr/bin/cut
|
|
|
|
EXPR=/bin/expr
|
1998-08-14 00:16:07 +00:00
|
|
|
|
1999-03-17 06:57:38 +00:00
|
|
|
infodir=${INFODIR:-%%INFODIR%%}
|
|
|
|
infofiles=${INFOFILES:-%%INFOFILES%%}
|
|
|
|
infonodes=${INFONODES:-%%INFONODES%%}
|
|
|
|
infonodeexps=${INFONODEEXPS:-%%INFONODEEXPS%%}
|
|
|
|
dirsection=${DIRSECTION:-%%DIRSECTION%%}
|
1998-08-14 00:16:07 +00:00
|
|
|
|
|
|
|
if [ "X$2" = X"POST-INSTALL" ]; then
|
1999-03-17 06:57:38 +00:00
|
|
|
count=1
|
|
|
|
# For example, the result of `cut ttt -d : -f 2` is ttt. Why?
|
|
|
|
infofiles=${infofiles}:
|
|
|
|
while ${DO_NADA}; do
|
|
|
|
if [ X`${ECHO} ${infofiles} | ${CUT} -d : -f $count` = X ]; then
|
|
|
|
break
|
1998-08-14 00:16:07 +00:00
|
|
|
fi
|
1999-03-17 06:57:38 +00:00
|
|
|
file=`${ECHO} ${infofiles} | ${CUT} -d : -f $count`
|
|
|
|
nodename=`${ECHO} ${infonodes} | ${CUT} -d : -f $count`
|
|
|
|
nodeexp=`${ECHO} ${infonodeexps} | ${CUT} -d : -f $count`
|
|
|
|
if [ ! "`${GREP} \"START-INFO-DIR-ENTRY\" ${infodir}/${file}`" ]; then
|
|
|
|
${ECHO} "INFO-DIR-SECTION ${dirsection}" \
|
|
|
|
>> ${infodir}/${file}
|
|
|
|
${ECHO} "START-INFO-DIR-ENTRY" >> ${infodir}/${file}
|
|
|
|
${ECHO} "* ${nodename}: (`${BASENAME} ${file}`). ${nodeexp}" \
|
|
|
|
>> ${infodir}/${file}
|
|
|
|
${ECHO} "END-INFO-DIR-ENTRY" >> ${infodir}/${file}
|
1998-08-14 00:16:07 +00:00
|
|
|
fi
|
1999-03-17 06:57:38 +00:00
|
|
|
count=`${EXPR} $count + 1`
|
|
|
|
done
|
1999-09-27 13:48:10 +00:00
|
|
|
if [ %%EMACS%% != xemacs ]; then
|
|
|
|
${ECHO} "Adding entry for \"${pkgname}\" to ${infodir}/dir"
|
|
|
|
for file in `${ECHO} ${infofiles} | ${SED} "s,:, ,g"`; do
|
|
|
|
install-info ${infodir}/${file} ${infodir}/dir
|
|
|
|
done
|
|
|
|
fi
|
1999-03-17 06:57:38 +00:00
|
|
|
exit 0
|
1998-08-14 00:16:07 +00:00
|
|
|
else
|
1999-03-17 06:57:38 +00:00
|
|
|
exit 0
|
1998-08-14 00:16:07 +00:00
|
|
|
fi
|