Changeset 481 for branches/confman-1.9/confmanlib.sh.in
- Timestamp:
- 11/11/2009 14:09:39 (3 years ago)
- Location:
- branches/confman-1.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
confmanlib.sh.in (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/confman-1.9
- Property svn:mergeinfo changed
/trunk merged: 462,464,469
- Property svn:mergeinfo changed
-
branches/confman-1.9/confmanlib.sh.in
r474 r481 32 32 WCOPY_DIRTY="false" 33 33 CONF_EXPORT="false" 34 LOG_MESSAGE_SET="false" 34 35 35 36 VERSION='@VERSION@' … … 698 699 699 700 function conf_rm_file { 700 @SVN@ rm $*701 @SVN@ rm "$@" 701 702 } 702 703 … … 963 964 return 1 964 965 fi 965 touch"$recipe_file"966 ${sed_cmd} -e "s:__NAME__:${recipe}:" $RECIPE_TEMPLATE > "$recipe_file" 966 967 @SVN@ add "$recipe_file" 967 968 } 968 969 969 function conf_update_recipe { 970 local recipe="$1" 971 local recipe_file="$2" 972 cat "$recipe_file" > "$(conf_recipe_dir)/${recipe}" 973 @SVN@ commit "$(conf_recipe_dir)/${recipe}" 970 function conf_recipe_verify { 971 local recipe_file="$1" 972 local module 973 for module in $(conf_get_recipe ${recipe_file}) ; do 974 if ! [ -d "${WORK_PATH}/${module}" ] ; then 975 echo "Error: recipe references non-existent module $module" >&2 976 return 1 977 fi 978 done 979 return 0 980 } 981 982 function conf_commit_recipes { 983 local recipe recipes 984 985 local logfile="$1" 986 shift 987 988 for recipe in "$@" ; do 989 recipes="${recipes:+${recipes} }$(conf_recipe_dir)/${recipe}" 990 done 991 992 @SVN@ commit -F "$logfile" $recipes 974 993 } 975 994 976 995 function conf_remove_recipes { 977 local recipe 996 local recipe recipe_file 978 997 local oldrecipes 979 998 local rc=0 … … 981 1000 for recipe in "$@"; do 982 1001 if conf_remove_recipe "$recipe"; then 983 # Keep track of the recipes that were successfully removed 984 # to avoid inadvertent commits 985 if [ -z "$oldrecipes" ]; then 986 oldrecipes="$recipe" 987 else 988 oldrecipes="$oldrecipes,$recipe" 989 fi 1002 recipe_file="$(conf_recipe_dir)/${recipe}" 1003 oldrecipes="${oldrecipes:+${oldrecipes} }${recipe_file}" 990 1004 else 991 1005 rc=1 992 1006 fi 993 1007 done 994 995 # $oldrecipes is in the form foo,bar,baz. This eval trick forces996 # curly brace expansion.997 if echo "$oldrecipes" | grep -q ','; then998 @SVN@ commit $(eval echo $(conf_recipe_dir)/{$oldrecipes})999 else1000 @SVN@ commit "$(conf_recipe_dir)/$oldrecipes"1001 fi1002 1008 1003 1009 return $rc … … 1012 1018 fi 1013 1019 @SVN@ rm "${recipe_file}" || return 1 1020 return 0 1021 } 1022 1023 # Implements logic for selecting logfile based on -m/-F or interactive mode 1024 # Returns 0 if the log is "complete", 1 if the log needs editing 1025 # Prints filename containing the log on stdout 1026 function conf_log_message { 1027 local logfile 1028 1029 if [ -n "$LOG_FILE" ] ; then 1030 echo "$LOG_FILE" 1031 return 0 1032 fi 1033 1034 logfile=$(conf_tmp_file) 1035 echo "$logfile" 1036 1037 if $LOG_MESSAGE_SET ; then 1038 echo "$LOG_MESSAGE" > "$logfile" 1039 else 1040 cat "$LOG_TEMPLATE" > "$logfile" 1041 return 1 1042 fi 1014 1043 return 0 1015 1044 }
Note: See TracChangeset
for help on using the changeset viewer.
