1997-04-22 18:32:27 +04:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2008-05-29 18:51:25 +04:00
|
|
|
# $NetBSD: less2netbsd,v 1.8 2008/05/29 14:51:27 mrg Exp $
|
1997-04-22 18:32:27 +04:00
|
|
|
#
|
2003-04-14 06:56:45 +04:00
|
|
|
# Copyright (c) 1996, 2003 Matthew R. Green
|
1997-04-22 18:32:27 +04:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
|
|
|
|
|
|
|
# less2netbsd: convert a less source tree into a netbsd less source
|
2003-04-14 06:56:45 +04:00
|
|
|
# tree, under src/usr.bin/less ready for importing. note that you need
|
|
|
|
# to run ./configure to generate defines.h (a bug in less 381's configure
|
|
|
|
# wrongly does not find sigset_t on NetBSD; correct this in defines.h.)
|
1997-04-22 18:32:27 +04:00
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then echo "less2netbsd src dest"; exit 1; fi
|
|
|
|
|
|
|
|
r=$1
|
|
|
|
d=$2/less
|
|
|
|
|
|
|
|
case "$d" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
d=`/bin/pwd`/$d
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$r" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
r=`/bin/pwd`/$r
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo preparing directory $d
|
|
|
|
rm -rf $d
|
|
|
|
mkdir -p $d; cd $d
|
1999-03-24 12:23:52 +03:00
|
|
|
mkdir -p src/usr.bin/less/less src/usr.bin/less/lesskey src/usr.bin/less/lessecho
|
1997-04-22 18:32:27 +04:00
|
|
|
|
|
|
|
### start less ###############################
|
|
|
|
cd $r
|
|
|
|
echo less:
|
2003-04-14 06:56:45 +04:00
|
|
|
src="main.c screen.c brac.c ch.c charset.c cmdbuf.c command.c decode.c edit.c filename.c forwback.c help.c ifile.c input.c jump.c line.c linenum.c lsystem.c mark.c optfunc.c option.c opttbl.c os.c output.c position.c prompt.c search.c signal.c tags.c ttyin.c version.c"
|
2006-10-26 05:30:33 +04:00
|
|
|
src="$src charset.h cmd.h defines.h funcs.h less.h lesskey.h lglob.h option.h pckeys.h position.h regexp.h"
|
2003-04-14 06:56:45 +04:00
|
|
|
src="$src INSTALL LICENSE NEWS README less.nro"
|
1997-04-22 18:32:27 +04:00
|
|
|
|
|
|
|
pax -rvw $src $d/src/usr.bin/less/less
|
|
|
|
|
|
|
|
cd $d/src/usr.bin/less/less
|
|
|
|
mv less.nro less.1
|
|
|
|
|
|
|
|
### end less ###############################
|
|
|
|
|
|
|
|
### start lesskey ###############################
|
|
|
|
cd $r
|
|
|
|
echo lesskey:
|
|
|
|
src='lesskey.c lesskey.h lesskey.nro'
|
|
|
|
|
|
|
|
pax -rvw $src $d/src/usr.bin/less/lesskey
|
|
|
|
|
|
|
|
cd $d/src/usr.bin/less/lesskey
|
|
|
|
mv lesskey.nro lesskey.1
|
|
|
|
|
|
|
|
### end lesskey ###############################
|
|
|
|
|
1999-03-24 12:23:52 +03:00
|
|
|
### start lessecho ###############################
|
|
|
|
cd $r
|
|
|
|
echo lessecho:
|
|
|
|
src='lessecho.c'
|
|
|
|
|
|
|
|
pax -rvw $src $d/src/usr.bin/less/lessecho
|
|
|
|
|
|
|
|
### end lesskey ###############################
|
|
|
|
|
1997-04-22 18:32:27 +04:00
|
|
|
find $d -name '*.[ch]' -print | while read c; do
|
|
|
|
chmod u+w $c
|
|
|
|
done
|
|
|
|
|
|
|
|
echo done
|
|
|
|
exit 0
|