summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2003-09-02 08:26:35 +0000
committerjlam <jlam@pkgsrc.org>2003-09-02 08:26:35 +0000
commite6a9f770c33f03446087aed5c94967cdc359321e (patch)
treef1587f89c2668383e4a84aba9117114c2d7d57fc /pkgtools
parentdf790619d3944e4d3a8599f5dbbf9579efc22944 (diff)
downloadpkgsrc-e6a9f770c33f03446087aed5c94967cdc359321e.tar.gz
Only copy new files into place if they're different from the original file,
modulo $NetBSD$ tag differences.
Diffstat (limited to 'pkgtools')
-rwxr-xr-xpkgtools/pkg_install/files/src2nbcompat31
1 files changed, 25 insertions, 6 deletions
diff --git a/pkgtools/pkg_install/files/src2nbcompat b/pkgtools/pkg_install/files/src2nbcompat
index 3c4489e362b..fb31d5c63b7 100755
--- a/pkgtools/pkg_install/files/src2nbcompat
+++ b/pkgtools/pkg_install/files/src2nbcompat
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: src2nbcompat,v 1.3 2003/09/02 08:07:16 jlam Exp $
+# $NetBSD: src2nbcompat,v 1.4 2003/09/02 08:26:35 jlam Exp $
#
# Copyright (c) 2003 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -108,17 +108,36 @@ for f in $files; do
next; \
} \
{ print } \
- ' $newf > $dest/$newf
+ ' $newf > $dest/$newf.tmp
+ if [ -f $dest/$newf ] && \
+ diff -q -I "\$NetBSD.*\$" $dest/$newf $dest/$newf.tmp >/dev/null; then
+ rm -f $dest/$newf.tmp
+ else
+ rm -f $dest/$newf
+ mv $dest/$newf.tmp $dest/$newf
+ fi
;;
*.[1-9])
# Copy the manpage over, and generate the catpage.
- cp $newf $dest/$newf
- catf=`echo $newf | sed 's,\.\([1-9]\),.cat\1,'`
- nroff -mandoc $newf > $dest/$catf
+ cp $newf $dest/$newf.tmp
+ if [ -f $dest/$newf ] && \
+ diff -q -I "\$NetBSD.*\$" $dest/$newf $dest/$newf.tmp >/dev/null; then
+ rm -f $dest/$newf.tmp
+ else
+ mv -f $dest/$newf.tmp $dest/$newf
+ catf=`echo $newf | sed 's,\.\([1-9]\),.cat\1,'`
+ nroff -mandoc $newf > $dest/$catf
+ fi
;;
*)
# Everything else just gets copied verbatim.
- cp $newf $dest/$newf
+ cp $newf $dest/$newf.tmp
+ if [ -f $dest/$newf ] && \
+ diff -q -I "\$NetBSD.*\$" $dest/$newf $dest/$newf.tmp >/dev/null; then
+ rm -f $dest/$newf.tmp
+ else
+ mv -f $dest/$newf.tmp $dest/$newf
+ fi
;;
esac
done