Changeset 83678 in vbox for trunk/tools
- Timestamp:
- Apr 11, 2020 6:30:37 PM (5 years ago)
- Location:
- trunk/tools/bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/bin/backport-commit.sh
r83667 r83678 118 118 exit 0 119 119 fi 120 echo "error: commit failed" >2120 echo "error: commit failed" 1>&2 121 121 exit 1 122 122 ;; -
trunk/tools/bin/backport-common.sh
r83677 r83678 26 26 MY_SED=kmk_sed 27 27 28 # 29 # Functions. 30 # 31 BranchDirToName() 32 { 33 MY_DIR=$1 34 MY_NAME=`echo "${MY_DIR}" | "${MY_SED}" -e 's|^\(.*\)/\([^/][^/]*\)$|\2|'` 35 case "${MY_NAME}" in 36 VBox-[5-9].[0-3]|VBox-1[0-5].[0-3]) 37 echo "${MY_NAME}" | "${MY_SED}" -e 's/VBox-//' 38 ;; 39 [Vv][Bb][Oo][Xx][5-9][0-3]) 40 echo "${MY_NAME}" | "${MY_SED}" -e 's/[Vv][Bb][Oo][Xx]\([0-9]\)\([0-3]\)/\1.\2/' 41 ;; 42 [Tt][Rr][Uu][Nn][Kk]) 43 echo trunk 44 ;; 45 *) 46 echo "warning: Unable to guess branch given ${MY_NAME} ($1)" 1>&2 47 ;; 48 esac 49 } 50 51 52 # 53 # Figure default branch given the script location. 54 # 28 55 MY_BRANCH_DEFAULT_DIR=`cd "${MY_SCRIPT_DIR}"; cd ../..; pwd -L` 29 MY_BRANCH_DEFAULT=` echo "${MY_BRANCH_DEFAULT_DIR}" | "${MY_SED}" -e 's|^\(.*\)/\([^/][^/]*\)$|\2|' -e 's/VBox-//'`56 MY_BRANCH_DEFAULT=`BranchDirToName "${MY_BRANCH_DEFAULT_DIR}"` 30 57 if test "${MY_BRANCH_DEFAULT}" = "trunk"; then 31 58 MY_TRUNK_DIR=${MY_BRANCH_DEFAULT_DIR} … … 35 62 MY_TRUNK_DIR="^/trunk" 36 63 fi 64 37 65 38 66 # … … 53 81 r[0-9][0-9]*) 54 82 MY_REV=`echo ${ARG} | "${MY_SED}" -e 's/^r//'` 55 MY_REVISIONS="${MY_REVISIONS} ${MY_REV}" 83 if test -z "${MY_REVISIONS}"; then 84 MY_REVISIONS=${MY_REV} 85 else 86 MY_REVISIONS="${MY_REVISIONS} ${MY_REV}" 87 fi 56 88 MY_REVISION_COUNT=`${MY_EXPR} ${MY_REVISION_COUNT} + 1` 57 89 ;; 58 90 59 91 [0-9][0-9]*) 60 MY_REVISIONS="${MY_REVISIONS} ${ARG}" 92 if test -z "${MY_REVISIONS}"; then 93 MY_REVISIONS=${ARG} 94 else 95 MY_REVISIONS="${MY_REVISIONS} ${ARG}" 96 fi 61 97 MY_REVISION_COUNT=`${MY_EXPR} ${MY_REVISION_COUNT} + 1` 62 98 ;; … … 67 103 exit 1; 68 104 fi 69 MY_TRUNK_DIR=`echo "$1" | "${ SED}" -e 's|\\\|/|g'`105 MY_TRUNK_DIR=`echo "$1" | "${MY_SED}" -e 's|\\\|/|g'` 70 106 shift 71 107 ;; … … 76 112 exit 1; 77 113 fi 78 MY_BRANCH_DIR=`echo "$1" | "${ SED}" -e 's|\\\|/|g'`114 MY_BRANCH_DIR=`echo "$1" | "${MY_SED}" -e 's|\\\|/|g'` 79 115 shift 80 116 ;; … … 128 164 if test -n "${MY_DEBUG}"; then 129 165 echo " MY_SCRIPT_DIR=${MY_SCRIPT_DIR}" 166 echo " MY_BRANCH_DIR=${MY_BRANCH_DIR}" 167 echo " MY_BRANCH=${MY_BRANCH}" 130 168 echo "MY_BRANCH_DEFAULT_DIR=${MY_BRANCH_DEFAULT_DIR}" 131 169 echo " MY_BRANCH_DEFAULT=${MY_BRANCH_DEFAULT}" … … 143 181 MY_BRANCH_DIR=${MY_BRANCH_DEFAULT_DIR} 144 182 elif test -z "${MY_BRANCH}" -a -n "${MY_BRANCH_DIR}"; then 145 MY_BRANCH=` echo "${MY_BRANCH_DIR}" | "${SED}" -e 's/^-([1]*[5-9]\.[0-5])[/]*$/\1/'`183 MY_BRANCH=`BranchDirToName "${MY_BRANCH_DIR}"` 146 184 if test -z "${MY_BRANCH}" -o "${MY_BRANCH}" = "${MY_BRANCH_DIR}"; then 147 echo "error: Failed to guess branch name for: ${MY_BRANCH_DIR}" >2148 echo " Use --branch to specify it." >2185 echo "error: Failed to guess branch name for: ${MY_BRANCH_DIR}" 1>&2 186 echo " Use --branch to specify it." 1>&2 149 187 exit 2; 150 188 fi 151 189 fi 152 190 if test "${MY_BRANCH}" = "trunk"; then 153 echo "error: script does not work with 'trunk' as the branch" >2191 echo "error: script does not work with 'trunk' as the branch" 1>&2 154 192 exit 2; 155 193 fi … … 159 197 # 160 198 if test -z "${MY_REVISIONS}"; then 161 echo "error: No revisions specified" >&2;199 echo "error: No revisions specified" 1>&2; 162 200 exit 2; 163 201 fi -
trunk/tools/bin/backport-merge.sh
r83668 r83678 51 51 MY_CONFLICTS=`"${MY_SVN}" status "${MY_BRANCH_DIR}" | "${MY_SED}" -n -e '/^C/p'` 52 52 if test -z "${MY_CONFLICTS}"; then 53 MY_DONE_REVS="${MY_DONE_REVS} ${MY_REV}" 53 if test -z "${MY_DONE_REVS}"; then 54 MY_DONE_REVS=${MY_REV} 55 else 56 MY_DONE_REVS="${MY_DONE_REVS} ${MY_REV}" 57 fi 54 58 else 55 59 echo '!!!'" Have conflicts after merging ${MY_REV}." … … 61 65 fi 62 66 else 63 MY_TODO_REVS="${MY_TODO_REVS} ${MY_REV}" 67 if test -z "${MY_TODO_REVS}"; then 68 MY_TODO_REVS=${MY_REV} 69 else 70 MY_TODO_REVS="${MY_TODO_REVS} ${MY_REV}" 71 fi 64 72 fi 65 73 done
Note:
See TracChangeset
for help on using the changeset viewer.