Author: ken
Date: Wed Sep 3 10:41:32 2014
New Revision: 14184
Log:
Add run-parts to libpaper.
Modified:
trunk/BOOK/general/genlib/libpaper.xml
trunk/BOOK/introduction/welcome/changelog.xml
Modified: trunk/BOOK/general/genlib/libpaper.xml
==============================================================================
--- trunk/BOOK/general/genlib/libpaper.xml Wed Sep 3 05:47:47 2014
(r14183)
+++ trunk/BOOK/general/genlib/libpaper.xml Wed Sep 3 10:41:32 2014
(r14184)
@@ -96,8 +96,58 @@
</para>
<screen role="root"><userinput>make install &&
-mkdir -v /etc/libpaper.d
-</userinput></screen>
+mkdir -v /etc/libpaper.d &&
+cat > /usr/bin/run-parts << "EOF"
+#!/bin/sh
+# run-parts: Runs all the scripts found in a directory.
+# from Slackware, by Patrick J. Volkerding with ideas borrowed
+# from the Red Hat and Debian versions of this utility.
+
+# keep going when something fails
+set +e
+
+if [ $# -lt 1 ]; then
+ echo "Usage: run-parts <directory>"
+ exit 1
+fi
+
+if [ ! -d $1 ]; then
+ echo "Not a directory: $1"
+ echo "Usage: run-parts <directory>"
+ exit 1
+fi
+
+# There are several types of files that we would like to
+# ignore automatically, as they are likely to be backups
+# of other scripts:
+IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"
+
+# Main loop:
+for SCRIPT in $1/* ; do
+ # If this is not a regular file, skip it:
+ if [ ! -f $SCRIPT ]; then
+ continue
+ fi
+ # Determine if this file should be skipped by suffix:
+ SKIP=false
+ for SUFFIX in $IGNORE_SUFFIXES ; do
+ if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
+ SKIP=true
+ break
+ fi
+ done
+ if [ "$SKIP" = "true" ]; then
+ continue
+ fi
+ # If we've made it this far, then run the script if it's executable:
+ if [ -x $SCRIPT ]; then
+ $SCRIPT || echo "$SCRIPT failed."
+ fi
+done
+
+exit 0
+EOF
+chmod -v -m755 /usr/bin/run-parts</userinput></screen>
</sect2>
@@ -111,6 +161,12 @@
<application>libpaper</application> expects that packages will install
files
into this directory.</para>
+ <para><command>cat > /usr/bin/run-parts << "EOF"</command> :
+ <filename>paperconfig</filename> is a script which will invoke
+ <command>run-parts</command> if
+ <filename class="directory">/etc/libpaper.d</filename> exists. No other
BLFS
+ package installs this, so we create it here.</para>
+
</sect2>
<sect2 role="configuration">
@@ -122,7 +178,7 @@
<para>Create <filename>/etc/papersize</filename> to set the default
system paper size. Issue the following command as the
<systemitem class="username">root</systemitem> user to set this to
- 'A4' (libpaper expects the lowercase form). You may wish
+ 'A4' (libpaper prefers the lowercase form). You may wish
to use a different size, such as letter.</para>
<screen role="root"><userinput>cat > /etc/papersize << "EOF"
@@ -143,7 +199,7 @@
<seglistitem>
<seg>
- paperconf, paperconfig
+ paperconf, paperconfig, run-parts
</seg>
<seg>
libpaper.so
@@ -178,6 +234,16 @@
</indexterm>
</listitem>
</varlistentry>
+
+ <varlistentry id="run-parts">
+ <term><command>run-parts</command></term>
+ <listitem>
+ <para>run all the scripts found in a directory.</para>
+ <indexterm zone="libpaper run-parts">
+ <primary sortas="b-run-parts">run-parts</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
<varlistentry id="libpaper-lib">
<term><filename class="libraryfile">libpaper.so</filename></term>
Modified: trunk/BOOK/introduction/welcome/changelog.xml
==============================================================================
--- trunk/BOOK/introduction/welcome/changelog.xml Wed Sep 3 05:47:47
2014 (r14183)
+++ trunk/BOOK/introduction/welcome/changelog.xml Wed Sep 3 10:41:32
2014 (r14184)
@@ -48,6 +48,10 @@
<para>September 3rd, 2014</para>
<itemizedlist>
<listitem>
+ <para>[ken] - add run-parts script (from Slackware) to the
+ libpaper page - thanks to akhiezer for his help.</para>
+ </listitem>
+ <listitem>
<para>[fernando] - LXDM-0.5.0 fixes: typo and some rewriting. Fix
again localization, Thanks Armin K.</para>
</listitem>
--
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page