Changeset 3805 in MondoRescue for branches/3.3/ansible/roles
- Timestamp:
- Feb 16, 2024, 1:17:57 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/ansible/roles/trac/templates/trac-svn-hook
r3804 r3805 179 179 export TRAC_ENV 180 180 if [ -n "$PYTHONPATH" ]; then 181 181 export PYTHONPATH 182 182 fi 183 183 if [ -n "$TRAC_PATH" ]; then 184 184 export PATH="$TRAC_PATH:$PATH" 185 185 fi 186 186 if [ -n "$TRAC_LD_LIBRARY_PATH" ]; then 187 187 export LD_LIBRARY_PATH="$TRAC_LD_LIBRARY_PATH:$LD_LIBRARY_PATH" 188 188 fi 189 189 … … 198 198 199 199 if [ -z "$REPOS" -o -z "$REV" ]; then 200 201 200 >&2 echo "Usage: $0 REPOS REV" 201 exit 2 202 202 fi 203 203 204 204 if ! python -V 2>/dev/null; then 205 206 205 >&2 echo "python is not in the PATH ($PATH), check TRAC_PATH." 206 exit 2 207 207 fi 208 208 209 209 if ! trac-admin -v 2>/dev/null; then 210 211 210 >&2 echo "trac-admin is not in the PATH ($PATH), check TRAC_PATH." 211 exit 2 212 212 fi 213 213 214 214 if [ -z "$TRAC_ENV" ]; then 215 216 215 >&2 echo "TRAC_ENV is not set." 216 exit 2 217 217 fi 218 218 … … 222 222 223 223 if [ -z "$USER" -a -z "$PROPNAME" ]; then 224 225 224 EVENT="added" 225 echo "Changeset $REV was added in $REPOS" 226 226 else 227 228 227 EVENT="modified" 228 echo "Changeset $REV was modified by $USER in $REPOS" 229 229 fi 230 230 231 231 # -- Call "trac-admin ... changeset ... $REPOS $REV" for each Trac environment 232 232 233 ifs=$IFS 234 IFS=: 235 if [ -n "$BASH_VERSION" ]; then # we can use Bash syntax 236 if [[ ${BASH_VERSINFO[5]} = *cygwin ]]; then 237 IFS=";" 238 fi 239 fi 240 for env in $TRAC_ENV; do 241 if [ -r "$env/VERSION" ]; then 242 log=$env/log/svn-hooks-`basename $REPOS`.log 243 REPO=`grep -E '^name[ \t]*=' $env/conf/trac.ini | cut -d= -f2` 244 nohup sh <<EOF >> $log 2>&1 & 245 echo "Changeset $REV $EVENT" 246 trac-admin $env changeset $EVENT $REPO $REV && \ 247 echo "OK" || echo "FAILED: see the Trac log" 233 BASEREPO=`basename $REPOS 234 env="/prj/trac/$BASEREPO.env" 235 if [ -r "$env/VERSION" ]; then 236 log=$env/log/svn-hooks-$BASEREPO.log 237 REPO=`grep -E '^name[ \t]*=' $env/conf/trac.ini | cut -d= -f2` 238 nohup sh <<EOF >> $log 2>&1 & 239 echo "Changeset $REV $EVENT" 240 trac-admin $env changeset $EVENT $REPO $REV && \ 241 echo "OK" || echo "FAILED: see the Trac log" 248 242 EOF 249 else 250 echo "$env doesn't seem to be a Trac environment, skipping..." 251 fi 252 done 253 IFS=$ifs 243 else 244 echo "$env doesn't seem to be a Trac environment, skipping..." 245 fi
Note:
See TracChangeset
for help on using the changeset viewer.