~ubuntu-branches/debian/sid/monopd/sid

« back to all changes in this revision

Viewing changes to depcomp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Schepler
  • Date: 2006-08-12 17:05:23 UTC
  • mfrom: (2.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20060812170523-scgnd675p5jpg7lw
Tags: 0.9.3-2
* New patch monopd-0.9.3-dosfix.diff for CVE-2006-1046:
  Fixes a remote DOS vulnerability which could cause the daemon to eat up
  CPU time on the server.  Closes: #355797.
* Bump Standards-Version to 3.7.2 (no changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
fi
32
32
# `libtool' can also be set to `yes' or `no'.
33
33
 
34
 
if test -z "$depfile"; then
35
 
   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
36
 
   dir=`echo "$object" | sed 's,/.*$,/,'`
37
 
   if test "$dir" = "$object"; then
38
 
      dir=
39
 
   fi
40
 
   # FIXME: should be _deps on DOS.
41
 
   depfile="$dir.deps/$base"
42
 
fi
43
 
 
 
34
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
44
35
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
45
36
 
46
37
rm -f "$tmpdepfile"
207
198
  ;;
208
199
 
209
200
tru64)
210
 
   # The Tru64 compiler uses -MD to generate dependencies as a side
 
201
   # The Tru64 AIX compiler uses -MD to generate dependencies as a side
211
202
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
212
 
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
 
203
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 
213
204
   # dependencies in `foo.d' instead, so we check for that too.
214
205
   # Subdirectories are respected.
215
 
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
216
 
   test "x$dir" = "x$object" && dir=
217
 
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
218
206
 
 
207
   tmpdepfile1="$object.d"
 
208
   tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 
219
209
   if test "$libtool" = yes; then
220
 
      tmpdepfile1="$dir.libs/$base.lo.d"
221
 
      tmpdepfile2="$dir.libs/$base.d"
222
210
      "$@" -Wc,-MD
223
211
   else
224
 
      tmpdepfile1="$dir$base.o.d"
225
 
      tmpdepfile2="$dir$base.d"
226
212
      "$@" -MD
227
213
   fi
228
214
 
254
240
 
255
241
dashmstdout)
256
242
  # Important note: in order to support this mode, a compiler *must*
257
 
  # always write the proprocessed file to stdout, regardless of -o.
258
 
  "$@" || exit $?
259
 
 
260
 
  # Remove the call to Libtool.
261
 
  if test "$libtool" = yes; then
262
 
    while test $1 != '--mode=compile'; do
263
 
      shift
264
 
    done
265
 
    shift
266
 
  fi
267
 
 
268
 
  # Remove `-o $object'.  We will use -o /dev/null later,
269
 
  # however we can't do the remplacement now because
270
 
  # `-o $object' might simply not be used
271
 
  IFS=" "
272
 
  for arg
273
 
  do
274
 
    case $arg in
275
 
    -o)
276
 
      shift
277
 
      ;;
278
 
    $object)
279
 
      shift
280
 
      ;;
281
 
    *)
282
 
      set fnord "$@" "$arg"
283
 
      shift # fnord
284
 
      shift # $arg
285
 
      ;;
286
 
    esac
287
 
  done
288
 
 
 
243
  # always write the proprocessed file to stdout, regardless of -o,
 
244
  # because we must use -o when running libtool.
289
245
  test -z "$dashmflag" && dashmflag=-M
290
 
  "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[       ]*:'"$object"'\: :' > "$tmpdepfile"
 
246
  ( IFS=" "
 
247
    case " $* " in
 
248
    *" --mode=compile "*) # this is libtool, let us make it quiet
 
249
      for arg
 
250
      do # cycle over the arguments
 
251
        case "$arg" in
 
252
        "--mode=compile")
 
253
          # insert --quiet before "--mode=compile"
 
254
          set fnord "$@" --quiet
 
255
          shift # fnord
 
256
          ;;
 
257
        esac
 
258
        set fnord "$@" "$arg"
 
259
        shift # fnord
 
260
        shift # "$arg"
 
261
      done
 
262
      ;;
 
263
    esac
 
264
    "$@" $dashmflag | sed 's:^[^:]*\:[  ]*:'"$object"'\: :' > "$tmpdepfile"
 
265
  ) &
 
266
  proc=$!
 
267
  "$@"
 
268
  stat=$?
 
269
  wait "$proc"
 
270
  if test "$stat" != 0; then exit $stat; fi
291
271
  rm -f "$depfile"
292
272
  cat < "$tmpdepfile" > "$depfile"
293
273
  tr ' ' '
305
285
  ;;
306
286
 
307
287
makedepend)
308
 
  "$@" || exit $?
309
288
  # X makedepend
310
 
  shift
311
 
  cleared=no
312
 
  for arg in "$@"; do
313
 
    case $cleared in
314
 
    no)
315
 
      set ""; shift
316
 
      cleared=yes ;;
317
 
    esac
318
 
    case "$arg" in
319
 
    -D*|-I*)
320
 
      set fnord "$@" "$arg"; shift ;;
321
 
    -*)
322
 
      ;;
323
 
    *)
324
 
      set fnord "$@" "$arg"; shift ;;
325
 
    esac
326
 
  done
327
 
  obj_suffix="`echo $object | sed 's/^.*\././'`"
328
 
  touch "$tmpdepfile"
329
 
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
 
289
  (
 
290
    shift
 
291
    cleared=no
 
292
    for arg in "$@"; do
 
293
      case $cleared in no)
 
294
        set ""; shift
 
295
        cleared=yes
 
296
      esac
 
297
      case "$arg" in
 
298
        -D*|-I*)
 
299
          set fnord "$@" "$arg"; shift;;
 
300
        -*)
 
301
          ;;
 
302
        *)
 
303
          set fnord "$@" "$arg"; shift;;
 
304
      esac
 
305
    done
 
306
    obj_suffix="`echo $object | sed 's/^.*\././'`"
 
307
    touch "$tmpdepfile"
 
308
    ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
 
309
  ) &
 
310
  proc=$!
 
311
  "$@"
 
312
  stat=$?
 
313
  wait "$proc"
 
314
  if test "$stat" != 0; then exit $stat; fi
330
315
  rm -f "$depfile"
331
316
  cat < "$tmpdepfile" > "$depfile"
332
 
  sed '1,2d' "$tmpdepfile" | tr ' ' '
 
317
  tail +3 "$tmpdepfile" | tr ' ' '
333
318
' | \
334
319
## Some versions of the HPUX 10.20 sed can't process this invocation
335
320
## correctly.  Breaking it into two sed invocations is a workaround.
339
324
 
340
325
cpp)
341
326
  # Important note: in order to support this mode, a compiler *must*
342
 
  # always write the proprocessed file to stdout.
343
 
  "$@" || exit $?
344
 
 
345
 
  # Remove the call to Libtool.
346
 
  if test "$libtool" = yes; then
347
 
    while test $1 != '--mode=compile'; do
348
 
      shift
349
 
    done
350
 
    shift
351
 
  fi
352
 
 
353
 
  # Remove `-o $object'.
354
 
  IFS=" "
355
 
  for arg
356
 
  do
357
 
    case $arg in
358
 
    -o)
359
 
      shift
360
 
      ;;
361
 
    $object)
362
 
      shift
363
 
      ;;
364
 
    *)
365
 
      set fnord "$@" "$arg"
366
 
      shift # fnord
367
 
      shift # $arg
 
327
  # always write the proprocessed file to stdout, regardless of -o,
 
328
  # because we must use -o when running libtool.
 
329
  ( IFS=" "
 
330
    case " $* " in
 
331
    *" --mode=compile "*)
 
332
      for arg
 
333
      do # cycle over the arguments
 
334
        case $arg in
 
335
        "--mode=compile")
 
336
          # insert --quiet before "--mode=compile"
 
337
          set fnord "$@" --quiet
 
338
          shift # fnord
 
339
          ;;
 
340
        esac
 
341
        set fnord "$@" "$arg"
 
342
        shift # fnord
 
343
        shift # "$arg"
 
344
      done
368
345
      ;;
369
346
    esac
370
 
  done
371
 
 
372
 
  "$@" -E |
 
347
    "$@" -E |
373
348
    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
374
349
    sed '$ s: \\$::' > "$tmpdepfile"
 
350
  ) &
 
351
  proc=$!
 
352
  "$@"
 
353
  stat=$?
 
354
  wait "$proc"
 
355
  if test "$stat" != 0; then exit $stat; fi
375
356
  rm -f "$depfile"
376
357
  echo "$object : \\" > "$depfile"
377
358
  cat < "$tmpdepfile" >> "$depfile"
383
364
  # Important note: in order to support this mode, a compiler *must*
384
365
  # always write the proprocessed file to stdout, regardless of -o,
385
366
  # because we must use -o when running libtool.
386
 
  "$@" || exit $?
387
 
  IFS=" "
388
 
  for arg
389
 
  do
390
 
    case "$arg" in
391
 
    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
392
 
        set fnord "$@"
393
 
        shift
394
 
        shift
395
 
        ;;
396
 
    *)
 
367
  ( IFS=" "
 
368
    case " $* " in
 
369
    *" --mode=compile "*)
 
370
      for arg
 
371
      do # cycle over the arguments
 
372
        case $arg in
 
373
        "--mode=compile")
 
374
          # insert --quiet before "--mode=compile"
 
375
          set fnord "$@" --quiet
 
376
          shift # fnord
 
377
          ;;
 
378
        esac
397
379
        set fnord "$@" "$arg"
398
 
        shift
399
 
        shift
400
 
        ;;
 
380
        shift # fnord
 
381
        shift # "$arg"
 
382
      done
 
383
      ;;
401
384
    esac
402
 
  done
403
 
  "$@" -E |
404
 
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
 
385
    "$@" -E |
 
386
    sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
 
387
  ) &
 
388
  proc=$!
 
389
  "$@"
 
390
  stat=$?
 
391
  wait "$proc"
 
392
  if test "$stat" != 0; then exit $stat; fi
405
393
  rm -f "$depfile"
406
394
  echo "$object : \\" > "$depfile"
407
395
  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"