mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-01-24 23:32:12 +08:00
Add run-parts to libpaper.
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@14184 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
parent
cf694de054
commit
ff7c7bf83e
@ -96,8 +96,58 @@ make
|
||||
</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 @@ mkdir -v /etc/libpaper.d
|
||||
<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 @@ mkdir -v /etc/libpaper.d
|
||||
<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 @@ EOF</userinput></screen>
|
||||
|
||||
<seglistitem>
|
||||
<seg>
|
||||
paperconf, paperconfig
|
||||
paperconf, paperconfig, run-parts
|
||||
</seg>
|
||||
<seg>
|
||||
libpaper.so
|
||||
@ -179,6 +235,16 @@ EOF</userinput></screen>
|
||||
</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>
|
||||
<listitem>
|
||||
|
@ -47,6 +47,10 @@
|
||||
<listitem>
|
||||
<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>
|
||||
|
Loading…
Reference in New Issue
Block a user