Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/pkgviews]: src/usr.sbin/pkg_install/view Teach pkg_view(1) to dig the li...



details:   https://anonhg.NetBSD.org/src/rev/4f333408ccea
branches:  pkgviews
changeset: 534268:4f333408ccea
user:      jlam <jlam%NetBSD.org@localhost>
date:      Mon Aug 25 20:58:04 2003 +0000

description:
Teach pkg_view(1) to dig the list of ignored files out of the +BUILD_INFO
file for a package, so that we ignore the same set of files as when we
originally installed it from a source build within pkgsrc.  Ride the recent
bump in version number with this change.

diffstat:

 usr.sbin/pkg_install/view/pkg_view.1  |   9 ++++++++-
 usr.sbin/pkg_install/view/pkg_view.sh |  23 +++++++++++++++++++----
 2 files changed, 27 insertions(+), 5 deletions(-)

diffs (79 lines):

diff -r a72b8719a977 -r 4f333408ccea usr.sbin/pkg_install/view/pkg_view.1
--- a/usr.sbin/pkg_install/view/pkg_view.1      Mon Aug 25 20:17:08 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.1      Mon Aug 25 20:58:04 2003 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_view.1,v 1.1.2.11 2003/08/25 20:17:12 jlam Exp $
+.\"    $NetBSD: pkg_view.1,v 1.1.2.12 2003/08/25 20:58:04 jlam Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -191,6 +191,13 @@
 to the
 .Ar package
 directory, and it defaults to "info/dir *[~#] *.OLD *.orig *,v".
+This is overridden by any
+.Ev _PLIST_IGNORE_FILES
+setting in a package's
+.Ar build-info-file
+(see
+.Xr pkg_create 1
+) if it exists.
 .It Ev PKG_VIEW
 The default view can be specified in the
 .Ev PKG_VIEW
diff -r a72b8719a977 -r 4f333408ccea usr.sbin/pkg_install/view/pkg_view.sh
--- a/usr.sbin/pkg_install/view/pkg_view.sh     Mon Aug 25 20:17:08 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.sh     Mon Aug 25 20:58:04 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: pkg_view.sh,v 1.1.2.27 2003/08/25 20:17:12 jlam Exp $
+# $NetBSD: pkg_view.sh,v 1.1.2.28 2003/08/25 20:58:04 jlam Exp $
 
 #
 # Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -73,8 +73,9 @@
 stowdir=""
 viewbase=${LOCALBASE:-/usr/pkg}
 view=${PKG_VIEW:-""}
-ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"}
+dflt_ignorefiles=${PLIST_IGNORE_FILES:-"info/dir *[~#] *.OLD *.orig *,v"}
 dflt_pkg_dbdir=${PKG_DBDIR:-/var/db/pkg}
+ignorefiles=""
 verbose=no
 
 while [ $# -gt 0 ]; do
@@ -149,8 +150,15 @@
                                echo "Adding package $1 to ${targetdir}."
                        fi
                        checkpkg $1 ${depot_pkg_dbdir}
+                       if [ -f ${depot_pkg_dbdir}/$1/+BUILD_INFO ]; then
+                               ignore=`$grepprog "^_PLIST_IGNORE_FILES=" ${depot_pkg_dbdir}/$1/+BUILD_INFO | $sedprog -e 's|^_PLIST_IGNORE_FILES=[     ]*||'`
+                       fi
+                       case "$ignore" in
+                       "")     ignore="${dflt_ignorefiles}" ;;
+                       esac
                        dbs=`(cd ${depot_pkg_dbdir}/$1; echo +*)`
-                       env PLIST_IGNORE_FILES="${ignorefiles} $dbs" $linkfarmprog --target=${targetdir} --dir=${depot_pkg_dbdir} $1
+                       ignore="${ignore} ${ignorefiles} $dbs"
+                       env PLIST_IGNORE_FILES="${ignore}" $linkfarmprog --target=${targetdir} --dir=${depot_pkg_dbdir} $1
                        $mkdirprog -p ${depot_pkg_dbdir}/$1
                        temp=${depot_pkg_dbdir}/$1/+VIEWS.$$
                        $touchprog ${depot_pkg_dbdir}/$1/+VIEWS
@@ -211,8 +219,15 @@
                        fi
                fi
                checkpkg $1 ${depot_pkg_dbdir}
+               if [ -f ${depot_pkg_dbdir}/$1/+BUILD_INFO ]; then
+                       ignore=`$grepprog "^_PLIST_IGNORE_FILES=" ${depot_pkg_dbdir}/$1/+BUILD_INFO | $sedprog -e 's|^_PLIST_IGNORE_FILES=[     ]*||'`
+               fi
+               case "$ignore" in
+               "")     ignore="${dflt_ignorefiles}" ;;
+               esac
                dbs=`(cd ${depot_pkg_dbdir}/$1; echo +*)`
-               env PLIST_IGNORE_FILES="${ignorefiles} $dbs" $linkfarmprog -D --target=${targetdir} --dir=${depot_pkg_dbdir} $1
+               ignore="${ignore} ${ignorefiles} $dbs"
+               env PLIST_IGNORE_FILES="${ignore}" $linkfarmprog -D --target=${targetdir} --dir=${depot_pkg_dbdir} $1
                temp=${depot_pkg_dbdir}/$1/+VIEWS.$$
                $cpprog ${depot_pkg_dbdir}/$1/+VIEWS ${temp}
                ($grepprog -v '^'${pkg_dbdir}'$' ${temp} || true) > ${depot_pkg_dbdir}/$1/+VIEWS



Home | Main Index | Thread Index | Old Index