~ubuntu-branches/ubuntu/trusty/mit-scheme/trusty-proposed

« back to all changes in this revision

Viewing changes to src/etc/functions.sh

  • Committer: Package Import Robot
  • Author(s): Chris Hanson
  • Date: 2011-10-15 03:08:33 UTC
  • mfrom: (1.1.8) (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20111015030833-x7qc6yxuulvxbafv
Tags: 9.1-1
* New upstream.
* debian/control, debian/copyright, debian/mit-scheme-doc.*,
  debian/mit-scheme.install, debian/rules, Upstream has removed cover
  texts from documentation licenses, so merge packages mit-scheme and
  mit-scheme-doc back together.
* debian/compat: Bump to current version.
* debian/control: Bump standards-version to current and make
  necessary changes.
* debian/rules: Fix lintian warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
4
4
#     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5
 
#     2005, 2006, 2007, 2008, 2009, 2010 Massachusetts Institute of
6
 
#     Technology
 
5
#     2005, 2006, 2007, 2008, 2009, 2010, 2011 Massachusetts Institute
 
6
#     of Technology
7
7
#
8
8
# This file is part of MIT/GNU Scheme.
9
9
#
42
42
 
43
43
run_cmd_in_dir ()
44
44
(
45
 
    cd "${1}"
 
45
    D="${1}"
46
46
    shift
47
 
    run_cmd "${@}"
 
47
    cd "${D}"
 
48
    echo "run_cmd in ${D}/:" "${@}"
 
49
    "${@}"
48
50
)
49
51
 
50
52
get_fasl_file ()
101
103
    FILES=
102
104
    DIRS=
103
105
    for FN in "${@}"; do
104
 
        if [ ! -L "${FN}" ]; then
105
 
            if [ -f "${FN}" ]; then
106
 
                FILES="${FILES} ${FN}"
107
 
            elif [ -d "${FN}" ]; then
108
 
                DIRS="${DIRS} ${FN}"
109
 
            fi
 
106
        if [ -L "${FN}" ]; then
 
107
            FILES="${FILES} ${FN}"
 
108
        elif [ -f "${FN}" ]; then
 
109
            FILES="${FILES} ${FN}"
 
110
        elif [ -d "${FN}" ]; then
 
111
            DIRS="${DIRS} ${FN}"
110
112
        fi
111
113
    done
112
114
    if [ "${FILES}" ]; then
116
118
        run_cmd rm -rf ${DIRS}
117
119
    fi
118
120
}
 
121
 
 
122
maybe_mv ()
 
123
{
 
124
    # When $1 is e.g. *.com, punt.
 
125
    if [ -e "$1" ]; then mv "${@}"; fi
 
126
}