OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [gdb-5.0/] [readline/] [support/] [mkdist] - Blame information for rev 1765

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
#! /bin/bash -
2
#
3
# mkdist - make a distribution directory from a master manifest file
4
#
5
# usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version
6
#
7
# SRCDIR defaults to src
8
# MANIFEST defaults to $SRCDIR/MANIFEST
9
#
10
 
11
SRCDIR=src
12
ROOTNAME=bash
13
 
14
usage()
15
{
16
        echo usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version 1>&2
17
        exit 2
18
}
19
 
20
vmsg()
21
{
22
        if [ -n "$verbose" ]; then
23
                echo mkdist: "$@"
24
        fi
25
}
26
 
27
while getopts m:s:r:v name
28
do
29
        case $name in
30
        m)      MANIFEST=$OPTARG ;;
31
        s)      SRCDIR=$OPTARG ;;
32
        r)      ROOTNAME=$OPTARG ;;
33
        v)      verbose=yes ;;
34
        ?)      usage ;;
35
        esac
36
done
37
 
38
: ${MANIFEST:=$SRCDIR/MANIFEST}
39
 
40
vmsg using $MANIFEST
41
 
42
shift $(( $OPTIND - 1 ))
43
 
44
if [ $# -lt 1 ]; then
45
        usage
46
fi
47
 
48
version=$1
49
newdir=${ROOTNAME}-$version
50
 
51
vmsg creating distribution for $ROOTNAME version $version in $newdir
52
 
53
if [ ! -d $newdir ]; then
54
        mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
55
fi
56
 
57
dirmode=755
58
filmode=644
59
 
60
while read fname type mode
61
do
62
        [ -z "$fname" ] && continue
63
 
64
        case "$fname" in
65
        \#*)    continue ;;
66
        esac
67
 
68
        case "$type" in
69
        d)      mkdir $newdir/$fname ;;
70
        f)      cp -p $SRCDIR/$fname $newdir/$fname ;;
71
        *)      echo "unknown file type $type" 1>&2 ;;
72
        esac
73
 
74
        if [ -n "$mode" ]; then
75
                chmod $mode $newdir/$fname
76
        fi
77
 
78
done < $MANIFEST
79
 
80
# cut off the `-alpha' in something like `2.0-alpha', leaving just the
81
# numeric version
82
#version=${version%%-*}
83
 
84
#case "$version" in
85
#*.*.*) vers=${version%.*} ;;
86
#*.*)   vers=${version} ;;
87
#esac
88
 
89
#echo $vers > $newdir/.distribution
90
 
91
#case "$version" in
92
#*.*.*) plevel=${version##*.} ;;
93
#*)     plevel=0 ;;
94
#esac
95
#[ -z "$plevel" ] && plevel=0
96
#echo ${plevel} > $newdir/.patchlevel
97
 
98
vmsg $newdir created
99
 
100
exit 0

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.