Changeset 325 for trunk


Ignore:
Timestamp:
05/06/2009 13:11:36 (3 years ago)
Author:
ccowart
Message:

Using autotools to fill in paths for bash, svn, and sudo.

Location:
trunk
Files:
8 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.am

    r323 r325  
    4747                -e 's,[@]sbindir[@],$(sbindir),g' \ 
    4848                -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ 
    49                 -e 's,[@]sysconfdefaultsdir[@],$(sysconfdefaultsdir),g' 
     49                -e 's,[@]sysconfdefaultsdir[@],$(sysconfdefaultsdir),g' \ 
     50                -e 's,[@]BASH[@],$(BASH),g' \ 
     51                -e 's,[@]SUDO[@],$(SUDO),g' \ 
     52                -e 's,[@]SVN[@],$(SVN),g' 
    5053 
    5154confman: confman.in Makefile 
     
    6164        chmod +x confexport 
    6265 
     66conflock: conflock.in Makefile 
     67        $(do_subst) < conflock.in > conflock 
     68        chmod +x conflock 
     69 
    6370confsync: confsync.in Makefile 
    6471        $(do_subst) < confsync.in > confsync 
     
    6875        $(do_subst) < confaudit.in > confaudit 
    6976        chmod +x confaudit 
     77 
     78abspath: abspath.in Makefile 
     79        $(do_subst) < abspath.in > abspath 
     80        chmod +x abspath 
     81 
     82confmanlib.sh: confmanlib.sh.in Makefile 
     83        $(do_subst) < confmanlib.sh.in > confmanlib.sh 
    7084 
    7185confmancommon.sh: confmancommon.sh.in Makefile 
  • trunk/abspath.in

    r273 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
  • trunk/confadmin.in

    r323 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
     
    5252    local dir dirs 
    5353    local msg="Initial confman directory setup."  
    54     if svn ls "${REPO_URI}/trunk/checkpoints" >/dev/null 2>&1 ; then 
     54    if @SVN@ ls "${REPO_URI}/trunk/checkpoints" >/dev/null 2>&1 ; then 
    5555        echo "It looks like this repository has already been setup." >&2 
    5656        exit 1 
     
    5959        dirs="${dirs} ${REPO_URI}/${dir}" 
    6060    done 
    61     svn mkdir -m "$msg" ${dirs} 
     61    @SVN@ mkdir -m "$msg" ${dirs} 
    6262} 
    6363 
  • trunk/confaudit.in

    r321 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
  • trunk/confexport.in

    r321 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
  • trunk/conflock.in

    r299 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
  • trunk/confman.in

    r323 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
     
    131131        cat $LOG_TEMPLATE > $msg 
    132132        printf "\n${ignoreline}\n" >> $msg 
    133         conf_get_recipe | tr ' ' '\n' | xargs -I % svn status \ 
     133        conf_get_recipe | tr ' ' '\n' | xargs -I % @SVN@ status \ 
    134134            ${WORK_PATH}/% >> $status 
    135135                cat $status >> $msg 
     
    199199            files="$files $file" 
    200200        done 
    201         svn status $files >> $status 
     201        @SVN@ status $files >> $status 
    202202        cat $status >> $msg 
    203203        cp $msg $orig_msg 
  • trunk/confman_completion.in

    r302 r325  
    1 #!/bin/bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
  • trunk/confmancommon.sh.in

    r323 r325  
    3535TMPFILES="" 
    3636if [ `id -u` != "0" ]; then 
    37     SUDO=sudo 
     37    SUDO="@SUDO@" 
    3838fi 
    3939 
  • trunk/confmanlib.sh.in

    r317 r325  
    5252        chmod 700 ${WORK_PATH} 
    5353         
    54         svn checkout ${REPO_TRUNK} ${WORK_PATH} 
     54        @SVN@ checkout ${REPO_TRUNK} ${WORK_PATH} 
    5555        else 
    56         svn update ${WORK_PATH} 
     56        @SVN@ update ${WORK_PATH} 
    5757        fi 
    5858} 
     
    6161function conf_update_module { 
    6262        local module="$1" 
    63         svn update ${WORK_PATH}/${module} 
     63        @SVN@ update ${WORK_PATH}/${module} 
    6464} 
    6565 
    6666# Updates the whole source tree 
    6767function conf_update_tree { 
    68         svn update ${WORK_PATH} 
     68        @SVN@ update ${WORK_PATH} 
    6969} 
    7070 
     
    9696# Revert a working file 
    9797function conf_revert { 
    98         svn revert $* 
     98        @SVN@ revert $* 
    9999} 
    100100 
     
    102102function conf_create_module { 
    103103        local module=$1 
    104         svn mkdir ${WORK_PATH}/$module 
    105         svn mkdir ${WORK_PATH}/${REPO_CHECKPTS}/$module 
    106         svn commit ${WORK_PATH}/${module} ${WORK_PATH}/${REPO_CHECKPTS}/$module -m \ 
     104        @SVN@ mkdir ${WORK_PATH}/$module 
     105        @SVN@ mkdir ${WORK_PATH}/${REPO_CHECKPTS}/$module 
     106        @SVN@ commit ${WORK_PATH}/${module} ${WORK_PATH}/${REPO_CHECKPTS}/$module -m \ 
    107107                        "Created directory structure for ${module} --`whoami`" 
    108108} 
     
    121121                -exec ${readlink_cmd} -m {} \;`" 
    122122        done 
    123             svn commit -F "$msg" $(eval echo ${WORK_PATH}/{$modules}) \ 
     123            @SVN@ commit -F "$msg" $(eval echo ${WORK_PATH}/{$modules}) \ 
    124124            $symlinks 
    125125    else 
    126126        symlinks="$symlinks `find ${modules} -type l \ 
    127127            -exec ${readlink_cmd} -m {} \;`" 
    128         svn commit -F "$msg" ${WORK_PATH}/$modules \ 
     128        @SVN@ commit -F "$msg" ${WORK_PATH}/$modules \ 
    129129            $symlinks 
    130130    fi 
     
    142142    done 
    143143 
    144     svn commit -F "$msg" $files 
     144    @SVN@ commit -F "$msg" $files 
    145145} 
    146146 
     
    175175# A way to utilize the svn status feature. 
    176176function conf_status { 
    177         svn status $* 
     177        @SVN@ status $* 
    178178} 
    179179 
     
    298298        local module=`echo ${file#$WORK_PATH} | ${sed_cmd} -e 's:/([^/]+)/.*:\1:'` 
    299299        local livefile=`echo ${file#$WORK_PATH} | ${sed_cmd} -e 's:/([^/]+)/:/:'` 
    300     if svn status $file | egrep -q "^\?"; then 
     300    if @SVN@ status $file | egrep -q "^\?"; then 
    301301        echo -e "Not in confman repository\t\t${livefile}" 
    302302        return 
     
    384384 
    385385    ln -s $opts "$target" "$link" 
    386     svn add "$link" 
     386    @SVN@ add "$link" 
    387387} 
    388388 
     
    395395        local revision=`conf_revision` 
    396396        echo $revision > $chkpath 
    397         svn add $chkpath 
     397        @SVN@ add $chkpath 
    398398        local msg="Created a checkpoint, ${checkpoint} for ${module} --`whoami`" 
    399         svn commit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg" 
     399        @SVN@ commit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg" 
    400400} 
    401401 
     
    406406        local checkpoint=$2 
    407407        local chkpath="${WORK_PATH}/${REPO_CHECKPTS}/${module}/${checkpoint}" 
    408         svn rm ${chkpath} 
     408        @SVN@ rm ${chkpath} 
    409409        local msg="Removed the checkpoint ${checkpoint} from ${module} --`whoami`" 
    410         svn commit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg" 
     410        @SVN@ commit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg" 
    411411} 
    412412 
     
    436436 
    437437        #svn update --revision $revision $modpath  
    438         svn update --revision $revision $modpath $symlinks 
     438        @SVN@ update --revision $revision $modpath $symlinks 
    439439} 
    440440 
     
    443443        local file=$1 
    444444        local prop=$2 
    445         local result=`svn propget "confman:${prop}" ${file}` 
     445        local result=`@SVN@ propget "confman:${prop}" ${file}` 
    446446    if [ -z "$result" ] ; then 
    447447        file=`$readlink_cmd -m ${file}` 
    448         svn propget "confman:${prop}" ${file} 
     448        @SVN@ propget "confman:${prop}" ${file} 
    449449    else 
    450450        echo $result 
     
    457457        local prop=$2 
    458458        local value=$3 
    459         svn propset "confman:${prop}" "${value}" ${file} 
     459        @SVN@ propset "confman:${prop}" "${value}" ${file} 
    460460} 
    461461 
     
    486486        fi 
    487487 
    488         svn add $myfile 
    489         svn ps svn:keywords "Id" $myfile 
     488        @SVN@ add $myfile 
     489        @SVN@ ps svn:keywords "Id" $myfile 
    490490        conf_set_prop $myfile owner $owner 
    491491        conf_set_prop $myfile group $group 
     
    496496 
    497497function conf_rm_file { 
    498         svn rm $* 
     498        @SVN@ rm $* 
    499499} 
    500500 
     
    511511                workdir="${workdir}/${dir}" 
    512512                if [ ! -d ${workdir} ] ; then 
    513                         echo svn mkdir ${workdir} 
    514                         svn mkdir ${workdir} 
     513                        echo @SVN@ mkdir ${workdir} 
     514                        @SVN@ mkdir ${workdir} 
    515515                        conf_set_prop $workdir owner $owner 
    516516                        conf_set_prop $workdir group $group 
     
    523523function conf_rmmod { 
    524524        local module=$1 
    525         svn rm ${WORK_PATH}/${module} 
    526         svn rm ${WORK_PATH}/${REPO_CHECKPTS}/${module} 
     525        @SVN@ rm ${WORK_PATH}/${module} 
     526        @SVN@ rm ${WORK_PATH}/${REPO_CHECKPTS}/${module} 
    527527} 
    528528 
     
    533533 
    534534        # First, we perform the easy operations 
    535         svn mv ${WORK_PATH}/${oldmod} ${WORK_PATH}/${newmod} || \ 
     535        @SVN@ mv ${WORK_PATH}/${oldmod} ${WORK_PATH}/${newmod} || \ 
    536536                {       echo "There was a problem renaming the modules." >&4 ; \ 
    537537                        conf_cleanExit 1  
    538538                } 
    539         svn mv ${WORK_PATH}/${REPO_CHECKPTS}/${oldmod} \ 
     539        @SVN@ mv ${WORK_PATH}/${REPO_CHECKPTS}/${oldmod} \ 
    540540                        ${WORK_PATH}/${REPO_CHECKPTS}/${newmod} || \ 
    541541                {       echo "There was a problem renaming the checkpts." >&4 ; \ 
     
    543543                } 
    544544 
    545         svn update ${WORK_PATH} || \ 
     545        @SVN@ update ${WORK_PATH} || \ 
    546546                {       echo "Your working copy didn't update correctly." >&4 ; \ 
    547547                        conf_cleanExit 1  
    548548                } 
    549         svn commit -m "Renaming ${oldmod} to ${newmod}, phase 1." \ 
     549        @SVN@ commit -m "Renaming ${oldmod} to ${newmod}, phase 1." \ 
    550550                ${WORK_PATH}/{,${REPO_CHECKPTS}}/{${oldmod},${newmod}} || \ 
    551551                {       echo "Committing the changes failed." >&4 ; conf_cleanExit 1  
     
    555555        for file in ${SINGULARITIES} ; do 
    556556                if [ -f "${WORK_PATH}/${newmod}${file}-${oldmod}" ] ; then 
    557                         svn mv ${WORK_PATH}/${newmod}${file}-${oldmod} \ 
     557                        @SVN@ mv ${WORK_PATH}/${newmod}${file}-${oldmod} \ 
    558558                                        ${WORK_PATH}/${newmod}${file}-${newmod} 
    559559                fi 
    560560        done 
    561561 
    562         svn update ${WORK_PATH} || \ 
     562        @SVN@ update ${WORK_PATH} || \ 
    563563                {       echo "Your working copy didn't update correctly." >&4 ; \ 
    564564                        conf_cleanExit 1  
    565565                } 
    566         svn commit -m "Renaming ${oldmod} to ${newmod}, phase 2." \ 
     566        @SVN@ commit -m "Renaming ${oldmod} to ${newmod}, phase 2." \ 
    567567                ${WORK_PATH}/${newmod} || \ 
    568568                {       echo "Committing the changes failed." >&4 ; conf_cleanExit 1  
     
    574574                {} \; 
    575575         
    576         svn update ${WORK_PATH} || \ 
     576        @SVN@ update ${WORK_PATH} || \ 
    577577                {       echo "Your working copy didn't update correctly." >&4 ; \ 
    578578                        conf_cleanExit 1  
    579579                } 
    580         svn commit -m "Renaming ${oldmod} to ${newmod}, complete." \ 
     580        @SVN@ commit -m "Renaming ${oldmod} to ${newmod}, complete." \ 
    581581                ${WORK_PATH}/${newmod} || \ 
    582582                {       echo "Committing the changes failed." >&4 ; conf_cleanExit 1  
     
    587587        local oldname=$1 
    588588        local newname=$2 
    589         svn mv $oldname $newname 
     589        @SVN@ mv $oldname $newname 
    590590} 
    591591 
     
    593593        local oldname=$1 
    594594        local newname=$2 
    595         svn cp $oldname $newname 
     595        @SVN@ cp $oldname $newname 
    596596} 
    597597 
    598598function conf_diff { 
    599         svn diff $* 
     599        @SVN@ diff $* 
    600600} 
    601601 
    602602function conf_log { 
    603         svn log $* 
     603        @SVN@ log $* 
    604604} 
    605605 
     
    614614    local value="$1" 
    615615    shift 
    616     svn propset "$attr" "$value" "$@" 
     616    @SVN@ propset "$attr" "$value" "$@" 
    617617} 
    618618 
     
    621621    shift 
    622622    echo "$file" 
    623     for prop in $(svn proplist $file | grep 'confman:' | sort) ; do 
    624         echo -e "\t${prop#confman:}\t" $(svn propget $prop $file) 
     623    for prop in $(@SVN@ proplist $file | grep 'confman:' | sort) ; do 
     624        echo -e "\t${prop#confman:}\t" $(@SVN@ propget $prop $file) 
    625625    done 
    626626    if [ -n "$1" ] ; then 
     
    632632    local attr="confman:$1" 
    633633    shift 
    634     svn propdel "$attr" "$@" 
     634    @SVN@ propdel "$attr" "$@" 
    635635} 
    636636 
     
    639639    local toReturn=true 
    640640    for file in "$@" ; do 
    641         cmd=$(svn propget "confman:syncheck" "$file") 
     641        cmd=$(@SVN@ propget "confman:syncheck" "$file") 
    642642        if [ -z "$cmd" ] ; then 
    643643            continue 
     
    670670# Returns the current revision number of the repository on stdout 
    671671function conf_revision { 
    672     svn info ${WORK_PATH} | awk '/Last Changed Rev:/ {print $4}' 
     672    @SVN@ info ${WORK_PATH} | awk '/Last Changed Rev:/ {print $4}' 
    673673} 
    674674 
     
    732732    fi 
    733733    touch "$recipe_file" 
    734     svn add "$recipe_file" 
     734    @SVN@ add "$recipe_file" 
    735735} 
    736736 
     
    739739    local recipe_file="$2" 
    740740    cat "$recipe_file" > "${RECIPEDIR}/${recipe}" 
    741     svn commit "${RECIPEDIR}/${recipe}" 
     741    @SVN@ commit "${RECIPEDIR}/${recipe}" 
    742742} 
    743743 
     
    749749        return 1 
    750750    fi 
    751     svn rm "${recipe_file}" 
    752     svn commit "${recipe_file}" 
     751    @SVN@ rm "${recipe_file}" 
     752    @SVN@ commit "${recipe_file}" 
    753753} 
    754754 
     
    781781        # And this clears any locks we may have created on our working copy: 
    782782        echo "Undoing damage to your working copy..." >&4 
    783         [ -d "${WORK_PATH}" ] && svn cleanup ${WORK_PATH} 
     783        [ -d "${WORK_PATH}" ] && @SVN@ cleanup ${WORK_PATH} 
    784784 
    785785    echo "All clean. Terminating." >&4 
  • trunk/confsync.in

    r321 r325  
    1 #! /usr/bin/env bash 
     1#!@BASH@ 
    22# 
    33# Copyright (c) 2008, Christopher Cowart and contributors 
Note: See TracChangeset for help on using the changeset viewer.