Changeset 491 for trunk


Ignore:
Timestamp:
11/11/2009 15:59:06 (3 years ago)
Author:
ccowart
Message:

Defining $sed_i_cmd that deals with OS-specific logic for whether
-i must take a flag and whether it should be a separate shell word. Also
making the use of ${sed_cmd} consistent (there were some occurrences of
sed without the variable wrapper).

Fixes #98

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/confman.in

    r490 r491  
    157157    done 
    158158    rm -f "$orig_log" 
    159     ${sed_cmd} -i '' -e "/${ignoreline}/,\$d" "$logfile" 2>/dev/null 
     159    ${sed_i_cmd} -e "/${ignoreline}/,\$d" "$logfile" 2>/dev/null 
    160160    echo "$logfile" 
    161161    return 0 
     
    529529    realpath=${dir#${WORK_PATH}/${module}} 
    530530     
    531     local directories=`echo "$realpath" | sed 's:/: :g'` 
     531    local directories=`echo "$realpath" | ${sed_cmd} -e 's:/: :g'` 
    532532    local fulldir="" 
    533533     
  • trunk/confmancommon.sh.in

    r462 r491  
    7676    mktemp_dir="mktemp -d -t confman" 
    7777    sed_cmd="sed -E" 
     78    sed_i_cmd="${sed_cmd} -i \"\"" 
    7879    stat_cmd="stat -f" 
    7980    stat_opts="mode=%Mp%Lp owner=%Su group=%Sg" 
     
    8586    mktemp_dir="mktemp -t -d confman.XXXXXX" 
    8687    sed_cmd="sed -r" 
     88    sed_i_cmd="${sed_cmd} -i" 
    8789    stat_cmd="stat -c" 
    8890    stat_opts="mode=%a owner=%U group=%G" 
     
    9496    mktemp_dir="mktemp -d -t confman" 
    9597    sed_cmd="sed -E" 
     98    sed_i_cmd="${sed_cmd} -i \"\"" 
    9699    stat_cmd="stat -f" 
    97100    stat_opts="mode=%Mp%Lp owner=%Su group=%Sg" 
  • trunk/confmanlib.sh.in

    r477 r491  
    422422        for directory in `find -L $moduledir -mindepth 1 -type d | grep -v "\.svn"`; 
    423423    do 
    424                 local livedir=`echo $directory | sed "s:$moduledir::"` 
     424                local livedir=`echo $directory | ${sed_cmd} -e "s:$moduledir::"` 
    425425                livedir="${LIVE_ROOT}${livedir}" 
    426426                local owner=`conf_get_prop ${directory} owner` 
     
    433433        done 
    434434        for file in `find -L $moduledir -type f | grep -v "\.svn"` ; do 
    435                 local livefile=`echo "$file" | sed "s:$moduledir::"` 
     435                local livefile=`echo "$file" | ${sed_cmd} -e "s:$moduledir::"` 
    436436                local owner=`conf_get_prop ${file} owner` 
    437437                local group=`conf_get_prop ${file} group` 
     
    798798        local mode=$4 
    799799        local workdir="" 
    800         local directories=`echo "$directory" | sed 's:/: :g'` 
     800        local directories=`echo "$directory" | ${sed_cmd} -e 's:/: :g'` 
    801801        local dir 
    802802 
     
    859859 
    860860    find ${WORK_PATH}/${newmod} -type f -not -path '*/.svn/*' -exec \ 
    861         ${sed_cmd} -i"" \ 
     861        ${sed_i_cmd} \ 
    862862        "s/(Managed under )${oldmod}( module\.)$/\1${newmod}\2/" {} \; \ 
    863863        || return 1 
Note: See TracChangeset for help on using the changeset viewer.