Changeset ff7c7bf8 for general


Ignore:
Timestamp:
09/03/2014 05:41:32 PM (10 years ago)
Author:
Ken Moffat <ken@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.6, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
a9e8da9
Parents:
cf694de
Message:

Add run-parts to libpaper.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@14184 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • general/genlib/libpaper.xml

    rcf694de rff7c7bf8  
    9797
    9898<screen role="root"><userinput>make install &amp;&amp;
    99 mkdir -v /etc/libpaper.d
    100 </userinput></screen>
     99mkdir -v /etc/libpaper.d &amp;&amp;
     100cat &gt; /usr/bin/run-parts &lt;&lt; "EOF"
     101#!/bin/sh
     102# run-parts:  Runs all the scripts found in a directory.
     103# from Slackware, by Patrick J. Volkerding with ideas borrowed
     104# from the Red Hat and Debian versions of this utility.
     105
     106# keep going when something fails
     107set +e
     108
     109if [ $# -lt 1 ]; then
     110  echo "Usage: run-parts &lt;directory&gt;"
     111  exit 1
     112fi
     113
     114if [ ! -d $1 ]; then
     115  echo "Not a directory: $1"
     116  echo "Usage: run-parts &lt;directory&gt;"
     117  exit 1
     118fi
     119
     120# There are several types of files that we would like to
     121# ignore automatically, as they are likely to be backups
     122# of other scripts:
     123IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp"
     124
     125# Main loop:
     126for SCRIPT in $1/* ; do
     127  # If this is not a regular file, skip it:
     128  if [ ! -f $SCRIPT ]; then
     129    continue
     130  fi
     131  # Determine if this file should be skipped by suffix:
     132  SKIP=false
     133  for SUFFIX in $IGNORE_SUFFIXES ; do
     134    if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then
     135      SKIP=true
     136      break
     137    fi
     138  done
     139  if [ "$SKIP" = "true" ]; then
     140    continue
     141  fi
     142  # If we've made it this far, then run the script if it's executable:
     143  if [ -x $SCRIPT ]; then
     144    $SCRIPT || echo "$SCRIPT failed."
     145  fi
     146done
     147
     148exit 0
     149EOF
     150chmod -v -m755 /usr/bin/run-parts</userinput></screen>
    101151
    102152  </sect2>
     
    112162    into this directory.</para>
    113163
     164    <para><command>cat &gt; /usr/bin/run-parts &lt;&lt; "EOF"</command> :
     165    <filename>paperconfig</filename> is a script which will invoke
     166    <command>run-parts</command> if
     167    <filename class="directory">/etc/libpaper.d</filename> exists. No other BLFS
     168    package installs this, so we create it here.</para>
     169
    114170  </sect2>
    115171
     
    123179      system paper size.  Issue the following command as the
    124180      <systemitem class="username">root</systemitem> user to set this to
    125       &apos;A4&apos; (libpaper expects the lowercase form). You may wish
     181      &apos;A4&apos; (libpaper prefers the lowercase form). You may wish
    126182      to use a different size, such as letter.</para>
    127183
     
    144200      <seglistitem>
    145201        <seg>
    146           paperconf, paperconfig
     202          paperconf, paperconfig, run-parts
    147203        </seg>
    148204        <seg>
     
    180236      </varlistentry>
    181237
     238      <varlistentry id="run-parts">
     239        <term><command>run-parts</command></term>
     240        <listitem>
     241          <para>run all the scripts found in a directory.</para>
     242          <indexterm zone="libpaper run-parts">
     243            <primary sortas="b-run-parts">run-parts</primary>
     244          </indexterm>
     245        </listitem>
     246      </varlistentry>
     247
    182248      <varlistentry id="libpaper-lib">
    183249        <term><filename class="libraryfile">libpaper.so</filename></term>
Note: See TracChangeset for help on using the changeset viewer.