- Timestamp:
- 05/06/2009 13:11:36 (3 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
- 3 moved
-
Makefile.am (modified) (3 diffs)
-
abspath.in (moved) (moved from trunk/abspath) (1 diff)
-
confadmin.in (modified) (3 diffs)
-
confaudit.in (modified) (1 diff)
-
confexport.in (modified) (1 diff)
-
conflock.in (moved) (moved from trunk/conflock) (1 diff)
-
confman.in (modified) (3 diffs)
-
confman_completion.in (modified) (1 diff)
-
confmancommon.sh.in (modified) (1 diff)
-
confmanlib.sh.in (moved) (moved from trunk/confmanlib.sh) (33 diffs)
-
confsync.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.am
r323 r325 47 47 -e 's,[@]sbindir[@],$(sbindir),g' \ 48 48 -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' 50 53 51 54 confman: confman.in Makefile … … 61 64 chmod +x confexport 62 65 66 conflock: conflock.in Makefile 67 $(do_subst) < conflock.in > conflock 68 chmod +x conflock 69 63 70 confsync: confsync.in Makefile 64 71 $(do_subst) < confsync.in > confsync … … 68 75 $(do_subst) < confaudit.in > confaudit 69 76 chmod +x confaudit 77 78 abspath: abspath.in Makefile 79 $(do_subst) < abspath.in > abspath 80 chmod +x abspath 81 82 confmanlib.sh: confmanlib.sh.in Makefile 83 $(do_subst) < confmanlib.sh.in > confmanlib.sh 70 84 71 85 confmancommon.sh: confmancommon.sh.in Makefile -
trunk/abspath.in
r273 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors -
trunk/confadmin.in
r323 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors … … 52 52 local dir dirs 53 53 local msg="Initial confman directory setup." 54 if svnls "${REPO_URI}/trunk/checkpoints" >/dev/null 2>&1 ; then54 if @SVN@ ls "${REPO_URI}/trunk/checkpoints" >/dev/null 2>&1 ; then 55 55 echo "It looks like this repository has already been setup." >&2 56 56 exit 1 … … 59 59 dirs="${dirs} ${REPO_URI}/${dir}" 60 60 done 61 svnmkdir -m "$msg" ${dirs}61 @SVN@ mkdir -m "$msg" ${dirs} 62 62 } 63 63 -
trunk/confaudit.in
r321 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors -
trunk/confexport.in
r321 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors -
trunk/conflock.in
r299 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors -
trunk/confman.in
r323 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors … … 131 131 cat $LOG_TEMPLATE > $msg 132 132 printf "\n${ignoreline}\n" >> $msg 133 conf_get_recipe | tr ' ' '\n' | xargs -I % svnstatus \133 conf_get_recipe | tr ' ' '\n' | xargs -I % @SVN@ status \ 134 134 ${WORK_PATH}/% >> $status 135 135 cat $status >> $msg … … 199 199 files="$files $file" 200 200 done 201 svnstatus $files >> $status201 @SVN@ status $files >> $status 202 202 cat $status >> $msg 203 203 cp $msg $orig_msg -
trunk/confman_completion.in
r302 r325 1 #! /bin/bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors -
trunk/confmancommon.sh.in
r323 r325 35 35 TMPFILES="" 36 36 if [ `id -u` != "0" ]; then 37 SUDO= sudo37 SUDO="@SUDO@" 38 38 fi 39 39 -
trunk/confmanlib.sh.in
r317 r325 52 52 chmod 700 ${WORK_PATH} 53 53 54 svncheckout ${REPO_TRUNK} ${WORK_PATH}54 @SVN@ checkout ${REPO_TRUNK} ${WORK_PATH} 55 55 else 56 svnupdate ${WORK_PATH}56 @SVN@ update ${WORK_PATH} 57 57 fi 58 58 } … … 61 61 function conf_update_module { 62 62 local module="$1" 63 svnupdate ${WORK_PATH}/${module}63 @SVN@ update ${WORK_PATH}/${module} 64 64 } 65 65 66 66 # Updates the whole source tree 67 67 function conf_update_tree { 68 svnupdate ${WORK_PATH}68 @SVN@ update ${WORK_PATH} 69 69 } 70 70 … … 96 96 # Revert a working file 97 97 function conf_revert { 98 svnrevert $*98 @SVN@ revert $* 99 99 } 100 100 … … 102 102 function conf_create_module { 103 103 local module=$1 104 svnmkdir ${WORK_PATH}/$module105 svnmkdir ${WORK_PATH}/${REPO_CHECKPTS}/$module106 svncommit ${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 \ 107 107 "Created directory structure for ${module} --`whoami`" 108 108 } … … 121 121 -exec ${readlink_cmd} -m {} \;`" 122 122 done 123 svncommit -F "$msg" $(eval echo ${WORK_PATH}/{$modules}) \123 @SVN@ commit -F "$msg" $(eval echo ${WORK_PATH}/{$modules}) \ 124 124 $symlinks 125 125 else 126 126 symlinks="$symlinks `find ${modules} -type l \ 127 127 -exec ${readlink_cmd} -m {} \;`" 128 svncommit -F "$msg" ${WORK_PATH}/$modules \128 @SVN@ commit -F "$msg" ${WORK_PATH}/$modules \ 129 129 $symlinks 130 130 fi … … 142 142 done 143 143 144 svncommit -F "$msg" $files144 @SVN@ commit -F "$msg" $files 145 145 } 146 146 … … 175 175 # A way to utilize the svn status feature. 176 176 function conf_status { 177 svnstatus $*177 @SVN@ status $* 178 178 } 179 179 … … 298 298 local module=`echo ${file#$WORK_PATH} | ${sed_cmd} -e 's:/([^/]+)/.*:\1:'` 299 299 local livefile=`echo ${file#$WORK_PATH} | ${sed_cmd} -e 's:/([^/]+)/:/:'` 300 if svnstatus $file | egrep -q "^\?"; then300 if @SVN@ status $file | egrep -q "^\?"; then 301 301 echo -e "Not in confman repository\t\t${livefile}" 302 302 return … … 384 384 385 385 ln -s $opts "$target" "$link" 386 svnadd "$link"386 @SVN@ add "$link" 387 387 } 388 388 … … 395 395 local revision=`conf_revision` 396 396 echo $revision > $chkpath 397 svnadd $chkpath397 @SVN@ add $chkpath 398 398 local msg="Created a checkpoint, ${checkpoint} for ${module} --`whoami`" 399 svncommit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg"399 @SVN@ commit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg" 400 400 } 401 401 … … 406 406 local checkpoint=$2 407 407 local chkpath="${WORK_PATH}/${REPO_CHECKPTS}/${module}/${checkpoint}" 408 svnrm ${chkpath}408 @SVN@ rm ${chkpath} 409 409 local msg="Removed the checkpoint ${checkpoint} from ${module} --`whoami`" 410 svncommit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg"410 @SVN@ commit ${WORK_PATH}/${REPO_CHECKPTS} -m "$msg" 411 411 } 412 412 … … 436 436 437 437 #svn update --revision $revision $modpath 438 svnupdate --revision $revision $modpath $symlinks438 @SVN@ update --revision $revision $modpath $symlinks 439 439 } 440 440 … … 443 443 local file=$1 444 444 local prop=$2 445 local result=` svnpropget "confman:${prop}" ${file}`445 local result=`@SVN@ propget "confman:${prop}" ${file}` 446 446 if [ -z "$result" ] ; then 447 447 file=`$readlink_cmd -m ${file}` 448 svnpropget "confman:${prop}" ${file}448 @SVN@ propget "confman:${prop}" ${file} 449 449 else 450 450 echo $result … … 457 457 local prop=$2 458 458 local value=$3 459 svnpropset "confman:${prop}" "${value}" ${file}459 @SVN@ propset "confman:${prop}" "${value}" ${file} 460 460 } 461 461 … … 486 486 fi 487 487 488 svnadd $myfile489 svnps svn:keywords "Id" $myfile488 @SVN@ add $myfile 489 @SVN@ ps svn:keywords "Id" $myfile 490 490 conf_set_prop $myfile owner $owner 491 491 conf_set_prop $myfile group $group … … 496 496 497 497 function conf_rm_file { 498 svnrm $*498 @SVN@ rm $* 499 499 } 500 500 … … 511 511 workdir="${workdir}/${dir}" 512 512 if [ ! -d ${workdir} ] ; then 513 echo svnmkdir ${workdir}514 svnmkdir ${workdir}513 echo @SVN@ mkdir ${workdir} 514 @SVN@ mkdir ${workdir} 515 515 conf_set_prop $workdir owner $owner 516 516 conf_set_prop $workdir group $group … … 523 523 function conf_rmmod { 524 524 local module=$1 525 svnrm ${WORK_PATH}/${module}526 svnrm ${WORK_PATH}/${REPO_CHECKPTS}/${module}525 @SVN@ rm ${WORK_PATH}/${module} 526 @SVN@ rm ${WORK_PATH}/${REPO_CHECKPTS}/${module} 527 527 } 528 528 … … 533 533 534 534 # First, we perform the easy operations 535 svnmv ${WORK_PATH}/${oldmod} ${WORK_PATH}/${newmod} || \535 @SVN@ mv ${WORK_PATH}/${oldmod} ${WORK_PATH}/${newmod} || \ 536 536 { echo "There was a problem renaming the modules." >&4 ; \ 537 537 conf_cleanExit 1 538 538 } 539 svnmv ${WORK_PATH}/${REPO_CHECKPTS}/${oldmod} \539 @SVN@ mv ${WORK_PATH}/${REPO_CHECKPTS}/${oldmod} \ 540 540 ${WORK_PATH}/${REPO_CHECKPTS}/${newmod} || \ 541 541 { echo "There was a problem renaming the checkpts." >&4 ; \ … … 543 543 } 544 544 545 svnupdate ${WORK_PATH} || \545 @SVN@ update ${WORK_PATH} || \ 546 546 { echo "Your working copy didn't update correctly." >&4 ; \ 547 547 conf_cleanExit 1 548 548 } 549 svncommit -m "Renaming ${oldmod} to ${newmod}, phase 1." \549 @SVN@ commit -m "Renaming ${oldmod} to ${newmod}, phase 1." \ 550 550 ${WORK_PATH}/{,${REPO_CHECKPTS}}/{${oldmod},${newmod}} || \ 551 551 { echo "Committing the changes failed." >&4 ; conf_cleanExit 1 … … 555 555 for file in ${SINGULARITIES} ; do 556 556 if [ -f "${WORK_PATH}/${newmod}${file}-${oldmod}" ] ; then 557 svnmv ${WORK_PATH}/${newmod}${file}-${oldmod} \557 @SVN@ mv ${WORK_PATH}/${newmod}${file}-${oldmod} \ 558 558 ${WORK_PATH}/${newmod}${file}-${newmod} 559 559 fi 560 560 done 561 561 562 svnupdate ${WORK_PATH} || \562 @SVN@ update ${WORK_PATH} || \ 563 563 { echo "Your working copy didn't update correctly." >&4 ; \ 564 564 conf_cleanExit 1 565 565 } 566 svncommit -m "Renaming ${oldmod} to ${newmod}, phase 2." \566 @SVN@ commit -m "Renaming ${oldmod} to ${newmod}, phase 2." \ 567 567 ${WORK_PATH}/${newmod} || \ 568 568 { echo "Committing the changes failed." >&4 ; conf_cleanExit 1 … … 574 574 {} \; 575 575 576 svnupdate ${WORK_PATH} || \576 @SVN@ update ${WORK_PATH} || \ 577 577 { echo "Your working copy didn't update correctly." >&4 ; \ 578 578 conf_cleanExit 1 579 579 } 580 svncommit -m "Renaming ${oldmod} to ${newmod}, complete." \580 @SVN@ commit -m "Renaming ${oldmod} to ${newmod}, complete." \ 581 581 ${WORK_PATH}/${newmod} || \ 582 582 { echo "Committing the changes failed." >&4 ; conf_cleanExit 1 … … 587 587 local oldname=$1 588 588 local newname=$2 589 svnmv $oldname $newname589 @SVN@ mv $oldname $newname 590 590 } 591 591 … … 593 593 local oldname=$1 594 594 local newname=$2 595 svncp $oldname $newname595 @SVN@ cp $oldname $newname 596 596 } 597 597 598 598 function conf_diff { 599 svndiff $*599 @SVN@ diff $* 600 600 } 601 601 602 602 function conf_log { 603 svnlog $*603 @SVN@ log $* 604 604 } 605 605 … … 614 614 local value="$1" 615 615 shift 616 svnpropset "$attr" "$value" "$@"616 @SVN@ propset "$attr" "$value" "$@" 617 617 } 618 618 … … 621 621 shift 622 622 echo "$file" 623 for prop in $( svnproplist $file | grep 'confman:' | sort) ; do624 echo -e "\t${prop#confman:}\t" $( svnpropget $prop $file)623 for prop in $(@SVN@ proplist $file | grep 'confman:' | sort) ; do 624 echo -e "\t${prop#confman:}\t" $(@SVN@ propget $prop $file) 625 625 done 626 626 if [ -n "$1" ] ; then … … 632 632 local attr="confman:$1" 633 633 shift 634 svnpropdel "$attr" "$@"634 @SVN@ propdel "$attr" "$@" 635 635 } 636 636 … … 639 639 local toReturn=true 640 640 for file in "$@" ; do 641 cmd=$( svnpropget "confman:syncheck" "$file")641 cmd=$(@SVN@ propget "confman:syncheck" "$file") 642 642 if [ -z "$cmd" ] ; then 643 643 continue … … 670 670 # Returns the current revision number of the repository on stdout 671 671 function conf_revision { 672 svninfo ${WORK_PATH} | awk '/Last Changed Rev:/ {print $4}'672 @SVN@ info ${WORK_PATH} | awk '/Last Changed Rev:/ {print $4}' 673 673 } 674 674 … … 732 732 fi 733 733 touch "$recipe_file" 734 svnadd "$recipe_file"734 @SVN@ add "$recipe_file" 735 735 } 736 736 … … 739 739 local recipe_file="$2" 740 740 cat "$recipe_file" > "${RECIPEDIR}/${recipe}" 741 svncommit "${RECIPEDIR}/${recipe}"741 @SVN@ commit "${RECIPEDIR}/${recipe}" 742 742 } 743 743 … … 749 749 return 1 750 750 fi 751 svnrm "${recipe_file}"752 svncommit "${recipe_file}"751 @SVN@ rm "${recipe_file}" 752 @SVN@ commit "${recipe_file}" 753 753 } 754 754 … … 781 781 # And this clears any locks we may have created on our working copy: 782 782 echo "Undoing damage to your working copy..." >&4 783 [ -d "${WORK_PATH}" ] && svncleanup ${WORK_PATH}783 [ -d "${WORK_PATH}" ] && @SVN@ cleanup ${WORK_PATH} 784 784 785 785 echo "All clean. Terminating." >&4 -
trunk/confsync.in
r321 r325 1 #! /usr/bin/env bash1 #!@BASH@ 2 2 # 3 3 # Copyright (c) 2008, Christopher Cowart and contributors
Note: See TracChangeset
for help on using the changeset viewer.
