> Date: Mon, 1 Sep 2014 22:51:22 +0100
> From: Ken Moffat <[email protected]>
> To: [email protected]
> Subject: [blfs-dev] libpapersize, /etc/libpaper.d, runparts [ re #5454 ]
>
>  I must have been very bad at some time, everything I touch is
> coming back to bite me.  Or, perhaps TeX just causes bad things ;)
>
>  I've reopened #5454 because I'm doing some TeX related things, such
> as improving my acceptance-tests, and I needed to confirm if a
> change there would be ok with a non-A4 paper size.  One of my 7.5
> systems (the one with xulrunner) is no longer important, so I'm
> playing there, starting by installing my current TeX build with
> libpaper.
>
>  Root ran 'paperconfig -p letter' and got the following message:
> paperconfig -p letter : run-parts: command not found
> but it did change /etc/papersize.
>
>  Obviously paperconfig is a script, the relevant hunk is
>         #
>         # Added code for calling back applications when
>         # papersize changes. See bug #345466
>         # [email protected], 2006-01-05
>         if [ -d ${PAPERDIR} ]
>         then
>             run-parts ${PAPERDIR}
>         fi
>
>  Very debian, because they are now the upstream.  run-parts is
> something they use primarily to run cron jobs.  It _appears_ to be
> part of debianutils, https://packages.debian.org/sid/debianutils but
> with a dependency of https://packages.debian.org/sid/sensible-utils
> or there is a simple script at
> https://packages.debian.org/sid/sensible-utils although that has
> some rpm backup(?) ignoral in it.
>


Are you looking for a run-parts script (without deps baggage)? In case of
use, below is the run-parts from dcron-4.5  .


rgds,
akh


---------------- Start of script -------------------
#!/bin/sh
# run-parts:  Runs all the scripts found in a directory.

# 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

----------------- End of script --------------------





--
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to