~ubuntu-branches/ubuntu/raring/pidgin-libnotify/raring

« back to all changes in this revision

Viewing changes to mkinstalldirs

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Felix Geyer
  • Date: 2011-08-26 15:24:08 UTC
  • Revision ID: package-import@ubuntu.com-20110826152408-w86kqvn4jowacvh6
Tags: 0.14-4ubuntu9
* Clean debian source v3 autogenerated diff and include those in
  indicate.patch since that's the patch they were updating
* debian/control, debian/rules: use dh-autoreconf rather than 
  shipping the autoconf in a diff.

[ Felix Geyer ]
* indicate.patch: replace indicate_indicator_set_property_icon()
  with indicate_gtk_indicator_set_property_icon(). (LP: #827626)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# mkinstalldirs --- make directory hierarchy
3
 
 
4
 
scriptversion=2006-05-11.19
5
 
 
6
 
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
 
3
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
7
4
# Created: 1993-05-16
8
 
# Public domain.
9
 
#
10
 
# This file is maintained in Automake, please report
11
 
# bugs to <bug-automake@gnu.org> or send patches to
12
 
# <automake-patches@gnu.org>.
 
5
# Public domain
13
6
 
14
 
nl='
15
 
'
16
 
IFS=" ""        $nl"
17
7
errstatus=0
18
 
dirmode=
 
8
dirmode=""
19
9
 
20
10
usage="\
21
 
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
22
 
 
23
 
Create each directory DIR (with mode MODE, if specified), including all
24
 
leading file name components.
25
 
 
26
 
Report bugs to <bug-automake@gnu.org>."
 
11
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
27
12
 
28
13
# process command line arguments
29
14
while test $# -gt 0 ; do
30
15
  case $1 in
31
16
    -h | --help | --h*)         # -h for help
32
 
      echo "$usage"
33
 
      exit $?
 
17
      echo "$usage" 1>&2
 
18
      exit 0
34
19
      ;;
35
20
    -m)                         # -m PERM arg
36
21
      shift
38
23
      dirmode=$1
39
24
      shift
40
25
      ;;
41
 
    --version)
42
 
      echo "$0 $scriptversion"
43
 
      exit $?
44
 
      ;;
45
26
    --)                         # stop option processing
46
27
      shift
47
28
      break
69
50
  0) exit 0 ;;
70
51
esac
71
52
 
72
 
# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
73
 
# mkdir -p a/c at the same time, both will detect that a is missing,
74
 
# one will create a, then the other will try to create a and die with
75
 
# a "File exists" error.  This is a problem when calling mkinstalldirs
76
 
# from a parallel make.  We use --version in the probe to restrict
77
 
# ourselves to GNU mkdir, which is thread-safe.
78
53
case $dirmode in
79
54
  '')
80
 
    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
 
55
    if mkdir -p -- . 2>/dev/null; then
81
56
      echo "mkdir -p -- $*"
82
57
      exec mkdir -p -- "$@"
83
 
    else
84
 
      # On NextStep and OpenStep, the `mkdir' command does not
85
 
      # recognize any option.  It will interpret all options as
86
 
      # directories to create, and then abort because `.' already
87
 
      # exists.
88
 
      test -d ./-p && rmdir ./-p
89
 
      test -d ./--version && rmdir ./--version
90
58
    fi
91
59
    ;;
92
60
  *)
93
 
    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
94
 
       test ! -d ./--version; then
 
61
    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
95
62
      echo "mkdir -m $dirmode -p -- $*"
96
63
      exec mkdir -m "$dirmode" -p -- "$@"
97
 
    else
98
 
      # Clean up after NextStep and OpenStep mkdir.
99
 
      for d in ./-m ./-p ./--version "./$dirmode";
100
 
      do
101
 
        test -d $d && rmdir $d
102
 
      done
103
64
    fi
104
65
    ;;
105
66
esac
106
67
 
107
68
for file
108
69
do
109
 
  case $file in
110
 
    /*) pathcomp=/ ;;
111
 
    *)  pathcomp= ;;
112
 
  esac
113
 
  oIFS=$IFS
114
 
  IFS=/
115
 
  set fnord $file
 
70
  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
116
71
  shift
117
 
  IFS=$oIFS
118
72
 
 
73
  pathcomp=
119
74
  for d
120
75
  do
121
 
    test "x$d" = x && continue
122
 
 
123
 
    pathcomp=$pathcomp$d
 
76
    pathcomp="$pathcomp$d"
124
77
    case $pathcomp in
125
78
      -*) pathcomp=./$pathcomp ;;
126
79
    esac
131
84
      mkdir "$pathcomp" || lasterr=$?
132
85
 
133
86
      if test ! -d "$pathcomp"; then
134
 
        errstatus=$lasterr
 
87
        errstatus=$lasterr
135
88
      else
136
 
        if test ! -z "$dirmode"; then
 
89
        if test ! -z "$dirmode"; then
137
90
          echo "chmod $dirmode $pathcomp"
138
 
          lasterr=
139
 
          chmod "$dirmode" "$pathcomp" || lasterr=$?
 
91
          lasterr=""
 
92
          chmod "$dirmode" "$pathcomp" || lasterr=$?
140
93
 
141
 
          if test ! -z "$lasterr"; then
142
 
            errstatus=$lasterr
143
 
          fi
144
 
        fi
 
94
          if test ! -z "$lasterr"; then
 
95
            errstatus=$lasterr
 
96
          fi
 
97
        fi
145
98
      fi
146
99
    fi
147
100
 
148
 
    pathcomp=$pathcomp/
 
101
    pathcomp="$pathcomp/"
149
102
  done
150
103
done
151
104
 
154
107
# Local Variables:
155
108
# mode: shell-script
156
109
# sh-indentation: 2
157
 
# eval: (add-hook 'write-file-hooks 'time-stamp)
158
 
# time-stamp-start: "scriptversion="
159
 
# time-stamp-format: "%:y-%02m-%02d.%02H"
160
 
# time-stamp-end: "$"
161
110
# End:
 
111
# mkinstalldirs ends here