Changeset b614eb09 for postlfs/config
- Timestamp:
- 10/09/2003 08:17:25 PM (21 years ago)
- Branches:
- 10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 6.0, 6.1, 6.2, 6.2.0, 6.2.0-rc1, 6.2.0-rc2, 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, v5_0, v5_1, v5_1-pre1, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
- Children:
- 58964bd
- Parents:
- a78534d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
postlfs/config/compressdoc.xml
ra78534d rb614eb09 12 12 13 13 <screen><userinput><command>cat > /usr/bin/compressdoc << "EOF"</command> 14 15 14 #!/bin/bash 16 # VERSION: 2003100 4.024515 # VERSION: 20031009.1920 17 16 # 18 17 # Compress (with bzip2 or gzip) all man pages in a hierarchy and … … 129 128 BASENAME=`basename "${2}" .bz2` 130 129 BASENAME=`basename "${BASENAME}" .gz` 131 LIST= 132 [ -f "$DIR"/"${BASENAME}" -o -L "$DIR"/"${BASENAME}" ] && LIST="${LIST} ${BASENAME}" 133 [ -f "$DIR"/"${BASENAME}".gz -o -L "$DIR"/"${BASENAME}".gz ] && LIST="${LIST} ${BASENAME}.gz" 134 [ -f "$DIR"/"${BASENAME}".bz2 -o -L "$DIR"/"${BASENAME}".bz2 ] && LIST="${LIST} ${BASENAME}.bz2" 130 GZ_FILE="$BASENAME".bz2 131 BZ_FILE="$BASENAME".bz2 135 132 136 133 # Look for, and keep, the most recent one 137 LATEST=`(cd "$DIR"; ls -1rt $LIST| tail -1)`138 for i in $LIST; do134 LATEST=`(cd "$DIR"; ls -1rt "${BASENAME}" "${GZ_FILE}" "${BZ_FILE}" 2>/dev/null | tail -1)` 135 for i in "${BASENAME}" "${GZ_FILE}".gz "${BZ_FILE}".bz2; do 139 136 [ "$LATEST" != "$i" ] && rm -f "$DIR"/"$i" 140 137 done … … 344 341 345 342 # Check if the file is already compressed with the specified method 346 BASE_FILE=`basename \`basename "$FILE" .bz2\` .gz` 343 BASE_FILE=`basename "$FILE" .gz` 344 BASE_FILE=`basename "$FILE" .bz2` 347 345 if [ "${FILE}" = "${BASE_FILE}${COMP_SUF}" -a "foo${FORCE_OPT}" = "foo" ]; then continue; fi 348 346 349 347 # If we have a symlink 350 348 if [ -h "$FILE" ]; then 351 case $FILEin349 case "$FILE" in 352 350 *.bz2) 353 351 EXT=bz2 ;; … … 359 357 360 358 if [ ! "$EXT" = "none" ]; then 361 LINK=`ls -l $FILE| cut -d ">" -f2 | tr -d " " | sed s/\.$EXT$//`359 LINK=`ls -l "$FILE" | cut -d ">" -f2 | tr -d " " | sed s/\.$EXT$//` 362 360 NEWNAME=`echo "$FILE" | sed s/\.$EXT$//` 363 361 mv "$FILE" "$NEWNAME" 364 362 FILE="$NEWNAME" 365 363 else 366 LINK=`ls -l $FILE| cut -d ">" -f2 | tr -d " "`364 LINK=`ls -l "$FILE" | cut -d ">" -f2 | tr -d " "` 367 365 fi 368 366 … … 394 392 # We do decompress first to re-compress with the selected 395 393 # compression ratio later on... 396 case $FILEin394 case "$FILE" in 397 395 *.bz2) 398 396 bunzip2 $FILE … … 423 421 if [ -n "$HLINKS" ]; then 424 422 for i in $HLINKS; do 425 NEWFILE=`echo $i| sed s/\.gz$// | sed s/\.bz2$//`423 NEWFILE=`echo "$i" | sed s/\.gz$// | sed s/\.bz2$//` 426 424 if [ "$LN_OPT" = "-S" ]; then 427 425 # Make this hard-link a soft- one … … 439 437 # Obviously, we shall never ever come here... :-( 440 438 echo "Whaooo... \"${DIR}/${FILE}\" is neither a symlink nor a plain file. Please check:" 441 ls -l ${DIR}/${FILE}439 ls -l "${DIR}/${FILE}" 442 440 exit 1 443 441 fi
Note:
See TracChangeset
for help on using the changeset viewer.