Changeset 48e6b2a for postlfs/config


Ignore:
Timestamp:
04/21/2008 07:11:44 PM (16 years ago)
Author:
Dan Nichilson <dnicholson@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 6.3, 6.3-rc1, 6.3-rc2, 6.3-rc3, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, 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, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
62b2fb0
Parents:
6deeee2
Message:

compressdoc: Be more robust with directories

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/config/compressdoc.xml

    r6deeee2 r48e6b2a  
    3333<screen role="root"><?dbfo keep-together="auto"?><userinput>cat &gt; /usr/sbin/compressdoc &lt;&lt; "EOF"
    3434<literal>#!/bin/bash
    35 # VERSION: 20080421.1112
     35# VERSION: 20080421.1121
    3636#
    3737# Compress (with bzip2 or gzip) all man pages in a hierarchy and
     
    6262# compressdoc when working recursively. This means the same compressdoc
    6363# will be used whether a full path was given or it was resolved from PATH.
     64#
     65# Modified 20080421 by Dan Nicholson to be more robust with directories
     66# that don't exist or don't have sufficient permissions.
    6467#
    6568# TODO:
     
    315318  exit 1
    316319fi
     320
     321# Check that the specified directories actually exist and are readable
     322for DIR in $MAN_DIR; do
     323  if [ ! -d "$DIR" -o ! -r "$DIR" ]; then
     324    echo "Directory '$DIR' does not exist or is not readable"
     325    exit 1
     326  fi
     327done
    317328
    318329# Fake?
     
    355366  for DIR in $MAN_DIR; do
    356367    cd "${DIR}/.."
     368    if [ ! -w "`pwd`" ]; then
     369      echo "Directory '`pwd`' is not writable"
     370      exit 1
     371    fi
    357372    DIR_NAME=`basename "${DIR}"`
    358373    echo "Backing up $DIR..." &gt; $DEST_FD0
     
    369384for DIR in $MAN_DIR; do
    370385  MEM_DIR=`pwd`
     386  if [ ! -w "$DIR" ]; then
     387    echo "Directory '$DIR' is not writable"
     388    exit 1
     389  fi
    371390  cd "$DIR"
    372391  for FILE in *; do
Note: See TracChangeset for help on using the changeset viewer.