Ticket #26454: patch-src-coreutils-bins.diff

File patch-src-coreutils-bins.diff, 40.0 KB (added by danielb@…, 14 years ago)
  • idvid

    diff -ur src.orig/idvid src/idvid
    old new  
    203203    # (ID_V(ideo), ID_A(udio), and ID_L(ength))
    204204    # Grep out special characters ()[
    205205    # # put the VARS in a file
    206     grep "^ID_[VAL]" < "$SCRATCH_FILE"   | grep -v "[()\[]" | sed 's/$/"/;s/=/="/' > "$SCRATCH_FILE".vars
     206    grep "^ID_[VAL]" < "$SCRATCH_FILE"   | grep -v "[()\[]" | gsed 's/$/"/;s/=/="/' > "$SCRATCH_FILE".vars
    207207    # source the file to set the variables
    208208    . "$SCRATCH_FILE".vars
    209209    # (If you've got a problem with eval, give me an alternative that
     
    237237    # Find out which channel is the video channel ( 1st )
    238238    # TODO Do we want to worry about videos with multiple channels of video ?
    239239    VIDEO_INFO=$(grep "Video:" "$SCRATCH_FILE")
    240     ID_VIDEO_TRACKS=( $(sed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$VIDEO_INFO") )
     240    ID_VIDEO_TRACKS=( $(gsed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$VIDEO_INFO") )
    241241    ID_VIDEO_TRACK="${ID_VIDEO_TRACKS[0]}"
    242242    # Find out what audio channels are available
    243243    if test -n "$ID_AUDIO_ID"; then
    244244        AUDIO_INFO=$(grep "Audio:" "$SCRATCH_FILE")
    245245        # ID_AUDIO_ID needs "TRACKS" var to remain in columns
    246         TRACKS=$(sed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$AUDIO_INFO")
     246        TRACKS=$(gsed -r 's/.*Stream #([0-9]\.[0-9]+).*/\1/' <<< "$AUDIO_INFO")
    247247        A_TRACKS=(${TRACKS//$'\n'/ })
    248248        # Get hexadecimal track IDs, if present
    249249        if grep -q "\[0x[0-9a-fA-F]*]" <<< $AUDIO_INFO; then
    250             HEX_TRACKS=$(sed -r 's/Stream .*\[0x([0-9a-fA-F]*)]:.*$/\1/' <<< "$AUDIO_INFO")
     250            HEX_TRACKS=$(gsed -r 's/Stream .*\[0x([0-9a-fA-F]*)]:.*$/\1/' <<< "$AUDIO_INFO")
    251251            HEX_TRACKS=(${HEX_TRACKS//$'\n'/ })
    252252            USE_HEX_TRACKS=:
    253253        else
     
    257257        for ((i=0; i<${#A_TRACKS[@]}; i++)); do
    258258            CUR_CHAN=$(grep "Stream #${A_TRACKS[i]}" <<< "$AUDIO_INFO")
    259259            A_SAMPRATES=("${A_SAMPRATES[@]}" "$(echo $CUR_CHAN | \
    260                 sed -r 's/.* ([0-9]+) Hz.*/\1/')")
     260                gsed -r 's/.* ([0-9]+) Hz.*/\1/')")
    261261            A_BITRATES=("${A_BITRATES[@]}" "$(echo $CUR_CHAN | \
    262                 sed -r 's/.* ([0-9]+) kb\/s.*/\1/')")
     262                gsed -r 's/.* ([0-9]+) kb\/s.*/\1/')")
    263263            # make sure the above is a number, else set  A_BITRATE to 0
    264264            if ! test_is_number ${A_BITRATES[i]}; then
    265265                A_BITRATES[i]=0
    266266            fi
    267267            A_CODECS=("${A_CODECS[@]}" "$(echo $CUR_CHAN | \
    268                 sed -r 's/.*Audio: ([^,]+),.*/\1/')")
     268                gsed -r 's/.*Audio: ([^,]+),.*/\1/')")
    269269                if $USE_HEX_TRACKS; then
    270270                MP_TRACKNUM=$((16#${HEX_TRACKS[i]}))
    271271            else
     
    296296                if grep -q 5:1 <<<  ${AUDIO_NCH[chn]}; then
    297297                    ID_AUDIO_NCH[chn]=6
    298298               elif grep -q channels <<< ${AUDIO_NCH[chn]}; then
    299                     ID_AUDIO_NCH[chn]=$(sed -r 's/.* ([0-9]+) channels.*/\1/' \
     299                    ID_AUDIO_NCH[chn]=$(gsed -r 's/.* ([0-9]+) channels.*/\1/' \
    300300                    <<< ${AUDIO_NCH[chn]})
    301301                else
    302302                    ID_AUDIO_NCH[chn]=2
     
    336336    else
    337337        # Infer aspect ratio from width/height of mplayer playback
    338338        MPLAYER_RES=$(grep '^VO:' "$SCRATCH_FILE" | \
    339             sed -e "s/..*=> *//g" -e "s/ .*$//g")
     339            gsed -e "s/..*=> *//g" -e "s/ .*$//g")
    340340        #PLAY_WIDTH=$(echo $MPLAYER_RES | awk -F 'x' '{print $1}')
    341341        #PLAY_HEIGHT=$(echo $MPLAYER_RES | awk -F 'x' '{print $2}')
    342342        # patch from ML:
     
    351351    fi
    352352    # Normalized aspect ratio
    353353    V_ASPECT_RATIO=$(echo $V_ASPECT_WIDTH | \
    354     sed -r -e 's/([0-9]*)([0-9][0-9])/\1.\2:1/g')
     354    gsed -r -e 's/([0-9]*)([0-9][0-9])/\1.\2:1/g')
    355355
    356356    NAV_LOG="${INFILE}.nav_log"
    357357    USE_NAVLOG=false
     
    414414    fi
    415415
    416416    # Use mplayer-reported length as a last resort (truncate floating-point)
    417     test -z $V_DURATION && V_DURATION=$(echo $ID_LENGTH | sed 's/\.[0-9]*//')
     417    test -z $V_DURATION && V_DURATION=$(echo $ID_LENGTH | gsed 's/\.[0-9]*//')
    418418
    419419    # TODO: WARN if video is less than one second!
    420420
     
    486486        echo "V_ASPECT_WIDTH=$V_ASPECT_WIDTH"
    487487        echo "ID_VIDEO_FRAMES=$ID_VIDEO_FRAMES"
    488488    elif $TABULAR; then
    489         FILE_SIZE=$(du -Dh "$INFILE" | awk '{print $1}')
     489        FILE_SIZE=$(gdu -Dh "$INFILE" | awk '{print $1}')
    490490        echo "$INFILE||$FILE_SIZE||${ID_VIDEO_WIDTH}x${ID_VIDEO_HEIGHT}||$ID_VIDEO_FPS||$ID_VIDEO_BITRATE||$ID_AUDIO_BITRATE" >> "$TABLE"
    491491    else
    492492        echo $SEPARATOR
  • make_titlesets

    diff -ur src.orig/make_titlesets src/make_titlesets
    old new  
    5656    # else test if the file name path passed in exists
    5757    while ! (( script_exists )); do
    5858        read script_name
    59         script_name=$(readlink -f "$script_name")
     59        script_name=$(greadlink -f "$script_name")
    6060        if  [[ -e "$script_name" ]] ; then
    6161            script_exists=1
    6262        else
     
    9797{
    9898    file="$1"
    9999    # remove shebang and PATH
    100     sed -i '/\#\!\/usr\/bin\/env bash/d;/PATH/d' "$file"
     100    gsed -i '/\#\!\/usr\/bin\/env bash/d;/PATH/d' "$file"
    101101    # remove todisc command
    102     sed -i '/^todisc \\$/d' "$file"
     102    gsed -i '/^todisc \\$/d' "$file"
    103103    # remove opening blank lines
    104     sed -i '/./,/^$/!d' "$file"
     104    gsed -i '/./,/^$/!d' "$file"
    105105}
    106106
    107107##############################################################################
     
    131131    new_name=$(TMPDIR=`pwd` mktemp -t todisc_commands.bash.XXXXXX)
    132132    echo "The file we will use to save options: \"${final_script}\",
    133133     exists in the current directory. It will be renamed:
    134     to $new_name if you continue." |sed 's/^[ \t]*//;s/[ \t]*$//'
     134    to $new_name if you continue." |gsed 's/^[ \t]*//;s/[ \t]*$//'
    135135    echo "press <ENTER> to continue..."
    136136    read cont
    137137fi
     
    172172    fi
    173173done
    174174# add backslash to last line; add -vmgm and -titles; add menu titles
    175 sed -i "\$s/$/ \\\/" "$todisc_tmp"
    176 sed -i '$ a -vmgm \\' "$todisc_tmp"
    177 sed -i '$ a -titles \\'  "$todisc_tmp"
     175gsed -i "\$s/$/ \\\/" "$todisc_tmp"
     176gsed -i '$ a -vmgm \\' "$todisc_tmp"
     177gsed -i '$ a -titles \\'  "$todisc_tmp"
    178178printf '"%s" \\\n' "${MENU_TITLES[@]}" >> "$todisc_tmp"
    179179mv "$todisc_tmp" "$final_tmp_script"
    180180
     
    197197run_gui
    198198clean_script "$todisc_tmp"
    199199# add backslash to last line
    200 sed -i "\$s/$/ \\\/" "$todisc_tmp"
     200gsed -i "\$s/$/ \\\/" "$todisc_tmp"
    201201# add -end-vmgm as last line
    202 sed -i '$ a -end-vmgm \\' "$todisc_tmp"
     202gsed -i '$ a -end-vmgm \\' "$todisc_tmp"
    203203cat "$todisc_tmp" >> "$final_tmp_script"
    204204rm -f "$todisc_tmp"
    205205done=0
     
    232232        run_gui
    233233        clean_script "$todisc_tmp"
    234234        # add backslash to last line of temp file
    235         sed -i "\$s/$/ \\\/" "$todisc_tmp"
     235        gsed -i "\$s/$/ \\\/" "$todisc_tmp"
    236236        # add "-titleset \" as 1st line
    237         sed -i '1i -titleset \\' "$todisc_tmp"
     237        gsed -i '1i -titleset \\' "$todisc_tmp"
    238238        # add "-end-titleset" as last line
    239         sed -i '$a -end-titleset \\' "$todisc_tmp"
     239        gsed -i '$a -end-titleset \\' "$todisc_tmp"
    240240        # concatenate
    241241        cat "$todisc_tmp" >> "$final_tmp_script"
    242242        rm -f "$todisc_tmp"
     
    248248###############################################################################
    249249
    250250# remove backslash on last line
    251 sed -i "\$s/\\\//" "$final_tmp_script"
     251gsed -i "\$s/\\\//" "$final_tmp_script"
    252252echo $SEP
    253253mv "$final_tmp_script" "$final_script"
    254254echo final script is "$final_script"
  • makedvd

    diff -ur src.orig/makedvd src/makedvd
    old new  
    214214done
    215215
    216216if test -e "$1"; then
    217     DISC_NAME=$(readlink -f "$1")
     217    DISC_NAME=$(greadlink -f "$1")
    218218else
    219219    usage_error "File or DVD directory '$1' does not exist."
    220220fi
     
    302302    DISC_SUM=0
    303303    while test $i -le $NUM_VOBS; do
    304304      VOB=$(echo "$VOB_LIST" | awk -F ':' '{ print $'$i' }')
    305       VOB_SIZE=$(du -D -B M "$VOB" | awk -F ' ' '{print $1}' | tr -d M)
     305      VOB_SIZE=$(gdu -D -B M "$VOB" | awk -F ' ' '{print $1}' | tr -d M)
    306306      DISC_SUM=$(expr $VOB_SIZE \+ $DISC_SUM)
    307307      i=$(expr $i \+ 1)
    308308    done
    309     OUTDIR=$(readlink -f "$OUT_DIR")
     309    OUTDIR=$(greadlink -f "$OUT_DIR")
    310310    AVAIL_SPACE=$(df -B M -P "${OUTDIR%/*}" | awk 'NR != 1 {print $4;}' | tr -d M)
    311311
    312312    if test $DISC_SUM -gt $AVAIL_SPACE; then
     
    369369    fi
    370370
    371371    GROWISOFS_VER=$(growisofs -version | grep version | \
    372                     awk '{ print $6 }' | sed 's/,//g')
     372                    awk '{ print $6 }' | gsed 's/,//g')
    373373
    374374    # Make sure there is a blank disc to write to
    375375    probe_media
     
    424424      probe_media
    425425    fi
    426426
    427     DISC_SUM=$(du -s -B M "$OUT_DIR" | awk '{print $1}' | tr -d M)
     427    DISC_SUM=$(gdu -s -B M "$OUT_DIR" | awk '{print $1}' | tr -d M)
    428428    if test $DISC_SUM -gt $DISC_CAPACITY; then
    429429       echo $SEPARATOR
    430430       echo "Cannot continue! DVD image (${DISC_SUM}MB) exceeds the DVD's capacity (${DISC_CAPACITY}MB)."
  • makemenu

    diff -ur src.orig/makemenu src/makemenu
    old new  
    657657
    658658    # Calculate number of \n characters in title, so menu title height
    659659    # will be set correctly
    660     TITLE_LINES=$(echo "$MENU_TITLE" | sed 's/!//g;s/\\n/!/g;s/[^!]//g' | wc -c)
     660    TITLE_LINES=$(echo "$MENU_TITLE" | gsed 's/!//g;s/\\n/!/g;s/[^!]//g' | wc -c)
    661661    TITLE_HEIGHT=$((100 * $TITLE_LINES))
    662662
    663663    # Draw the menu title and pad the bottom with TILE_HEIGHT pixels
     
    787787# Calculate video length from length of audio
    788788VID_LENGTH=$(mplayer -quiet -identify -frames 0 -vo null -ao null \
    789789    "$AUDIO_STREAM" 2>&1 | grep '^ID_LENGTH' | awk -F '=' '{print $2}' | \
    790     sed -e "s/\.[0-9]*//g")
     790    gsed -e "s/\.[0-9]*//g")
    791791VID_LENGTH=$(expr "$VID_LENGTH" \* $FPS \/ 100)
    792792
    793793# Make sure VID_LENGTH is nonzero
  • makempg

    diff -ur src.orig/makempg src/makempg
    old new  
    289289# Args: $@ == text string containing complete command-line
    290290# To filter/prettify the subprocess output before writing it to the log file,
    291291# set the LOG_FILTER variable before calling this function, to e.g.
    292 #    LOG_FILTER="sed {s/\r/\n/g}"    # Replace LF with CR/LF
     292#    LOG_FILTER="gsed {s/\r/\n/g}"    # Replace LF with CR/LF
    293293# ******************************************************************************
    294 CRLF="sed {s/\r/\n/g}"  # Turn carriage-returns into newlines
     294CRLF="gsed {s/\r/\n/g}"  # Turn carriage-returns into newlines
    295295FOLD="fold -bs"
    296296function cmd_exec()
    297297{
     
    338338    # based on original file size
    339339    $SLICE && VIDEO_DURATION=$CLIP_LENGTH || VIDEO_DURATION=$V_DURATION
    340340    if test "$VIDEO_DURATION" = "0"; then
    341         CUR_SIZE=$(du -Dck \"$IN_FILE\" | awk 'END{print $1}')
     341        CUR_SIZE=$(gdu -Dck \"$IN_FILE\" | awk 'END{print $1}')
    342342        NEED_SPACE=$(expr $CUR_SIZE \* 2)
    343343        yecho  "The encoding process will require about"
    344344    # Estimate space based as kbps * duration
     
    441441                ;;
    442442            "-safe" )
    443443                shift
    444                 SAFE_AREA=$(echo $1 | sed 's/%//g')
     444                SAFE_AREA=$(echo $1 | gsed 's/%//g')
    445445                ;;
    446446            "-crop" )
    447447                USE_FILTERS=1
     
    452452                USE_FILTERS=1
    453453                shift
    454454                # Parse comma-separated values
    455                 for FILTER in $(echo "$1" | sed 's/,/ /g'); do
     455                for FILTER in $(echo "$1" | gsed 's/,/ /g'); do
    456456                    case "$FILTER" in
    457457                        "none" )
    458458                            DO_DENOISE=false
     
    532532            "-subtitles" )
    533533                shift
    534534                if test -e "$1"; then
    535                     SUBS_FILE=$(readlink -f "$1")
     535                    SUBS_FILE=$(greadlink -f "$1")
    536536                    SUBTITLES="-sub \"$SUBS_FILE\""
    537537                    DO_SUBS=:
    538538                else
     
    675675{
    676676    # Get total size of all output files
    677677    cd "$(dirname "$OUT_FILENAME")"
    678     FINAL_SIZE=$(du -c -k "$OUT_PREFIX"*.mpg | awk 'END{print $1}')
     678    FINAL_SIZE=$(gdu -c -k "$OUT_PREFIX"*.mpg | awk 'END{print $1}')
    679679    test -z $FINAL_SIZE && FINAL_SIZE=0
    680680
    681681    if $FAKE; then
    682682        :
    683683    else
    684684        yecho "Output files:"
    685         du -shc "$OUT_PREFIX".mpg "$OUT_PREFIX".[0-9].mpg 2>/dev/null
     685        gdu -shc "$OUT_PREFIX".mpg "$OUT_PREFIX".[0-9].mpg 2>/dev/null
    686686    fi
    687687
    688688    # Create stats directory if it doesn't already exist.
     
    747747        # get lines with frame= , and print last field with kbit/s removed
    748748        bitrates=$(awk -F= '/^frame=/ {gsub("kbits/s", ""); print $NF}' "$LOG_FILE")
    749749        # get highest value, and remove spaces with sed
    750         bitrates=$(sort -un <<< "$bitrates" | sed 's/^[ \t]*//;s/[ \t]*$//')
     750        bitrates=$(sort -un <<< "$bitrates" | gsed 's/^[ \t]*//;s/[ \t]*$//')
    751751        # average the values.  Add 000, so it is in bits.
    752752        AVG_BITRATE=$(awk '{t+=$0} END{printf "%d\n", t/NR}' <<< "$bitrates")
    753753        AVG_BITRATE=${AVG_BITRATE}000
     
    903903    IN_FILE_TYPE="uri"
    904904else
    905905    IN_FILE_TYPE="file"
    906     IN_FILE=$(readlink -f "$IN_FILE")
     906    IN_FILE=$(greadlink -f "$IN_FILE")
    907907fi
    908908
    909909
     
    928928    OUT_PREFIX="$OUTPUT_DIR/$OUT_PREFIX"
    929929# Otherwise, use the full qualified pathname
    930930else
    931     OUT_PREFIX=$(readlink -f "$OUT_PREFIX")
     931    OUT_PREFIX=$(greadlink -f "$OUT_PREFIX")
    932932    mkdir -p "$(dirname "$OUT_PREFIX")"
    933933fi
    934934
     
    11091109    yecho "Probing video for information. This may take several minutes..."
    11101110
    11111111    # Get an MD5sum of the input file for statistics
    1112     IN_FILE_MD5=$(md5sum "$IN_FILE" | awk '{print $1}')
     1112    IN_FILE_MD5=$(gmd5sum "$IN_FILE" | awk '{print $1}')
    11131113
    11141114    # Assume nothing is compliant unless idvid says so
    11151115    # (these will be overridden by idvid for compliant A/V)
     
    17371737
    17381738# Remove extraneous commas from filter command
    17391739if test -n "$VID_FILTER"; then
    1740     VID_FILTER="-vf $(echo "$VID_FILTER" | sed -e 's/,,/,/g' -e 's/^,//')"
     1740    VID_FILTER="-vf $(echo "$VID_FILTER" | gsed -e 's/,,/,/g' -e 's/^,//')"
    17411741fi
    17421742# ******************************************************************************
    17431743#
     
    21132113# ******************************************************************************
    21142114
    21152115if ! $FAKE; then
    2116     AUDIO_SIZE=$(du -c -b "$AUDIO_STREAM" | awk 'END{print $1}')
    2117     VIDEO_SIZE=$(du -c -b "$VIDEO_STREAM" | awk 'END{print $1}')
     2116    AUDIO_SIZE=$(gdu -c -b "$AUDIO_STREAM" | awk 'END{print $1}')
     2117    VIDEO_SIZE=$(gdu -c -b "$VIDEO_STREAM" | awk 'END{print $1}')
    21182118    # Total size of streams so far (in MBytes)
    21192119    STREAM_SIZE=$(expr \( $AUDIO_SIZE \+ $VIDEO_SIZE \) \/ 1000000)
    21202120    # If it exceeds disc size, add '%d' field to allow mplex to split output
    21212121    if test $STREAM_SIZE -gt $DISC_SIZE; then
    2122         OUT_FILENAME=$(echo "$OUT_FILENAME" | sed -e 's/\.mpg$/.%d.mpg/')
     2122        OUT_FILENAME=$(echo "$OUT_FILENAME" | gsed -e 's/\.mpg$/.%d.mpg/')
    21232123    fi
    21242124fi
    21252125
  • makexml

    diff -ur src.orig/makexml src/makexml
    old new  
    128128# Backslash-escape the given special character (and any EOLs)
    129129# Usage:
    130130#    sedprep "$TEXT" /
    131 #    echo $TEXT | sed "s/PATTERN/$(sedprep "$REPLACEMENT" /)/"
     131#    echo $TEXT | gsed "s/PATTERN/$(sedprep "$REPLACEMENT" /)/"
    132132function sedprep ()
    133133{
    134134    delim=${2:-/}
    135     echo "$1" |sed -e 's/[\&'"$delim"']/\\&/g' -e '$!s,$,\\,';
     135    echo "$1" |gsed -e 's/[\&'"$delim"']/\\&/g' -e '$!s,$,\\,';
    136136}
    137137
    138138# ==========================================================
     
    401401
    402402    # Fill in the NEXT command for the previous slide, if there was one
    403403    NEXT_TITLE="<next ref=\"play-title-$CUR_TITLE\"\/>"
    404     SELECTION_XML=$( echo "$SELECTION_XML" | sed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" )
    405     PLAYLIST_XML=$( echo "$PLAYLIST_XML" | sed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" )
     404    SELECTION_XML=$( echo "$SELECTION_XML" | gsed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" )
     405    PLAYLIST_XML=$( echo "$PLAYLIST_XML" | gsed -e "s/__NEXT_TITLE__/$NEXT_TITLE/g" )
    406406
    407407    # --------------------------
    408408    # If doing a still-image slideshow, use segment/selection
     
    501501
    502502    # Fill in titleset menu buttons
    503503    MENU_XML=$(echo "$MENU_XML" | \
    504         sed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g")
     504        gsed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g")
    505505
    506506    # Fill in the POST command. If there is a menu to jump back to, use that;
    507507    # otherwise, do not insert a POST command.
     
    512512    else
    513513      POST_CMD=""
    514514    fi
    515     TS_TITLES=$( echo "$TS_TITLES" | sed -e "s/__POST_CMD__/$POST_CMD/g" )
     515    TS_TITLES=$( echo "$TS_TITLES" | gsed -e "s/__POST_CMD__/$POST_CMD/g" )
    516516
    517517    # Append titleset info to ALL_MENU_XML
    518518    if ! $FORCE_TITLESETS || ! $HAVE_TOP_MENU; then
     
    558558    # Fill in menu title selections ("buttons")
    559559    # and remove any remaining __NEXT_TITLE__s
    560560    SELECTION_XML=$(echo "$SELECTION_XML" | \
    561         sed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g" -e "s/__NEXT_TITLE__//g")
    562     PLAYLIST_XML=$(echo "$PLAYLIST_XML" | sed -e "s/__NEXT_TITLE__//g")
     561        gsed -e "s/__MENU_BUTTONS__/$(sedprep "$MENU_BUTTONS" /)/g" -e "s/__NEXT_TITLE__//g")
     562    PLAYLIST_XML=$(echo "$PLAYLIST_XML" | gsed -e "s/__NEXT_TITLE__//g")
    563563
    564564    # Append new PBC menus/playlists to PBC_XML
    565565    PBC_XML=`cat << EOF
     
    716716
    717717# Fill in top menu buttons
    718718TOP_MENU_XML=$(echo "$TOP_MENU_XML" | \
    719     sed -e "s/__TOP_MENU_BUTTONS__/$(sedprep "$TOP_MENU_BUTTONS" /)/g")
     719    gsed -e "s/__TOP_MENU_BUTTONS__/$(sedprep "$TOP_MENU_BUTTONS" /)/g")
    720720
    721721# If there is a top menu with no other menus, print an error and
    722722# a suggestion that user specify -menu instead of -topmenu
     
    801801fi
    802802
    803803# Remove blank lines and write final result to output file
    804 echo "$FINAL_DISC_XML" | sed -e '/^ *$/d' > "$OUT_PREFIX.xml"
     804echo "$FINAL_DISC_XML" | gsed -e '/^ *$/d' > "$OUT_PREFIX.xml"
    805805
    806806echo "Done. The resulting XML was written to $OUT_PREFIX.xml."
    807807
  • todisc

    diff -ur src.orig/todisc src/todisc
    old new  
    6666# check if symlink in /tmp exists and use time stamped link if so
    6767WORK_DIR="/tmp/todisc-work"
    6868
    69 LOG_FILE=$(readlink -f todisc.log)
     69LOG_FILE=$(greadlink -f todisc.log)
    7070OUT_PREFIX=""
    7171TV_STANDARD=ntsc
    7272MENU_LEN=( 20 )
     
    264264        test -e "$LOG_FILE" && \
    265265        printf "%s\n%s %s\n%s\n" "$ME" "$ME" "$SEPARATOR" "$ME" >> "$LOG_FILE"
    266266    else
    267         sed "s/    */ /g;s/^ *//" <<< "$@" | fold -bs
     267        gsed "s/    */ /g;s/^ *//" <<< "$@" | fold -bs
    268268        test -e "$LOG_FILE" && \
    269             printf "%s %s\n" "$ME" "$@" | sed "s/    */ /g;s/^ *//" |
     269            printf "%s %s\n" "$ME" "$@" | gsed "s/    */ /g;s/^ *//" |
    270270            fold -bs >> "$LOG_FILE"
    271271    fi
    272272}
     
    276276# Returns: Exit status of the subprocess
    277277# To filter/prettify the subprocess output before writing it to the log file,
    278278# set the LOG_FILTER variable before calling this function, to e.g.
    279 #    LOG_FILTER="sed 's/\r/\r\n/g'"    # Replace LF with CR/LF
     279#    LOG_FILTER="gsed 's/\r/\r\n/g'"    # Replace LF with CR/LF
    280280# ******************************************************************************
    281281
    282282# Print script name, usage notes, and optional error message, then exit.
     
    318318
    319319format_output()
    320320{
    321     sed "s/    */ /g;s/^ *//"|fold -bs
     321    gsed "s/    */ /g;s/^ *//"|fold -bs
    322322}
    323323
    324324get_font()
    325325{
    326326    # If there is a filename extension, find the absolute path
    327327    if grep -q '\...*$' <<< "$1"; then
    328         readlink -f "$1"
     328        greadlink -f "$1"
    329329    # Otherwise, use the literal name
    330330    else
    331331        echo "$1"
     
    345345audio_length()
    346346{
    347347    mplayer -noconsolecontrols -vo null -ao pcm:fast:file=/dev/null "$1" \
    348     2>&1 | tr '\r' '\n' | grep ^A: | tail -1 | sed s/^.*A:// | awk '{print $1}'
     348    2>&1 | tr '\r' '\n' | grep ^A: | tail -1 | gsed s/^.*A:// | awk '{print $1}'
    349349}
    350350cleanup()
    351351{
     
    624624    yecho
    625625    fi
    626626    [[ $this_set = "group" ]] && echo -e "Stats for" \
    627     $(readlink -f "${FILES_IN[i]}") "\n" || \
     627    $(greadlink -f "${FILES_IN[i]}") "\n" || \
    628628    echo -e "Stats for" "${FILES_IN[i]}" "\n"
    629629    echo -e  \
    630630    " video codec:   " \
     
    713713        fi
    714714        if test ${#FILES_TO_ENCODE[@]} -lt 12 && ! $SINGLE_SLIDESHOW; then
    715715            for i in "${FILES_TO_ENCODE[@]}"; do
    716                 this_file=$(readlink -f "$i")
     716                this_file=$(greadlink -f "$i")
    717717                test -n "$this_file" && yecho " $this_file"
    718718            done
    719719        fi
     
    742742                yecho
    743743            fi
    744744            for i in "${!FILES_TO_ENCODE[@]}"; do
    745                 IN=$(readlink -f "${FILES_TO_ENCODE[i]}")
     745                IN=$(greadlink -f "${FILES_TO_ENCODE[i]}")
    746746                if $group_set; then
    747747                    is_image=${grp_file_is_image[i]}
    748748                    # we will replace the symlink with actual mpeg
     
    770770                    fi
    771771                    # AUDIO_FADE=false # do not fade silence FIXME ???
    772772                else # not an image file - outfile goes beside infile
    773                     THIS_FILE=$(readlink -f "${FILES_TO_ENCODE[i]}")
     773                    THIS_FILE=$(greadlink -f "${FILES_TO_ENCODE[i]}")
    774774                    yecho "Converting $THIS_FILE"
    775775                    echo
    776776                    countdown 3
     
    896896                unset chapt_len_array[${#chapt_len_array[@]}-1]
    897897                chapter_points=$( running_total <<< ${chapt_len_array[@]} )
    898898                # remove trailing space
    899                 chapter_points=$(sed 's/[ \t]*$//' <<< $chapter_points)
     899                chapter_points=$(gsed 's/[ \t]*$//' <<< $chapter_points)
    900900                remainder=$( bc <<< "$adjusted_length % $chapter_length" \
    901901                2>/dev/null)
    902902                (( ${nochapt[index]} )) && local group_chapters[x++]=0 ||
     
    926926            for number in ${group_chapters[d]}; do
    927927                new_element="$new_element $(format_seconds $number),"
    928928                grp_chapters[d]="${grp_chapters[d]} $number"
    929                 grp_chapters[d]=$(sed 's/[ \t]*$//' <<< ${grp_chapters[d]})
     929                grp_chapters[d]=$(gsed 's/[ \t]*$//' <<< ${grp_chapters[d]})
    930930            done
    931931            local array[d]=$new_element
    932932            unset new_element
     
    12751275    </menus>
    12761276  </vmgm>
    12771277EOF
    1278 ) |sed '/^ *$/d' >> "$DVDAUTHOR_XML"
     1278) |gsed '/^ *$/d' >> "$DVDAUTHOR_XML"
    12791279    get_genopts "${args[@]}"
    12801280
    12811281    #################### test for incompatible options #######################
     
    15771577    fi
    15781578    # find out where vhook lives for ffmpeg
    15791579    ffmpeg_prefix=$(which ffmpeg)
    1580     ffmpeg_prefix=$(sed 's/\/bin\/ffmpeg//g' <<< "$ffmpeg_prefix")
     1580    ffmpeg_prefix=$(gsed 's/\/bin\/ffmpeg//g' <<< "$ffmpeg_prefix")
    15811581    imlib2_vhook="$ffmpeg_prefix/lib/vhook/imlib2.so"
    15821582
    15831583    # check for badly compiled or otherwise unusable vhook
     
    16501650        "$outdir"/%06d.png)
    16511651        yecho "${FFMPEG_CMD[@]}" | strings
    16521652        "${FFMPEG_CMD[@]}" 2>&1 | strings >> "$LOG_FILE"
    1653         largest_png=$(du -s "$outdir"/*.png|sort -r |
     1653        largest_png=$(gdu -s "$outdir"/*.png|sort -r |
    16541654        awk 'NR>1{exit};1 {print $2}')
    16551655        mv "$largest_png" "$PREVIEW_IMG"
    16561656        yecho "Removing temporary preview files"
     
    17441744        in_files=( "${IN_FILES[@]}" )
    17451745    else
    17461746        for f in ${!grouping[@]}; do
    1747                 in_files[f]=$(readlink -f "${grouping[f]}")
     1747                in_files[f]=$(greadlink -f "${grouping[f]}")
    17481748        done
    17491749    fi
    17501750    for ((i=0; i<${#in_files[@]}; i++)); do
     
    19281928    done)
    19291929    fadeout:1
    19301930EOF
    1931     ) | sed '/^$/d;s/^[ \t]*//' > "$WORK_DIR/dvd-slideshow.conf"
     1931    ) | gsed '/^$/d;s/^[ \t]*//' > "$WORK_DIR/dvd-slideshow.conf"
    19321932}
    19331933
    19341934transition_slide()
     
    22372237            if $incoming_vids || [[ $sshows -eq 1 && $inc_files -lt 1 ]]; then
    22382238                for f in  ${!ARGS_ARRAY[@]}; do
    22392239                    FILENAMES[f]=${ARGS_ARRAY[f]}
    2240                     filenames[f]=$(readlink -f "${ARGS_ARRAY[f]}")
     2240                    filenames[f]=$(greadlink -f "${ARGS_ARRAY[f]}")
    22412241                done
    22422242                if $incoming_slides; then
    22432243                    SLIDESHOW=( ${SLIDESHOW[@]} : ) # is this a slideshow ?
     
    22522252                ! $GROUPING && mk_workdir
    22532253                unset group groupkey grp x
    22542254                for ((i=0; i<${#ARGS_ARRAY[@]}; i++)); do
    2255                     grp[x++]=$(readlink -f "${ARGS_ARRAY[i]}")
     2255                    grp[x++]=$(greadlink -f "${ARGS_ARRAY[i]}")
    22562256                done
    22572257                unset x
    22582258                [[ -z ${FILES[@]} ]] && ss_index=0 || ss_index=${#FILES[@]}
    22592259                SLIDESHOW[ss_index]=: # is this a slideshow ?
    2260                 FILES[ss_index]=$(readlink -f "${ARGS_ARRAY[0]}")
     2260                FILES[ss_index]=$(greadlink -f "${ARGS_ARRAY[0]}")
    22612261                GROUP_IN_FILES=( "${GROUP_IN_FILES[@]}" "${grp[@]}" )
    22622262                groupkey=${#FILES[@]}
    22632263                GROUP[groupkey-1]=${#grp[@]}
     
    23012301            get_listargs "$@"
    23022302            unset group groupkey grp x
    23032303            for ((i=1; i<${#ARGS_ARRAY[@]}; i++)); do
    2304                 grp[x++]=$(readlink -f "${ARGS_ARRAY[i]}")
     2304                grp[x++]=$(greadlink -f "${ARGS_ARRAY[i]}")
    23052305            done
    23062306            GROUP_IN_FILES=( "${GROUP_IN_FILES[@]}" "${grp[@]}" )
    23072307            ((${ARGS_ARRAY[0]})) 2>/dev/null || usage_error "Arguments to \
     
    23392339            shift
    23402340            get_listargs "$@"
    23412341            for f in  ${!ARGS_ARRAY[@]}; do
    2342                 SLIDESHOW_MENU_THUMBS[f]=$(readlink -f "${ARGS_ARRAY[f]}")
     2342                SLIDESHOW_MENU_THUMBS[f]=$(greadlink -f "${ARGS_ARRAY[f]}")
    23432343            done
    23442344            ;;
    23452345        "-submenu-titles" )
     
    25692569            shift
    25702570            get_listargs "$@"
    25712571            if [[ -n ${ARGS_ARRAY[@]} ]]; then
    2572                 SLIDESHOW_CONF=$(readlink -f "${ARGS_ARRAY[0]}")
     2572                SLIDESHOW_CONF=$(greadlink -f "${ARGS_ARRAY[0]}")
    25732573            fi
    25742574            USE_DVD_SLIDESHOW=:
    25752575            ;;
     
    26662666            ;;
    26672667        "-background" )
    26682668            shift
    2669             BACKGROUND=$(readlink -f "$1")
     2669            BACKGROUND=$(greadlink -f "$1")
    26702670            USERS_BACKGROUND=:
    26712671            ! [[ -e "$BACKGROUND" ]] && \
    26722672            usage_error "background \"$BACKGROUND\" does not exist"
     
    26752675            shift
    26762676            get_listargs "$@"
    26772677            for f in  ${!ARGS_ARRAY[@]}; do
    2678                 SM_BACKGROUND[f]=$(readlink -f "${ARGS_ARRAY[f]}")
     2678                SM_BACKGROUND[f]=$(greadlink -f "${ARGS_ARRAY[f]}")
    26792679                ! [[ -e ${SM_BACKGROUND[f]} ]] && usage_error \
    26802680                "submenu background \"$SM_BACKGROUND\" does not exist"
    26812681            done
     
    26832683        "-intro" )
    26842684            shift
    26852685            DO_INTRO=:
    2686             INTRO_CLIP=$(readlink -f "$1")
     2686            INTRO_CLIP=$(greadlink -f "$1")
    26872687            ! [[ -e "$INTRO_CLIP" ]] && \
    26882688            usage_error "intro clip \"$INTRO_CLIP\" does not exist"
    26892689            ;;
     
    26922692            get_listargs "$@"
    26932693            unset f
    26942694            for f in  ${!ARGS_ARRAY[@]}; do
    2695                 SHOWCASE_FILE[f]=$(readlink -f "${ARGS_ARRAY[f]}")
     2695                SHOWCASE_FILE[f]=$(greadlink -f "${ARGS_ARRAY[f]}")
    26962696            done
    26972697            SHOWCASE=:
    26982698            IMG_FMT="png"
     
    29652965            if [[ $1 = "none" ]]; then
    29662966                BG_AUDIO="none" # for switched menus
    29672967            else
    2968                 BG_AUDIO=$(readlink -f "$1")
     2968                BG_AUDIO=$(greadlink -f "$1")
    29692969                if [[ ! -e "$BG_AUDIO" ]]; then
    29702970                    usage_error "background audio \"$BG_AUDIO\" does not exist"
    29712971                fi
     
    29872987                        usage_error "audio file \"${ARGS_ARRAY[i]}\" not found"
    29882988                    else
    29892989                        SM_AUDIO=( "${SM_AUDIO[@]}" \
    2990                         "$(readlink -f "${ARGS_ARRAY[i]}")" )
     2990                        "$(greadlink -f "${ARGS_ARRAY[i]}")" )
    29912991                    fi
    29922992                fi
    29932993            done
     
    32173217                elif [[ ! -e $2 ]]; then
    32183218                    usage_error " subtitle file $2 does not exist"
    32193219                else
    3220                     TOVID_OPTS+=( "$1" "$(readlink -f "$2")" )
     3220                    TOVID_OPTS+=( "$1" "$(greadlink -f "$2")" )
    32213221                fi
    32223222            elif [[ $1 == "-config" ]]; then
    32233223                if [[ ! -e $2 ]]; then
    32243224                    usage_error "config file $2 does not exist"
    32253225                else
    3226                     TOVID_OPTS+=( "$1" "$(readlink -f "$2")" )
     3226                    TOVID_OPTS+=( "$1" "$(greadlink -f "$2")" )
    32273227                fi
    32283228            else
    32293229                TOVID_OPTS+=( "$1" )
     
    32753275fi
    32763276
    32773277if $BURN; then
    3278     if [[ ! -b $(readlink -f $BURN_DEVICE) ]]; then
     3278    if [[ ! -b $(greadlink -f $BURN_DEVICE) ]]; then
    32793279        usage_error \
    32803280        "$BURN_DEVICE is not a valid block device file or link to a block device.
    32813281        Are you sure your burner is \"${BURN_DEVICE}\"? Specify your burner with
     
    33873387
    33883388# Make sure -out was provided and it is valid
    33893389if test -n "$OUT_PREFIX"; then
    3390     OUT_DIR=$(readlink -f "$OUT_PREFIX")
     3390    OUT_DIR=$(greadlink -f "$OUT_PREFIX")
    33913391    if [[ ! -d ${OUT_DIR%/*} ]]; then
    3392         OUT_PATH=$(readlink -m "$OUT_PREFIX")
     3392        OUT_PATH=$(greadlink -m "$OUT_PREFIX")
    33933393        usage_error "The -out path ${OUT_PATH%/*}/ does not exist"
    33943394    fi
    33953395    if egrep -q '<|>|&' <<< "$OUT_DIR"; then
     
    35303530    # disallow spaces in thumb titles for text button style
    35313531    if [ "$BUTTON_STYLE" = "text" ]; then
    35323532        for ((i=0; i<${#TITLES[@]}; i++)); do
    3533             T=$(sed 's/^[ \t]*//;s/[ \t]*$//' <<< "${TITLES[i]}")
     3533            T=$(gsed 's/^[ \t]*//;s/[ \t]*$//' <<< "${TITLES[i]}")
    35343534            if grep "  " <<< "$T" >/dev/null; then
    35353535                echo "Sorry, a maximum of one consecutive space is allowed
    35363536                in titles for text buttons.  \"${TITLES[i]}\" has more than
     
    36823682"todisc from the tovid suite ($TOVID_VERSION) - log for `date`" \
    36833683"$PATTERN" >> "$LOG_FILE"
    36843684# put the command line into the log file to aid debugging
    3685 printf  "%s\n%s\n" todisc "${args[@]}" | sed "s/    */ /g;s/^ *//" | fold -bs >> "$LOG_FILE"
     3685printf  "%s\n%s\n" todisc "${args[@]}" | gsed "s/    */ /g;s/^ *//" | fold -bs >> "$LOG_FILE"
    36863686# do some locale debugging
    36873687echo -e "\nYou are using the following locale settings:" >> "$LOG_FILE"
    36883688locale >>  "$LOG_FILE" 2>&1
     
    39773977# Get absolute pathnames of all files
    39783978if ! $VMGM_ONLY; then
    39793979    for i in "${FILES[@]}"; do
    3980         IN_FILES=("${IN_FILES[@]}" "$(readlink -f "$i")")
     3980        IN_FILES=("${IN_FILES[@]}" "$(greadlink -f "$i")")
    39813981        (( ${#FILES[@]} < 12 )) && echo "Adding: $i" || spin "Adding: ${i##*/}"
    39823982    done
    39833983fi
     
    41254125            used ${CHAPT_ARRAY[i]}"
    41264126        fi
    41274127        # remove + sign and commas, count the number of chapters left
    4128         str=$(sed 's/+/ /g;s/,/ /g' <<< ${CHAPTERS[i]})
     4128        str=$(gsed 's/+/ /g;s/,/ /g' <<< ${CHAPTERS[i]})
    41294129        for substr in $str; do [[ $substr != 0 ]] && newchapts+=($substr); done
    41304130        CHAPTERS[i]=${#newchapts[@]}
    41314131    done
     
    43624362        #*slide_grp*.mpg are symlinks to the original images we have kept intact
    43634363        mixgroup=( "$WORK_DIR"/${TSET_NUM}-slide_grp-*.mpg )
    43644364        for g in ${!mixgroup[@]}; do
    4365             MIXFILES[g]=$(readlink -f "${mixgroup[g]}")
     4365            MIXFILES[g]=$(greadlink -f "${mixgroup[g]}")
    43664366            MIXLINKS[g]=${mixgroup[g]}
    43674367            # remove original link we can keep track of what is already encoded
    43684368            rm -f "${MIXLINKS[g]}"
     
    45224522        for ((i=0; i<${#TITLES[@]}; i++)); do
    45234523            if [[ ${#TITLES[i]} -gt 35 || \
    45244524            $(echo -e "${TITLES[i]}" |wc -l) -gt 1 ]]; then
    4525                 TITLE[i]=$(sed 's/^  *//'<<<${TITLES[i]//\\n/ }) # no spaces or \n
     4525                TITLE[i]=$(gsed 's/^  *//'<<<${TITLES[i]//\\n/ }) # no spaces or \n
    45264526                TITLE[i]=${TITLE[i]:0:35} # cut down to 35 characters maximum
    45274527                if [ ${#TITLES[i]} -gt 35 ]; then
    45284528                    echo "  \"${TITLE[i]}...\" (${IN_FILES[i]})" # "..."
     
    54955495            $SWITCHED && MPLAYER_SEEK_VAL=${SEEK_VAL[MENU_NUM-1]}
    54965496            echo "Using mplayer to get framed images from the showcase video"
    54975497            get_framed_pics "$SHOWCASE_VIDEO" >> "$LOG_FILE" 2>&1
    5498             largest_png=$(du -s "$WORK_DIR"/000000*.png|sort -r |
     5498            largest_png=$(gdu -s "$WORK_DIR"/000000*.png|sort -r |
    54995499                                awk 'NR>1{exit};1 {print $2}')
    55005500            mv -v "$largest_png" "$OUT"
    55015501            rm -f "$WORK_DIR"/00000*.png
     
    55795579        if [ "$SC_FRAMESTYLE" = "glass" ]; then
    55805580            MPLAYER_SEEK_VAL=${SEEK_VAL[i]}
    55815581            get_framed_pics "${IN_FILES[i]}"  >> "$LOG_FILE" 2>&1
    5582             largest_png=$(du -s $WORK_DIR/000*[0-9].png | sort -r |
     5582            largest_png=$(gdu -s $WORK_DIR/000*[0-9].png | sort -r |
    55835583                                        awk 'NR>1{exit};1 {print $2}')
    55845584            mv -f $largest_png $WORK_DIR/pics/$i/$(printf "%06d%s" 0 .$IMG_FMT)
    55855585            rm -f "$WORK_DIR"/000*[0-9].png
     
    66986698    echo ". . . Getting stats on grouped files now . . ."
    66996699    echo
    67006700    for u in ${!grouping[@]}; do
    6701         CUR_VID=$(readlink -f "${grouping[u]}")
     6701        CUR_VID=$(greadlink -f "${grouping[u]}")
    67026702        spin "Getting stats on "${CUR_VID##*/}""
    67036703        group_idvid_stats[u]=$(idvid -terse -accurate "$CUR_VID" 2>/dev/null)
    67046704        if [ -s "$CUR_VID.nav_log" ]; then
     
    73567356  </stream>
    73577357</subpictures>
    73587358EOF
    7359 ) |sed '/^ *$/d'  > "$SPUMUX_XML"
     7359) |gsed '/^ *$/d'  > "$SPUMUX_XML"
    73607360
    73617361if $SUB_MENU; then
    73627362    JUMP=menu
     
    75267526echo "$POST"
    75277527            echo "      </pgc>"
    75287528            echo "      <pgc>"
    7529         done | sed '$d'
     7529        done | gsed '$d'
    75307530fi)
    75317531    </menus>
    75327532    <titles>
     
    76747674echo -e "</dvdauthor>"
    76757675fi)
    76767676EOF
    7677 ) |sed '/^ *$/d' >> "$DVDAUTHOR_XML"
     7677) |gsed '/^ *$/d' >> "$DVDAUTHOR_XML"
    76787678##############################################################################
    76797679#                            Animenu stuff                                   #
    76807680##############################################################################
     
    78597859                else
    78607860                    CUR_FILE="${IN_FILES[i]}"
    78617861                fi
    7862                 navlog=$(readlink -f "${CUR_FILE}").nav_log
     7862                navlog=$(greadlink -f "${CUR_FILE}").nav_log
    78637863                if [[ -s $navlog ]]; then
    78647864                    NAVSEEK="--nav_seek" && NAVLOG="$navlog"
    78657865                else
     
    78717871                $NAVSEEK "$NAVLOG" -o "${PICS_OUT[@]}" -f \
    78727872                $FRAME_RATE -Z ${GEO_ARRAY[C]},fast -c $t -y $SM_IMG_FMT,null)
    78737873                echo "Running ${TCODE_CMD[@]}" |
    7874                 sed 's/    */ /g'|sed -e "s/^ *//"|tee -a >> "$LOG_FILE"
    7875                 #sed 's/    */ /g'|sed -e "s/^ *//"|fold -bs >> "$LOG_FILE"
     7874                gsed 's/    */ /g'|gsed -e "s/^ *//"|tee -a >> "$LOG_FILE"
     7875                #gsed 's/    */ /g'|gsed -e "s/^ *//"|fold -bs >> "$LOG_FILE"
    78767876                echo >> "$LOG_FILE"
    78777877                run_transcode()
    78787878                {
     
    80158015                    for ((b=0; b<${CHAPTERS[i]}; b++)); do
    80168016                        IMGS=( "${IMGS[@]}" $(find $WORK_DIR/animenu/$b \
    80178017                        -name \*.$SM_IMG_FMT| sort 2>/dev/null | head -n $a |
    8018                         sed -n -e "$a p") )
     8018                        gsed -n -e "$a p") )
    80198019                    done
    80208020                    IM_CMD=(convert "${IMGS[@]}" -bordercolor '#6E6E6E' \
    80218021                    -border $THUMB_FRAME_SIZE miff:-)
     
    81978197                echo -e "Running:
    81988198                sox $WORK_DIR/menu$s.wav $WORK_DIR/menu$s-processed.wav fade t
    81998199                $SM_FADE ${SUBMENU_AUDIOLEN[s]} $SM_FADE" |
    8200                 sed 's/    */ /g' | format_output
     8200                gsed 's/    */ /g' | format_output
    82018201                sox -q $WORK_DIR/menu$s.wav $WORK_DIR/menu$s-processed.wav \
    82028202                 fade t $SM_FADE ${SUBMENU_AUDIOLEN[s]} $SM_FADE
    82038203                rm $WORK_DIR/menu$s.wav
     
    83298329        num_procs=0
    83308330        for p in ${!SC_PICS[@]}; do
    83318331            ((num_procs++)) # how many processes are running
    8332             this_pic=$(sed 's,.*/,,;s/^0*//;s/.png//' <<< "${SC_PICS[p]}")
     8332            this_pic=$(gsed 's,.*/,,;s/^0*//;s/.png//' <<< "${SC_PICS[p]}")
    83338333            pic="${SC_PICS[p]}"
    83348334            # if glass and either wave or rotate
    83358335            if [ "$SC_FRAMESTYLE" = "glass" ] && \
     
    91899189    for ((x=1; x<=V_TOTAL; x++)); do
    91909190        yecho "Running spumux "$WORK_DIR/submenu${x}_spumux.xml" < \
    91919191        $WORK_DIR/menu${x}.mpg > \
    9192         $(sed 's/\(.*\)menu/\1Menu/' <<< $WORK_DIR/menu${x}.mpg)"|fold -bs
     9192        $(gsed 's/\(.*\)menu/\1Menu/' <<< $WORK_DIR/menu${x}.mpg)"|fold -bs
    91939193        spumux "$WORK_DIR/submenu${x}_spumux.xml" < \
    91949194        $WORK_DIR/menu${x}.mpg > \
    9195         $(sed 's/\(.*\)menu/\1Menu/' <<< $BASEDIR/${TSET_NUM}-menu${x}.mpg) \
     9195        $(gsed 's/\(.*\)menu/\1Menu/' <<< $BASEDIR/${TSET_NUM}-menu${x}.mpg) \
    91969196        2>> "$LOG_FILE"
    91979197    done
    91989198fi
  • tovid-init

    diff -ur src.orig/tovid-init src/tovid-init
    old new  
    299299
    300300    # File size in bytes
    301301    FOP_LAST_SIZE=0
    302     FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
     302    FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}')
    303303
    304304    # Keep looping until outfile stops getting bigger
    305305    while test "$FOP_CUR_SIZE" -gt "$FOP_LAST_SIZE"; do
     
    322322        sleep ${SLEEP_TIME-"1s"}
    323323
    324324        FOP_LAST_SIZE=$FOP_CUR_SIZE
    325         FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
     325        FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}')
    326326    done
    327327    printf "\n\n"
    328328}
     
    560560    # *************************************************************************
    561561    # Required Dependencies
    562562    # *************************************************************************
    563     core="grep sed md5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg"
     563    core="grep gsed gmd5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg"
    564564
    565565    # *************************************************************************
    566566    # Optional Dependencies
  • tovid-init.in

    diff -ur src.orig/tovid-init.in src/tovid-init.in
    old new  
    299299
    300300    # File size in bytes
    301301    FOP_LAST_SIZE=0
    302     FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
     302    FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}')
    303303
    304304    # Keep looping until outfile stops getting bigger
    305305    while test "$FOP_CUR_SIZE" -gt "$FOP_LAST_SIZE"; do
     
    322322        sleep ${SLEEP_TIME-"1s"}
    323323
    324324        FOP_LAST_SIZE=$FOP_CUR_SIZE
    325         FOP_CUR_SIZE=$(du -b "$FOP_OUTFILE" | awk '{print $1}')
     325        FOP_CUR_SIZE=$(gdu -b "$FOP_OUTFILE" | awk '{print $1}')
    326326    done
    327327    printf "\n\n"
    328328}
     
    560560    # *************************************************************************
    561561    # Required Dependencies
    562562    # *************************************************************************
    563     core="grep sed md5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg"
     563    core="grep gsed gmd5sum mplayer mencoder mplex mpeg2enc yuvfps yuvdenoise ppmtoy4m mp2enc jpeg2yuv ffmpeg"
    564564
    565565    # *************************************************************************
    566566    # Optional Dependencies