~ubuntu-branches/ubuntu/dapper/xfce-mcs-plugins/dapper

« back to all changes in this revision

Viewing changes to mkinstalldirs

  • Committer: Bazaar Package Importer
  • Author(s): Simon Huggins
  • Date: 2004-07-19 19:23:31 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040719192331-9c50t7saf1i8thdr
Tags: 4.0.6-1
* New upstream release
* Remove Norbert Tretkowski from Uploaders as requested

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# mkinstalldirs --- make directory hierarchy
3
3
 
4
 
scriptversion=2003-11-08.23
 
4
scriptversion=2004-02-15.20
5
5
 
6
6
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
7
7
# Created: 1993-05-16
66
66
  0) exit 0 ;;
67
67
esac
68
68
 
 
69
# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
 
70
# mkdir -p a/c at the same time, both will detect that a is missing,
 
71
# one will create a, then the other will try to create a and die with
 
72
# a "File exists" error.  This is a problem when calling mkinstalldirs
 
73
# from a parallel make.  We use --version in the probe to restrict
 
74
# ourselves to GNU mkdir, which is thread-safe.
69
75
case $dirmode in
70
76
  '')
71
 
    if mkdir -p -- . 2>/dev/null; then
 
77
    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
72
78
      echo "mkdir -p -- $*"
73
79
      exec mkdir -p -- "$@"
74
80
    else
77
83
      # directories to create, and then abort because `.' already
78
84
      # exists.
79
85
      test -d ./-p && rmdir ./-p
80
 
      test -d ./-- && rmdir ./--
 
86
      test -d ./--version && rmdir ./--version
81
87
    fi
82
88
    ;;
83
89
  *)
84
 
    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
 
90
    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
 
91
       test ! -d ./--version; then
85
92
      echo "mkdir -m $dirmode -p -- $*"
86
93
      exec mkdir -m "$dirmode" -p -- "$@"
87
94
    else
88
95
      # Clean up after NextStep and OpenStep mkdir.
89
 
      for d in ./-m ./-p ./-- "./$dirmode";
 
96
      for d in ./-m ./-p ./--version "./$dirmode";
90
97
      do
91
98
        test -d $d && rmdir $d
92
99
      done