Last change
on this file since 819 was 818, checked in by bird, 18 years ago |
drop the set -x
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Line | |
---|
1 | #/bin/sh
|
---|
2 |
|
---|
3 | # $Id: $
|
---|
4 | ## @file
|
---|
5 | #
|
---|
6 | # kmk_append fake script for bootstrapping.
|
---|
7 | #
|
---|
8 | # Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
|
---|
9 | #
|
---|
10 | #
|
---|
11 | # This file is part of kBuild.
|
---|
12 | #
|
---|
13 | # kBuild is free software; you can redistribute it and/or modify
|
---|
14 | # it under the terms of the GNU General Public License as published by
|
---|
15 | # the Free Software Foundation; either version 2 of the License, or
|
---|
16 | # (at your option) any later version.
|
---|
17 | #
|
---|
18 | # kBuild is distributed in the hope that it will be useful,
|
---|
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
21 | # GNU General Public License for more details.
|
---|
22 | #
|
---|
23 | # You should have received a copy of the GNU General Public License
|
---|
24 | # along with kBuild; if not, write to the Free Software
|
---|
25 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
26 | #
|
---|
27 | #
|
---|
28 |
|
---|
29 |
|
---|
30 | set -e
|
---|
31 |
|
---|
32 | #
|
---|
33 | # Parse args.
|
---|
34 | #
|
---|
35 | NEWLINE=0
|
---|
36 | echo "$1"
|
---|
37 | while test "$1" = "-n" -o "$1" = "-v" -o "$1" = "-nv" -o "$1" = "-vn";
|
---|
38 | do
|
---|
39 | case "$1" in
|
---|
40 | -n)
|
---|
41 | NEWLINE=1
|
---|
42 | ;;
|
---|
43 | *)
|
---|
44 | echo "gnumake-append.sh: Unsupported argument: $1"
|
---|
45 | exit 1;
|
---|
46 | esac
|
---|
47 | shift
|
---|
48 | done
|
---|
49 |
|
---|
50 | FILE="$1"
|
---|
51 | if test -z "$FILE"; then
|
---|
52 | echo "gnumake-append.sh: No arguments given."
|
---|
53 | echo "syntax: gnumake-append.sh [-n] <file> [string [more strings]]"
|
---|
54 | exit 1
|
---|
55 | fi
|
---|
56 | shift
|
---|
57 |
|
---|
58 |
|
---|
59 | #
|
---|
60 | # Do work
|
---|
61 | #
|
---|
62 | if test "$#" -eq "0"; then
|
---|
63 | echo "" >> "$FILE"
|
---|
64 | else
|
---|
65 | if test "$NEWLINE" = "0"; then
|
---|
66 | echo "$*" >> "$FILE"
|
---|
67 | else
|
---|
68 | while test "$#" -ne "0";
|
---|
69 | do
|
---|
70 | echo "$1" >> "$FILE"
|
---|
71 | shift
|
---|
72 | done
|
---|
73 | fi
|
---|
74 | fi
|
---|
75 | exit 0;
|
---|
76 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.