annotate lib-src/add-big-package.sh @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents f220cc83d72e
children 697ef44129c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
1 #! /bin/sh
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
2 # add-big-package.sh --- Add multiple file package to Package Lisp Hierarchy
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
3 # Copyright (C) 1997 Free Software Foundation, Inc.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
4
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 243
diff changeset
5 # Author: SL Baur <steve@xemacs.org>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 243
diff changeset
6 # Maintainer: SL Baur <steve@xemacs.org>
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
7 # Keywords: packages internal
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
8
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
9 # This file is part of XEmacs.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
10
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
11 # XEmacs is free software; you can redistribute it and/or modify it
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
12 # under the terms of the GNU General Public License as published by
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
13 # the Free Software Foundation; either version 2, or (at your option)
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
14 # any later version.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
15
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
16 # XEmacs is distributed in the hope that it will be useful, but
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
19 # General Public License for more details.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
20
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
21 # You should have received a copy of the GNU General Public License
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
22 # along with XEmacs; see the file COPYING. If not, write to
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
23 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
24 # Boston, MA 02111-1307, USA.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
25
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
26 ### Commentary:
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
27
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
28 ## This file copies a single lisp file into an XEmacs package hierarchy and
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
29 ## performs the necessary magic so that it will be autoloaded at the next
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
30 ## dump.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
31
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
32 ## Parameters:
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
33 ## $1 -- Full path to an XEmacsen later than 20.3
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
34 ## $2 -- Full path to a lisp package tarball to install
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
35 ## $3 -- Full path to a lisp directory in an XEmacs package hierarchy
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
36 ## This directory will be created if it does not exist.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
37 ## NOTE: the directory name should *not* end in a trailing slash
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
38
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
39
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
40 ### Code:
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
41
243
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
42 XEMACS="$1" # Not used at present
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
43 LISP_FILE="$2" # Should be a binary package tarball
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
44 DEST_DIR="$3" # Should be a top level package directory
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
45
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
46 # Test for valid XEmacs executable and valid input file
243
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
47 if [ ! -f "${LISP_FILE}" -o ! -x "${XEMACS}" ]; then
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
48 exit 1
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
49 fi
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
50
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
51 # Test for destination directory, creating if necessary
243
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
52 test -d "${DEST_DIR}" || mkdir "${DEST_DIR}"
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
53 test -d "${DEST_DIR}" || exit 1;
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
54
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
55 # Very simple minded extraction for the first cut
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
56 # We'll get more sophisticated later
243
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
57 cd "${DEST_DIR}"
f220cc83d72e Import from CVS: tag r20-5b20
cvs
parents: 203
diff changeset
58 gunzip -c "${LISP_FILE}" | tar xvf -
203
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
59
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
60 # Need to refresh the info/dir file, I don't know how to do that.
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
61
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
62 exit 0
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
63
850242ba4a81 Import from CVS: tag r20-3b28
cvs
parents:
diff changeset
64 ### add-big-package.sh ends here