- Timestamp:
- 10/05/2009 00:20:42 (3 years ago)
- Location:
- branches/confman-1.9
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
confman.8.in (modified) (1 diff)
-
confman.in (modified) (3 diffs)
-
confmandoc.sh (modified) (3 diffs)
-
confmanlib.sh.in (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/confman-1.9
-
branches/confman-1.9/confman.8.in
r418 r455 150 150 Displays the log entires for the file or directory specified by 151 151 .Ar working_copy . 152 .It Cm create Ar module 153 A new module, named 154 .Ar module , 155 will appear as a top-level-directory in your working copy. This change will 156 also be committed to the repository at the same time. 157 .It Cm rmmod Ar module 158 Delete the specified 152 .It Cm create Ar module [ Ar module Ar ... ] 153 Creates one or more modules for the 154 .Ar module 155 arguments provided. New modules will appear in the top-level-directory of 156 your working copy. This change will also be committed to the repository 157 at the same time. 158 .It Cm rmmod Ar module [ Ar module Ar ... ] 159 Delete the modules corresponding to the specified 159 160 .Ar module 160 from your working copy. Follow this action with a revert or commit operation. 161 arguments from your working copy. Follow this action with a revert or 162 commit operation. 161 163 .It Cm rename Ar oldmodule newmodule 162 164 Rename -
branches/confman-1.9/confman.in
r448 r455 90 90 else 91 91 conf_lock_wcopy 92 local module=$1 93 conf_create_module $module || exit 1 92 conf_create_modules "$@" || exit 1 94 93 conf_unlock_wcopy 95 94 fi … … 745 744 746 745 function rmmod { 747 local module=$1748 if [ -z $module ] ; then749 print_usage 1750 fi751 conf_lock_wcopy752 conf_rmmod $module753 conf_unlock_wcopy746 if [ -z "$*" ] ; then 747 print_usage 1 748 else 749 conf_lock_wcopy 750 conf_remove_modules "$@" || exit 1 751 conf_unlock_wcopy 752 fi 754 753 } 755 754 … … 918 917 919 918 function recipe_remove { 920 if [ -z "$1" ] ; then print_usage 1 ; fi 921 local recipe="$1" 922 conf_remove_recipe "$recipe" 919 if [ -z "$*" ] ; then print_usage 1 ; fi 920 conf_remove_recipes "$@" || exit 1 923 921 } 924 922 -
branches/confman-1.9/confmandoc.sh
r448 r455 41 41 $MYNAME audit 42 42 $MYNAME log [ working_copy ] 43 $MYNAME create module 44 $MYNAME rmmod module 43 $MYNAME create module [ module ... ] 44 $MYNAME rmmod module [ module ... ] 45 45 $MYNAME rename oldmodule newmodule 46 46 $MYNAME import module livefile … … 102 102 103 103 Usage: 104 $MYNAME create module 105 106 The create command will cause a new module, named module, to appear as a 107 top-level-directory in your working copy. This change will also be made to 108 the repositry at the same time. 104 $MYNAME create module [ module ... ] 105 106 Creates one or more modules for the module arguments provided. 107 New modules will appear in the top-level-directory of your work- 108 ing copy. This change will also be committed to the repository 109 at the same time. 109 110 110 111 EOF … … 115 116 116 117 Usage: 117 $MYNAME rmmod module 118 This command will delete the specified module from your working copy. Use with 119 care. 118 $MYNAME rmmod [ module ... ] 119 120 Delete the modules corresponding to the specified module argu- 121 ments from your working copy. Follow this action with a revert or 122 commit operation. 123 120 124 EOF 121 125 ;; -
branches/confman-1.9/confmanlib.sh.in
r450 r455 165 165 } 166 166 167 function conf_create_modules { 168 local module 169 local newmodules 170 local rc=0 171 172 for module in "$@"; do 173 if conf_create_module "$module"; then 174 # Keep track of the modules that were successfully created 175 # avoid inadvertently committing outstanding changes to 176 # pre-existing modules 177 if [ -z "$newmodules" ]; then 178 newmodules="$module" 179 else 180 newmodules="$newmodules,$module" 181 fi 182 else 183 rc=1 184 fi 185 done 186 187 # $newmodules is in the form foo,bar,baz. This eval trick forces 188 # curly brace expansion. 189 if echo "$newmodules" | grep -q ','; then 190 @SVN@ commit $(eval echo ${WORK_PATH}/{$newmodules}) \ 191 $(eval echo ${WORK_PATH}/${REPO_CHECKPTS}/{$newmodules}) -m \ 192 "Created directory structure for $newmodules --`whoami`" 193 elif [ -n "$newmodules" ]; then 194 # We test -n for this case because $newmodules might 195 # be empty, i.e. no new modules were created 196 @SVN@ commit ${WORK_PATH}/$newmodules \ 197 ${WORK_PATH}/${REPO_CHECKPTS}/$newmodules -m \ 198 "Created directory structure for $newmodules --`whoami`" 199 fi 200 201 return $rc 202 } 203 167 204 # Assumes that we already have core setup in our work path. 168 205 function conf_create_module { … … 177 214 @SVN@ mkdir ${WORK_PATH}/$module 178 215 @SVN@ mkdir ${WORK_PATH}/${REPO_CHECKPTS}/$module 179 @SVN@ commit ${WORK_PATH}/${module} \180 ${WORK_PATH}/${REPO_CHECKPTS}/$module -m \181 "Created directory structure for ${module} --`whoami`"182 216 183 217 return 0 … … 680 714 } 681 715 716 function conf_remove_modules { 717 local module 718 local rc=0 719 720 for module in "$@"; do 721 conf_rmmod "$module" || rc=1 722 done 723 724 return $rc 725 } 726 682 727 function conf_rmmod { 683 local module=$1 684 @SVN@ rm ${WORK_PATH}/${module} 685 @SVN@ rm ${WORK_PATH}/${REPO_CHECKPTS}/${module} 728 local module="$1" 729 local dir 730 local rc=0 731 732 for dir in ${WORK_PATH}/{,${REPO_CHECKPTS}/}${module}; do 733 if ! [ -d "$dir" ]; then 734 echo "No such directory: $dir" >&2 735 rc=1 736 else 737 @SVN@ rm $dir || rc=1 738 fi 739 done 740 741 return $rc 686 742 } 687 743 … … 909 965 } 910 966 967 function conf_remove_recipes { 968 local recipe 969 local oldrecipes 970 local rc=0 971 972 for recipe in "$@"; do 973 if conf_remove_recipe "$recipe"; then 974 # Keep track of the recipes that were successfully removed 975 # to avoid inadvertent commits 976 if [ -z "$oldrecipes" ]; then 977 oldrecipes="$recipe" 978 else 979 oldrecipes="$oldrecipes,$recipe" 980 fi 981 else 982 rc=1 983 fi 984 done 985 986 # $oldrecipes is in the form foo,bar,baz. This eval trick forces 987 # curly brace expansion. 988 if echo "$oldrecipes" | grep -q ','; then 989 @SVN@ commit $(eval echo $(conf_recipe_dir)/{$oldrecipes}) 990 else 991 @SVN@ commit "$(conf_recipe_dir)/$oldrecipes" 992 fi 993 994 return $rc 995 } 996 911 997 function conf_remove_recipe { 912 998 local recipe="$1" … … 916 1002 return 1 917 1003 fi 918 @SVN@ rm "${recipe_file}" 919 @SVN@ commit "${recipe_file}"1004 @SVN@ rm "${recipe_file}" || return 1 1005 return 0 920 1006 } 921 1007
Note: See TracChangeset
for help on using the changeset viewer.
