DBD-Informix

 view release on metacpan or  search on metacpan

mknmd.sh  view on Meta::CPAN

CNTRLFILE=${3}
MKVERSION=${4:-./mkversion}

if [ ! -x $MKVERSION ]
then
    echo "$arg0: cannot locate executable file $MKVERSION" >&2
    exit 1
fi

sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' \
    -e 's/$Revision':' \(.*\) \$$/\1/' \
    $CNTRLFILE |
{
while read gfile sfile version notes
do

    case $gfile in  # Handle variable setting lines
    *=*)    eval $gfile $sfile $version
            continue;;
    esac

    eval target=$OBJECTDIR/$gfile
    if [ ! -f $target ]
    then
        tgtdir=`dirname $target`
        [ -d $tgtdir ] || ${MKPATH} $tgtdir
    fi

    eval sfile=$sfile
    case $sfile in
    /*) # Absolute
        source=$sfile;;
    *)  # Relative
        eval source=$SOURCEDIR/$sfile
        ;;
    esac

    if [ $remove = yes ]
    then
        : File will be removed anyway
    elif [ -f $target -a ! $target -ot $source ]
    then
        # Time stamp on target is newer than (or the same as) $source.
        # Condition was [... $target -nt $source ] but this doesn't work
        # well with "cp -p".
        continue
    fi

    if [ ! -f $source ]
    then
        echo "$arg0: cannot find $source" >&2
        continue
    fi

    if [ "x$version" = "x-" ]
    then
        # Distributing non-SCCS file (e.g. FLEX-generated C source)
        $RM $target
        [ $qflag = yes ] || echo "$target $version"
        $CP $source $target
        chmod 444 $target
    else
        case "$source" in
        *,v)
            # RCS file
            if ${CO} -p -r$version $source >/dev/null 2>&1
            then
                case `basename $target` in
                *,v)
                    # Distributing RCS file
                    if [ $source != $target ]
                    then
                        [ $qflag = yes ] || echo "$target $version"
                        $RM $target
                        $CP $source $target
                    fi
                    ;;
                *)
                    # Distributing extracted file
                    [ $qflag = yes ] || echo "$target $version"
                    $RM $target
                    if [ "$notes" = "binary" ]
                    then
                        ${CO} -r$version ${COFLAGS} -p $source >$target
                    else
                        ${CO} -r$version ${COFLAGS} -p $source |
                        $MKVERSION $PVSFLAGS >$target
                    fi
                    ;;
                esac
                chmod 444 $target
            else
                echo "Unavailable version $version in RCS file $source" 1>&2
                exit 1
            fi
            ;;
        */s.*)
            # SCCS file
            if val -r$version $source >/dev/null 2>&1
            then
                case `basename $target` in
                s.*)
                    # Distributing SCCS s-file
                    if [ $source != $target ]
                    then
                        [ $qflag = yes ] || echo "$target $version"
                        $RM $target
                        $CP $source $target
                    fi
                    ;;
                *)
                    # Distributing extracted file
                    [ $qflag = yes ] || echo "$target $version"
                    $RM $target
                    if [ "$notes" = "binary" ]
                    then
                        ${GET} -r$version ${GFLAGS} -p $source >$target
                    else
                        ${GET} -r$version ${GFLAGS} -p $source |
                        $MKVERSION $PVSFLAGS >$target
                    fi
                    ;;
                esac
                chmod 444 $target
            else
                echo "Unavailable version $version in SCCS file $source" 1>&2
                exit 1
            fi
            ;;
        *)      echo "Unknown file type $source ($target - $version)" 1>&2
                exit 1
                ;;
        esac
    fi

done
} | awk '{ printf("%-60s %s\n", $1, $2); }'



( run in 0.748 second using v1.01-cache-2.11-cpan-140bd7fdf52 )