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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [readline/] [support/] [mkdist] - Diff between revs 827 and 840

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 827 Rev 840
#! /bin/bash -
#! /bin/bash -
#
#
# mkdist - make a distribution directory from a master manifest file
# mkdist - make a distribution directory from a master manifest file
#
#
# usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version
# usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version
#
#
# SRCDIR defaults to src
# SRCDIR defaults to src
# MANIFEST defaults to $SRCDIR/MANIFEST
# MANIFEST defaults to $SRCDIR/MANIFEST
#
#
# Chet Ramey
# Chet Ramey
# chet@po.cwru.edu
# chet@po.cwru.edu
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
SRCDIR=src
SRCDIR=src
ROOTNAME=bash
ROOTNAME=bash
usage()
usage()
{
{
        echo usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version 1>&2
        echo usage: mkdist [-m manifest] [-s srcdir] [-r rootname] [-v] version 1>&2
        exit 2
        exit 2
}
}
vmsg()
vmsg()
{
{
        if [ -n "$verbose" ]; then
        if [ -n "$verbose" ]; then
                echo mkdist: "$@"
                echo mkdist: "$@"
        fi
        fi
}
}
while getopts m:s:r:v name
while getopts m:s:r:v name
do
do
        case $name in
        case $name in
        m)      MANIFEST=$OPTARG ;;
        m)      MANIFEST=$OPTARG ;;
        s)      SRCDIR=$OPTARG ;;
        s)      SRCDIR=$OPTARG ;;
        r)      ROOTNAME=$OPTARG ;;
        r)      ROOTNAME=$OPTARG ;;
        v)      verbose=yes ;;
        v)      verbose=yes ;;
        ?)      usage ;;
        ?)      usage ;;
        esac
        esac
done
done
: ${MANIFEST:=$SRCDIR/MANIFEST}
: ${MANIFEST:=$SRCDIR/MANIFEST}
vmsg using $MANIFEST
vmsg using $MANIFEST
shift $(( $OPTIND - 1 ))
shift $(( $OPTIND - 1 ))
if [ $# -lt 1 ]; then
if [ $# -lt 1 ]; then
        usage
        usage
fi
fi
version=$1
version=$1
newdir=${ROOTNAME}-$version
newdir=${ROOTNAME}-$version
vmsg creating distribution for $ROOTNAME version $version in $newdir
vmsg creating distribution for $ROOTNAME version $version in $newdir
if [ ! -d $newdir ]; then
if [ ! -d $newdir ]; then
        mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
        mkdir $newdir || { echo $0: cannot make directory $newdir 1>&2 ; exit 1; }
fi
fi
dirmode=755
dirmode=755
filmode=644
filmode=644
while read fname type mode
while read fname type mode
do
do
        [ -z "$fname" ] && continue
        [ -z "$fname" ] && continue
        case "$fname" in
        case "$fname" in
        \#*)    continue ;;
        \#*)    continue ;;
        esac
        esac
        case "$type" in
        case "$type" in
        d)      mkdir $newdir/$fname ;;
        d)      mkdir $newdir/$fname ;;
        f)      cp -p $SRCDIR/$fname $newdir/$fname ;;
        f)      cp -p $SRCDIR/$fname $newdir/$fname ;;
        s)      ln -s $mode $newdir/$fname ; mode= ;;           # symlink
        s)      ln -s $mode $newdir/$fname ; mode= ;;           # symlink
        l)      ln $mode $newdir/$fname ; mode= ;;              # hard link
        l)      ln $mode $newdir/$fname ; mode= ;;              # hard link
        *)      echo "unknown file type $type" 1>&2 ;;
        *)      echo "unknown file type $type" 1>&2 ;;
        esac
        esac
        if [ -n "$mode" ]; then
        if [ -n "$mode" ]; then
                chmod $mode $newdir/$fname
                chmod $mode $newdir/$fname
        fi
        fi
done < $MANIFEST
done < $MANIFEST
# cut off the `-alpha' in something like `2.0-alpha', leaving just the
# cut off the `-alpha' in something like `2.0-alpha', leaving just the
# numeric version
# numeric version
#version=${version%%-*}
#version=${version%%-*}
#case "$version" in
#case "$version" in
#*.*.*) vers=${version%.*} ;;
#*.*.*) vers=${version%.*} ;;
#*.*)   vers=${version} ;;
#*.*)   vers=${version} ;;
#esac
#esac
#echo $vers > $newdir/.distribution
#echo $vers > $newdir/.distribution
#case "$version" in
#case "$version" in
#*.*.*) plevel=${version##*.} ;;
#*.*.*) plevel=${version##*.} ;;
#*)     plevel=0 ;;
#*)     plevel=0 ;;
#esac
#esac
#[ -z "$plevel" ] && plevel=0
#[ -z "$plevel" ] && plevel=0
#echo ${plevel} > $newdir/.patchlevel
#echo ${plevel} > $newdir/.patchlevel
vmsg $newdir created
vmsg $newdir created
exit 0
exit 0
 
 

powered by: WebSVN 2.1.0

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