Changeset 565
- Timestamp:
- 12/16/2011 18:24:22 (5 months ago)
- Location:
- branches/confman-1.9
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
confman.8.in (modified) (1 diff)
-
confman.conf.5.in (modified) (1 diff)
-
confman.conf.in (modified) (1 diff)
-
confman.in (modified) (3 diffs)
-
confmandoc.sh (modified) (2 diffs)
-
confmanlib.sh.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/confman-1.9
- Property svn:mergeinfo changed
/trunk merged: 511-512,519
- Property svn:mergeinfo changed
-
branches/confman-1.9/confman.8.in
r534 r565 145 145 .Nm . 146 146 It will check out your working copy. setup takes no additional arguments. 147 .It Cm update [ Ar options ] 148 The update command will update all the modules in your working copy. This 149 Any options specified will be passed directly to 150 .Xr svn 1 . This can be used 151 for updating your working copy to an older revision. 147 .It Cm update [ -a ] [ -r Ar revision_string ] [ Ar recipe ] 148 The update command will update all the modules in your working copy by default, 149 or, if given a Ar recipe, update all the files relevant to the given recipe. 152 150 153 For example, you could use `confman update -r '{20090801}' www` to look at the 154 state of the module named `www' as of 1 August 2009. This will re-add any 155 deleted files and delete any added files from your working copy (This is 156 simplest if you have commited any outstanding changes, but subversion is good 157 about not deleting work-in-progress -- the errors can just be confusing). 151 If the UPDATE_RELEVANT_ONLY flag has been set in 152 .Xr confman.conf 5 , 153 the default behavior 154 of Cm update is to update only the files relevant to the host's recipe. 155 The 156 .Fl a 157 flag will override this behavior and update the entire working copy. 158 159 .Fl r Ar revision_string 160 can be used, as in 161 .Xr svn 1 , 162 to retrieve an older copy of the working copy, e.g. 163 .Cm update -r PREV 164 to retrieve the previous commit of the working copy. 158 165 159 166 Note that before any install or commit operation, there is an implicit update 160 167 that will cause the latest repository revision to be reflected in your working 161 copy. command does not alter the repository or the system.168 copy. This command does not alter the repository or the system. 162 169 .It Cm commit Oo log_flags Oc 163 170 The commit command causes your changes to take effect. -
branches/confman-1.9/confman.conf.5.in
r563 r565 203 203 .It LIVE_ROOT 204 204 This option causes 205 .Xr 205 .Xr confman 8 206 206 to use an alternate path to "/" for rolling out files. This is a great way 207 207 to set up a sandbox and test things out before managing your live system. 208 .It UPDATE_RELEVANT_ONLY 209 Defaults to "false". Set it to "true" to cause 210 .Xr confman 8 211 to update only the files relevant to the host's recipe when running a commit 212 or an install. Additionally, 213 .Cm confman update 214 will update only the recipe-relevant files when given no additional arguments. 208 215 .El 209 216 .Sh AUTHORS -
branches/confman-1.9/confman.conf.in
r563 r565 106 106 LIVE_ROOT="" 107 107 108 # Allow svn to update only the files relevant to the recipe before a commit 109 # or install operation. 110 UPDATE_RELEVANT_ONLY="false" 111 -
branches/confman-1.9/confman.in
r558 r565 100 100 function update { 101 101 local wcopy_lock 102 wcopy_lock=$(conf_lock_wcopy) 103 conf_update_tree "$@" || exit 1 102 local opt OPTARG OPTIND 103 local revision="HEAD" recipe update_all="false" 104 while getopts ":r:a" opt ; do 105 case $opt in 106 r) revision="$OPTARG" ;; 107 a) update_all="true" ;; 108 *) echo "Invalid option '-${OPTARG}'." >&4 109 print_usage 1 110 ;; 111 esac 112 done 113 shift $(($OPTIND - 1)) 114 recipe="$1" 115 wcopy_lock=$(conf_lock_wcopy) 116 $UPDATE_RELEVANT_ONLY && [ -z $recipe ] && recipe="$RECIPE_NAME" 117 if [ ! -r "$(conf_recipe_dir)/$recipe" ]; then 118 echo "Recipe \"$recipe\" does not exist or is not readable." >&2 119 exit 1 120 fi 121 if $update_all || [ -z $recipe ]; then 122 conf_update_tree -r $revision ${WORK_PATH} || exit 1 123 else 124 conf_update_relevant_tree $recipe -r $revision || exit 1 125 fi 104 126 conf_unlock_wcopy $wcopy_lock 105 127 } … … 225 247 226 248 $SUDO ${SUDO:+-v} 227 conf_update_tree || conf_cleanExit 249 250 update 228 251 229 252 if status=$(get_status $modules $symlinks); then … … 284 307 $SUDO ${SUDO:+-v} 285 308 286 conf_update_tree || conf_cleanExit309 update 287 310 if status=$(get_status $files) ; then 288 311 nocommit=false -
branches/confman-1.9/confmandoc.sh
r502 r565 36 36 $MYNAME [ help | -h ] [ command ] 37 37 $MYNAME setup 38 $MYNAME update [ options]38 $MYNAME update [ -a ] [ -r revision_string ] [ recipe ] 39 39 $MYNAME commit 40 40 $MYNAME diff [ working_copy ] … … 139 139 140 140 Usage: 141 $MYNAME update [ options ] 142 143 With no arguments, the update command will update your working copy of all 144 the modules appearing in the current host's recipe file. This command does 145 not alter the repository. 146 147 Any options specified will be passed directly to svn(1). This can be used 148 for updating your working copy to an older revision. Note that before any 141 $MYNAME update [ -a ] [ -r revision_string ] [ recipe ] 142 143 With no arguments, the update command will update your entire working copy 144 unless the UPDATE_RELEVANT_ONLY flag is set in confman.conf or your 145 ~/.confmanrc. With the UPDATE_RELEVANT_ONLY flag, the default behavior of 146 the update command is to update all of the files appearing in the current 147 host's recipe file. With a recipe argument, the update command will update 148 all files in the working copy relevant to the recipe. This command does not 149 alter the repository. 150 151 If -r is used, confman will retrieve versions of the files indicated by 152 the revision string, e.g., -r PREV for the previous working copy. 153 154 The -a option will force a full update of all files in your working copy, 155 regardless of whether UPDATE_RELEVANT_ONLY is set. Note that before any 149 156 install or commit operation, there is an implicit update that will cause 150 157 the latest repository revision to be reflected in your working copy. -
branches/confman-1.9/confmanlib.sh.in
r563 r565 130 130 @SVN@ update "$@" 131 131 fi 132 } 133 134 # Updates the relevant portions of the source tree 135 function conf_update_relevant_tree { 136 local module symlink 137 local relevant_files="" recipe args 138 recipe="$1" 139 shift 140 args="$@" 141 [ -r $(conf_recipe_dir)/${recipe} ] || exit 1 142 @SVN@ update $args $(conf_recipe_dir)/${recipe} 143 if ! [[ $args =~ .*-r.* ]]; then 144 # make sure that svn is pulling the same revision everywhere 145 args="${args} -r $(@SVN@ info $(conf_recipe_dir)/${recipe} | \ 146 awk '/^Revision:/ { print $2 }')" 147 fi 148 for module in $(conf_get_recipe $(conf_recipe_dir)/${recipe}); do 149 relevant_files="$relevant_files ${WORK_PATH}/${module}" 150 for symlink in $(find ${WORK_PATH}/${module} -type l); do 151 relevant_files="$relevant_files $(@GREADLINK@ -f $symlink)" 152 done 153 done 154 [ "$relevant_files" = "" ] || @SVN@ update $args $relevant_files | grep \ 155 -v -e 'revision' 132 156 } 133 157
Note: See TracChangeset
for help on using the changeset viewer.
