this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at vchroot 45 lines 1.0 kB view raw
1#!/bin/bash -e 2 3if [ "$ACTION" = installhdrs ]; then exit 0; fi 4if [[ "$PLATFORM_NAME" != "macosx" ]]; then exit 0; fi 5 6UNIFDEF_FLAGS="" 7 8MANPAGES_LIST="${SRCROOT}/man/manpages.lst" 9FILES=$(find -E ${SRCROOT} -regex '.*/[^.]+\.[0-9]' -type f) 10 11cat ${MANPAGES_LIST} | grep -v -E '(^#|^\s*$)' | while read first solid rest; do 12 SOURCE=$(grep -E "/${first}$"<<EOF 13${FILES} 14EOF 15) 16 17 # This is a subshell, the real exit is after the loop. 18 if [ -z "${SOURCE}" ]; then 19 echo "Error: ${first} not found" 20 exit 1 21 fi 22 23 SECTION=$(echo ${first} | tail -c 2) 24 25 DESTDIR=${DSTROOT}/usr/share/man/man${SECTION} 26 DEST=${DESTDIR}/${solid} 27 28 mkdir -p ${DSTROOT}/usr/share/man/man${SECTION} 29 30 # cat is used to keep bash happy, unifdef returns non-zero in some success cases 31 cmd="unifdef -t ${UNIFDEF_FLAGS} < ${SOURCE} | cat > ${DEST}" 32 echo ${cmd} 33 eval ${cmd} 34 35 for link in ${rest}; do 36 cmd="ln -sf ${first} ${DESTDIR}/${link}" 37 echo ${cmd} 38 eval ${cmd} 39 done 40done 41 42if [ $? -ne 0 ]; then 43 echo "Exiting due to previous error(s)." 44 exit 1 45fi