1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-14 23:46:10 +00:00
freebsd-ports/lang/modula-3/scripts/fix_pathnames
John Polstra 28eacf3dc2 Instead of trying to auto-detect whether X11 is installed, require
the user to define NO_X11 if it is not.  The auto-detection scheme
caused problems for Satoshi's port building system.
1999-01-28 05:39:19 +00:00

30 lines
654 B
Bash

#! /bin/sh
#
# $Id: fix_pathnames,v 1.3 1996/10/29 23:17:19 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
if [ -f ${i} ]; then
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
fi
done