1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-15 23:50:44 +00:00
freebsd-ports/lang/modula-3/scripts/fix_pathnames
John Polstra 9aef92e855 Split this port into two pieces, with most of the work now being done by
the new "modula-3-lib" port.  The split allows one to save a lot of
disk space by installing only the shared libraries needed for executing
programs.  The full "modula-3" port is needed only if you want to
compile programs as well.
1996-10-29 23:17:19 +00:00

28 lines
634 B
Bash

#! /bin/sh
#
# $Id: fix_pathnames,v 1.2 1996/09/10 05:25:10 jdp Exp $
umask 022
if [ $# -ne 2 ]; then
echo "Usage: $0 oldpath newpath" >&2
exit 1
fi
oldpath=$1
newpath=$2
pkgdir=lib/m3/pkg
# Fix absolute pathnames in files so that they reference the actual
# installation directory, instead of the temporary directory we have
# been using.
cd ${newpath}/${pkgdir}
for i in `cd ${oldpath}/${pkgdir}; \
find . -type f \( -name .M3IMPTAB -o -name FreeBSD2 \)`; do
test -f ${i}.bak || cp -p ${i} ${i}.bak
rm -f ${i}
sed -e "s|/[^ ]*/work/installed/|${newpath}/|g" ${i}.bak >${i} && \
rm -f ${i}.bak
done