Blame build/mkdir.sh

Packit 90a5c9
#!/bin/sh
Packit 90a5c9
#
Packit 90a5c9
# Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
# contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
# this work for additional information regarding copyright ownership.
Packit 90a5c9
# The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
# (the "License"); you may not use this file except in compliance with
Packit 90a5c9
# the License.  You may obtain a copy of the License at
Packit 90a5c9
#
Packit 90a5c9
#     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
#
Packit 90a5c9
# Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
# distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
# See the License for the specific language governing permissions and
Packit 90a5c9
# limitations under the License.
Packit 90a5c9
#
Packit 90a5c9
# 
Packit 90a5c9
# mkdir.sh -- make directory hierarchy
Packit 90a5c9
#
Packit 90a5c9
# Based on `mkinstalldirs' from Noah Friedman <friedman@prep.ai.mit.edu>
Packit 90a5c9
# as of 1994-03-25, which was placed in the Public Domain.
Packit 90a5c9
# Cleaned up for Apache's Autoconf-style Interface (APACI)
Packit 90a5c9
# by Ralf S. Engelschall <rse apache.org>
Packit 90a5c9
Packit 90a5c9
umask 022
Packit 90a5c9
errstatus=0
Packit 90a5c9
for file in ${1+"$@"} ; do 
Packit 90a5c9
    set fnord `echo ":$file" |\
Packit 90a5c9
               sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'`
Packit 90a5c9
    shift
Packit 90a5c9
    pathcomp=
Packit 90a5c9
    for d in ${1+"$@"}; do
Packit 90a5c9
        pathcomp="$pathcomp$d"
Packit 90a5c9
        case "$pathcomp" in
Packit 90a5c9
            -* ) pathcomp=./$pathcomp ;;
Packit 90a5c9
            ?: ) pathcomp="$pathcomp/" 
Packit 90a5c9
                 continue ;;
Packit 90a5c9
        esac
Packit 90a5c9
        if test ! -d "$pathcomp"; then
Packit 90a5c9
            echo "mkdir $pathcomp" 1>&2
Packit 90a5c9
            mkdir "$pathcomp" || errstatus=$?
Packit 90a5c9
        fi
Packit 90a5c9
        pathcomp="$pathcomp/"
Packit 90a5c9
    done
Packit 90a5c9
done
Packit 90a5c9
exit $errstatus
Packit 90a5c9