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 Teach pkg_create(1) to add an empty ...



details:   https://anonhg.NetBSD.org/src/rev/f02da82e5532
branches:  pkgviews
changeset: 534236:f02da82e5532
user:      jlam <jlam%NetBSD.org@localhost>
date:      Fri Jul 25 11:53:59 2003 +0000

description:
Teach pkg_create(1) to add an empty +VIEWS file to binary packages if the
-E flag is passed to it.  This is useful since the presence or absence of
a +VIEWS file tells us whether a package is depoted or not.  Also teach
pkg_add(1) to copy any +VIEWS file to ${PKG_DBDIR}/${PKGNAME} if the file
exists.  Bump the version to 20030725.

diffstat:

 usr.sbin/pkg_install/add/perform.c       |   6 ++++--
 usr.sbin/pkg_install/create/create.h     |   3 ++-
 usr.sbin/pkg_install/create/main.c       |  11 ++++++++---
 usr.sbin/pkg_install/create/perform.c    |  12 ++++++++++--
 usr.sbin/pkg_install/create/pkg_create.1 |   6 ++++--
 usr.sbin/pkg_install/lib/version.h       |   4 ++--
 usr.sbin/pkg_install/view/linkfarm.sh    |   4 ++--
 usr.sbin/pkg_install/view/pkg_view.sh    |   4 ++--
 8 files changed, 34 insertions(+), 16 deletions(-)

diffs (211 lines):

diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/add/perform.c
--- a/usr.sbin/pkg_install/add/perform.c        Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/add/perform.c        Fri Jul 25 11:53:59 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.70.2.2 2003/07/23 20:48:00 jlam Exp $    */
+/*     $NetBSD: perform.c,v 1.70.2.3 2003/07/25 11:53:59 jlam Exp $    */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.70.2.2 2003/07/23 20:48:00 jlam Exp $");
+__RCSID("$NetBSD: perform.c,v 1.70.2.3 2003/07/25 11:53:59 jlam Exp $");
 #endif
 #endif
 
@@ -682,6 +682,8 @@
                        move_file(".", DISPLAY_FNAME, LogDir);
                if (fexists(PRESERVE_FNAME))
                        move_file(".", PRESERVE_FNAME, LogDir);
+               if (fexists(VIEWS_FNAME))
+                       move_file(".", VIEWS_FNAME, LogDir);
 
                /* register dependencies */
                /* we could save some cycles here if we remembered what we
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/create/create.h
--- a/usr.sbin/pkg_install/create/create.h      Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/create/create.h      Fri Jul 25 11:53:59 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: create.h,v 1.16.4.1 2003/07/13 09:45:22 jlam Exp $ */
+/* $NetBSD: create.h,v 1.16.4.2 2003/07/25 11:54:01 jlam Exp $ */
 
 /* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */
 
@@ -51,6 +51,7 @@
 extern int RelativeLinks;
 extern int ReorderDirs;
 extern int update_pkgdb;
+extern int create_views;
 
 void    check_list(char *, package_t *, const char *);
 void    copy_plist(char *, package_t *);
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/create/main.c
--- a/usr.sbin/pkg_install/create/main.c        Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/create/main.c        Fri Jul 25 11:53:59 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: main.c,v 1.21.2.2 2003/07/23 20:48:01 jlam Exp $       */
+/*     $NetBSD: main.c,v 1.21.2.3 2003/07/25 11:54:01 jlam Exp $       */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: main.c,v 1.17 1997/10/08 07:46:23 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.21.2.2 2003/07/23 20:48:01 jlam Exp $");
+__RCSID("$NetBSD: main.c,v 1.21.2.3 2003/07/25 11:54:01 jlam Exp $");
 #endif
 #endif
 
@@ -48,6 +48,7 @@
 char    PlayPen[FILENAME_MAX];
 size_t  PlayPenSize = sizeof(PlayPen);
 int    update_pkgdb = 1;
+int    create_views = 0;
 int     Dereference = 0;
 int     PlistOnly = 0;
 int     RelativeLinks = 0;
@@ -58,7 +59,7 @@
 usage(void)
 {
        fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n",
-           "usage: pkg_create [-ORUhlVv] [-P dpkgs] [-C cpkgs] [-p prefix] [-f contents]",
+           "usage: pkg_create [-ORUEhlVv] [-P dpkgs] [-C cpkgs] [-p prefix] [-f contents]",
            "                  [-i iscript] [-k dscript] [-r rscript] [-t template]",
            "                  [-X excludefile] [-D displayfile] [-m mtreefile]",
            "                  [-b build-version-file] [-B build-info-file]",
@@ -81,6 +82,10 @@
                        Verbose = TRUE;
                        break;
 
+               case 'E':
+                       create_views = 1;
+                       break;
+
                case 'I':
                        realprefix = optarg;
                        break;
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/create/perform.c
--- a/usr.sbin/pkg_install/create/perform.c     Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/create/perform.c     Fri Jul 25 11:53:59 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.33.2.1 2003/07/13 09:45:23 jlam Exp $    */
+/*     $NetBSD: perform.c,v 1.33.2.2 2003/07/25 11:54:01 jlam Exp $    */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.33.2.1 2003/07/13 09:45:23 jlam Exp $");
+__RCSID("$NetBSD: perform.c,v 1.33.2.2 2003/07/25 11:54:01 jlam Exp $");
 #endif
 #endif
 
@@ -141,6 +141,9 @@
        if (Preserve) {
                (void) fprintf(totar, "%s\n", PRESERVE_FNAME);
        }
+       if (create_views) {
+               (void) fprintf(totar, "%s\n", VIEWS_FNAME);
+       }
 
        for (p = plist->head; p; p = p->next) {
                if (p->type == PLIST_FILE) {
@@ -390,6 +393,11 @@
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, PRESERVE_FNAME);
        }
+       if (create_views) {
+               write_file(VIEWS_FNAME, (char *)NULL);
+               add_plist(&plist, PLIST_IGNORE, NULL);
+               add_plist(&plist, PLIST_FILE, VIEWS_FNAME);
+       }
 
        /* Finally, write out the packing list */
        fp = fopen(CONTENTS_FNAME, "w");
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/create/pkg_create.1
--- a/usr.sbin/pkg_install/create/pkg_create.1  Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/create/pkg_create.1  Fri Jul 25 11:53:59 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_create.1,v 1.32.4.1 2003/07/13 09:45:23 jlam Exp $
+.\" $NetBSD: pkg_create.1,v 1.32.4.2 2003/07/25 11:54:01 jlam Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -32,7 +32,7 @@
 .Nd a utility for creating software package distributions
 .Sh SYNOPSIS
 .Nm
-.Op Fl hlORUVv
+.Op Fl EhlORUVv
 .Bk -words
 .Op Fl B Ar build-info-file
 .Ek
@@ -156,6 +156,8 @@
 or, if preceded by
 .Cm - ,
 the argument itself.
+.It Fl E
+Add an empty views file to the package.
 .It Fl f Ar packinglist
 Fetch ``packing list'' for package from the file
 .Ar packinglist
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/lib/version.h
--- a/usr.sbin/pkg_install/lib/version.h        Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/lib/version.h        Fri Jul 25 11:53:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.13.4.3 2003/07/24 23:14:52 jlam Exp $    */
+/*     $NetBSD: version.h,v 1.13.4.4 2003/07/25 11:54:02 jlam Exp $    */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -33,6 +33,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20030724"
+#define PKGTOOLS_VERSION "20030725"
 
 #endif /* _INST_LIB_VERSION_H_ */
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/view/linkfarm.sh
--- a/usr.sbin/pkg_install/view/linkfarm.sh     Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/view/linkfarm.sh     Fri Jul 25 11:53:59 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: linkfarm.sh,v 1.1.2.6 2003/07/14 22:54:51 jlam Exp $
+# $NetBSD: linkfarm.sh,v 1.1.2.7 2003/07/25 11:54:03 jlam Exp $
 
 #
 # Copyright (c) 2002 Alistair G. Crooks.  All rights reserved.
@@ -50,7 +50,7 @@
 }
 
 version() {
-       echo "20030713"
+       echo "20030725"
        exit 0
 }
 
diff -r 8d9194dccdab -r f02da82e5532 usr.sbin/pkg_install/view/pkg_view.sh
--- a/usr.sbin/pkg_install/view/pkg_view.sh     Thu Jul 24 23:38:59 2003 +0000
+++ b/usr.sbin/pkg_install/view/pkg_view.sh     Fri Jul 25 11:53:59 2003 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: pkg_view.sh,v 1.1.2.14 2003/07/24 23:38:59 jlam Exp $
+# $NetBSD: pkg_view.sh,v 1.1.2.15 2003/07/25 11:54:03 jlam Exp $
 
 #
 # Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -55,7 +55,7 @@
 }
 
 version() {
-       echo "20030724"
+       echo "20030725"
        exit 0
 }
 



Home | Main Index | Thread Index | Old Index