- Timestamp:
- 12/07/2010 10:29:39 (18 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
confman.8.in (modified) (1 diff)
-
confman.conf.5.in (modified) (1 diff)
-
confman.in (modified) (3 diffs)
-
confmandoc.sh (modified) (2 diffs)
-
confmanlib.sh.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/confman.8.in
r503 r512 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. -
trunk/confman.conf.5.in
r509 r512 189 189 .It LIVE_ROOT 190 190 This option causes 191 .Xr 191 .Xr confman 8 192 192 to use an alternate path to "/" for rolling out files. This is a great way 193 193 to set up a sandbox and test things out before managing your live system. 194 .It UPDATE_RELEVANT_ONLY 195 Defaults to "false". Set it to "true" to cause 196 .Xr confman 8 197 to update only the files relevant to the host's recipe when running a commit 198 or an install. Additionally, 199 .Cm confman update 200 will update only the recipe-relevant files when given no additional arguments. 194 201 .El 195 202 .Sh AUTHORS -
trunk/confman.in
r511 r512 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 } … … 226 248 $SUDO ${SUDO:+-v} 227 249 228 if $UPDATE_RELEVANT_ONLY; then 229 conf_update_relevant_tree || conf_cleanExit 230 else 231 conf_update_tree || conf_cleanExit 232 fi 250 update 233 251 234 252 if status=$(get_status $modules $symlinks); then … … 289 307 $SUDO ${SUDO:+-v} 290 308 291 if $UPDATE_RELEVANT_ONLY; then 292 conf_update_relevant_tree || conf_cleanExit 293 else 294 conf_update_tree || conf_cleanExit 295 fi 309 update 296 310 if status=$(get_status $files) ; then 297 311 nocommit=false -
trunk/confmandoc.sh
r501 r512 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. -
trunk/confmanlib.sh.in
r511 r512 134 134 function conf_update_relevant_tree { 135 135 local module symlink 136 local relevant_files="" 137 @SVN@ update $(conf_recipe_path) 138 for module in $(conf_get_recipe); do 136 local relevant_files="" recipe args 137 recipe="$1" 138 shift 139 args="$@" 140 [ -r $(conf_recipe_dir)/${recipe} ] || exit 1 141 @SVN@ update $args $(conf_recipe_dir)/${recipe} 142 for module in $(conf_get_recipe $(conf_recipe_dir)/${recipe}); do 139 143 relevant_files="$relevant_files ${WORK_PATH}/${module}" 140 144 for symlink in $(find ${WORK_PATH}/${module} -type l); do … … 142 146 done 143 147 done 144 [ "$relevant_files" = "" ] || @SVN@ update $ relevant_files | uniq145 # uniq is kind of an ugly fix, but otherwise we spew 30000 "At revision $n."s 148 [ "$relevant_files" = "" ] || @SVN@ update $args $relevant_files | grep \ 149 -v -e 'revision' 146 150 } 147 151
Note: See TracChangeset
for help on using the changeset viewer.
