diff scripts/mk-pkg-add @ 9794:0d4613a736e9

convert build system to use automake and libtool
author John W. Eaton <jwe@octave.org>
date Tue, 10 Nov 2009 15:02:25 -0500
parents scripts/mkpkgadd@4270ded9ddc6
children fd0a3ac60b0e
line wrap: on
line diff
copy from scripts/mkpkgadd
copy to scripts/mk-pkg-add
--- a/scripts/mkpkgadd
+++ b/scripts/mk-pkg-add
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2002, 2003, 2007 John W. Eaton
+# Copyright (C) 2002, 2003, 2007, 2009 John W. Eaton
 #
 # This file is part of Octave.
 # 
@@ -18,23 +18,20 @@
 # along with Octave; see the file COPYING.  If not, see
 # <http://www.gnu.org/licenses/>.
 
-if [ $# -eq 1 ]; then
-  dir="$1"
-else
-  echo "usage: mkpkgadd directory" 1>&2
-  exit 1
-fi
+## Expecting arguments in this order:
+##
+##  SRCDIR SRCDIR-FILES ... -- LOCAL-FILES ...
 
-cd $dir
+set -e
+
+prefix="$1/"
+shift
 
-m_files=`ls *.m`
-cxx_files=`ls *.cc`
-
-if [ -n "$m_files" ]; then
-  sed -n 's/^[#%][#%]* *PKG_ADD: *//p' $m_files
-fi
-
-if [ -n "$cxx_files" ]; then
-  sed -n -e 's,^//* *PKG_ADD: *,,p' \
-         -e 's,^/\** *PKG_ADD: *\(.*\) \*/$,\1,p' $cxx_files
-fi
+for arg
+do
+  if [ "$arg" = "--" ]; then
+    prefix=""
+  else
+    sed -n 's/^[#%][#%]* *PKG_ADD: *//p' "$prefix$arg"
+  fi
+done