Author: dnicholson
Date: 2008-04-21 13:11:32 -0600 (Mon, 21 Apr 2008)
New Revision: 7390
Modified:
trunk/BOOK/introduction/welcome/changelog.xml
trunk/BOOK/postlfs/config/compressdoc.xml
trunk/auxfiles/compressdoc
Log:
Fix compressdoc to call the correct script when working recursively
Modified: trunk/BOOK/introduction/welcome/changelog.xml
===================================================================
--- trunk/BOOK/introduction/welcome/changelog.xml 2008-04-21 04:36:18 UTC
(rev 7389)
+++ trunk/BOOK/introduction/welcome/changelog.xml 2008-04-21 19:11:32 UTC
(rev 7390)
@@ -42,6 +42,15 @@
-->
<listitem>
+ <para>April 21st, 2008</para>
+ <itemizedlist>
+ <listitem>
+ <para>[dnicholson] - Bug fixes for the compressdoc script.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
<para>April 20th, 2008</para>
<itemizedlist>
<listitem>
Modified: trunk/BOOK/postlfs/config/compressdoc.xml
===================================================================
--- trunk/BOOK/postlfs/config/compressdoc.xml 2008-04-21 04:36:18 UTC (rev
7389)
+++ trunk/BOOK/postlfs/config/compressdoc.xml 2008-04-21 19:11:32 UTC (rev
7390)
@@ -32,7 +32,7 @@
<screen role="root"><?dbfo keep-together="auto"?><userinput>cat >
/usr/sbin/compressdoc << "EOF"
<literal>#!/bin/bash
-# VERSION: 20060311.0028
+# VERSION: 20080421.1112
#
# Compress (with bzip2 or gzip) all man pages in a hierarchy and
# update symlinks - By Marc Heerdink <marc @ koelkast.net>
@@ -58,6 +58,10 @@
# Modified 20060311 by Archaic to use Man-DB manpath utility which is a
# replacement for man --path from Man.
#
+# Modified 20080421 by Dan Nicholson to properly execute the correct
+# compressdoc when working recursively. This means the same compressdoc
+# will be used whether a full path was given or it was resolved from PATH.
+#
# TODO:
# - choose a default compress method to be based on the available
# tool : gzip or bzip2;
@@ -380,16 +384,14 @@
if [ "$FILE" = "whatis" ]; then continue; fi
if [ -d "$FILE" ]; then
- cd "${MEM_DIR}" # Go back to where we ran "$0",
- # in case "$0"=="./compressdoc" ...
# We are going recursive to that directory
echo "-> Entering ${DIR}/${FILE}..." > $DEST_FD0
# I need not pass --conf, as I specify the directory to work on
- # But I need exit in case of error
- "$MY_NAME" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} \
- ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
+ # But I need exit in case of error. We must change back to the
+ # original directory so $0 is resolved correctly.
+ (cd "$MEM_DIR" && eval "$0" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT}
\
+ ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}") || exit $?
echo "<- Leaving ${DIR}/${FILE}." > $DEST_FD1
- cd "$DIR" # Needed for the next iteration of the loop
else # !dir
if ! check_unique "$DIR" "$FILE"; then continue; fi
Modified: trunk/auxfiles/compressdoc
===================================================================
--- trunk/auxfiles/compressdoc 2008-04-21 04:36:18 UTC (rev 7389)
+++ trunk/auxfiles/compressdoc 2008-04-21 19:11:32 UTC (rev 7390)
@@ -1,5 +1,5 @@
#!/bin/bash
-# VERSION: 20060311.0028
+# VERSION: 20080421.1112
# $LastChangedBy$
# $Date$
#
@@ -27,6 +27,10 @@
# Modified 20060311 by Archaic to use Man-DB manpath utility which is a
# replacement for man --path from Man.
#
+# Modified 20080421 by Dan Nicholson to properly execute the correct
+# compressdoc when working recursively. This means the same compressdoc
+# will be used whether a full path was given or it was resolved from PATH.
+#
# TODO:
# - choose a default compress method to be based on the available
# tool : gzip or bzip2;
@@ -349,16 +353,14 @@
if [ "$FILE" = "whatis" ]; then continue; fi
if [ -d "$FILE" ]; then
- cd "${MEM_DIR}" # Go back to where we ran "$0",
- # in case "$0"=="./compressdoc" ...
# We are going recursive to that directory
echo "-> Entering ${DIR}/${FILE}..." > $DEST_FD0
# I need not pass --conf, as I specify the directory to work on
- # But I need exit in case of error
- "$MY_NAME" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} \
- ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
+ # But I need exit in case of error. We must change back to the
+ # original directory so $0 is resolved correctly.
+ (cd "$MEM_DIR" && eval "$0" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} \
+ ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}") || exit $?
echo "<- Leaving ${DIR}/${FILE}." > $DEST_FD1
- cd "$DIR" # Needed for the next iteration of the loop
else # !dir
if ! check_unique "$DIR" "$FILE"; then continue; fi
@@ -471,4 +473,3 @@
fi
done # for FILE
done # for DIR
-
--
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page