1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00
zsh/Config/installfns.sh

43 lines
1.2 KiB
Bash
Raw Normal View History

1999-07-12 19:02:40 +02:00
#!/bin/sh
1999-09-08 01:07:57 +02:00
fndir=$DESTDIR$fndir
2007-05-16 06:30:24 +02:00
/bin/sh $sdir_top/mkinstalldirs $fndir || exit 1;
1999-07-12 19:02:40 +02:00
2007-05-16 06:30:24 +02:00
allfuncs="`grep ' functions=.' ${dir_top}/config.modules |
sed -e '/^#/d' -e '/ link=no/d' -e 's/^.* functions=//'`"
allfuncs="`cd $sdir_top; echo ${allfuncs}`"
1999-07-12 19:02:40 +02:00
2007-05-16 06:30:24 +02:00
# We now have a list of files, but we need to use `test -f' to check
# (1) the glob got expanded (2) we are not looking at directories.
for file in $allfuncs; do
if test -f $sdir_top/$file; then
case "$file" in
*/CVS/*) continue;;
esac
if test x$FUNCTIONS_SUBDIRS != x && test x$FUNCTIONS_SUBDIRS != xno; then
case "$file" in
Completion/*/*)
subdir="`echo $file | sed -e 's%/[^/]*/[^/]*$%%'`"
instdir="$fndir/$subdir"
;;
Completion/*)
instdir="$fndir/Completion"
;;
*)
subdir="`echo $file | sed -e 's%/[^/]*$%%' -e 's%^Functions/%%'`"
instdir="$fndir/$subdir"
;;
esac
1999-07-12 19:02:40 +02:00
else
1999-09-08 01:07:57 +02:00
instdir="$fndir"
1999-07-12 19:02:40 +02:00
fi
2007-05-16 06:30:24 +02:00
test -d $instdir || /bin/sh $sdir_top/mkinstalldirs $instdir || exit 1
$INSTALL_DATA $sdir_top/$file $instdir || exit 1
2007-05-16 06:30:24 +02:00
if test -x $sdir_top/$file; then
chmod +x $instdir/`echo $file | sed -e 's%^.*/%%'`
2007-05-16 06:30:24 +02:00
fi
1999-07-12 19:02:40 +02:00
fi
done