pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc In unprivileged builds, the user running pkg_add and p...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8a0c44c2401a
branches:  trunk
changeset: 533040:8a0c44c2401a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Sep 07 15:45:14 2007 +0000

description:
In unprivileged builds, the user running pkg_add and pkg_delete is
almost always an unprivileged user. So there's no point in printing a
warning in that case.

diffstat:

 bootstrap/bootstrap                      |  6 +++++-
 pkgtools/pkg_install/files/add/perform.c |  6 +++---
 pkgtools/pkg_install/files/delete/main.c |  6 +++---
 3 files changed, 11 insertions(+), 7 deletions(-)

diffs (76 lines):

diff -r 874c53b13d76 -r 8a0c44c2401a bootstrap/bootstrap
--- a/bootstrap/bootstrap       Fri Sep 07 15:44:32 2007 +0000
+++ b/bootstrap/bootstrap       Fri Sep 07 15:45:14 2007 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.110 2007/09/06 20:13:44 joerg Exp $
+# $NetBSD: bootstrap,v 1.111 2007/09/07 15:45:14 rillig Exp $
 #
 #
 # Copyright (c) 2001-2002 Alistair G. Crooks.  All rights reserved.
@@ -790,6 +790,10 @@
        need_extras=yes
 fi
 
+if [ "$ignoreusercheck" = "yes" ]; then
+       echo "CPPFLAGS+=                        -DUNPRIVILEGED" >> ${BOOTSTRAP_MKCONF}
+fi
+
 echo_msg "Bootstrapping mk-files"
 run_cmd "(cd ${pkgsrcdir}/pkgtools/bootstrap-mk-files/files && env CP=${cpprog} \
  OPSYS=${opsys} MK_DST=${wrkdir}/share/mk ROOT_GROUP=${root_group} \
diff -r 874c53b13d76 -r 8a0c44c2401a pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Fri Sep 07 15:44:32 2007 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Fri Sep 07 15:45:14 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.59 2007/08/15 01:21:46 joerg Exp $       */
+/*     $NetBSD: perform.c,v 1.60 2007/09/07 15:45:14 rillig Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -14,7 +14,7 @@
 #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.59 2007/08/15 01:21:46 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.60 2007/09/07 15:45:14 rillig Exp $");
 #endif
 #endif
 
@@ -855,7 +855,7 @@
        if (!NoRecord && !Fake) {
                char    contents[MaxPathSize];
 
-#ifndef __INTERIX
+#if !defined(__INTERIX) && !defined(UNPRIVILEGED)
                if (getuid() != 0)
                        warnx("not running as root - trying to record install anyway");
 #endif
diff -r 874c53b13d76 -r 8a0c44c2401a pkgtools/pkg_install/files/delete/main.c
--- a/pkgtools/pkg_install/files/delete/main.c  Fri Sep 07 15:44:32 2007 +0000
+++ b/pkgtools/pkg_install/files/delete/main.c  Fri Sep 07 15:45:14 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.19 2007/08/15 01:49:02 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.20 2007/09/07 15:45:15 rillig Exp $ */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static char *rcsid = "from FreeBSD Id: main.c,v 1.11 1997/10/08 07:46:48 charnier Exp";
 #else
-__RCSID("$NetBSD: main.c,v 1.19 2007/08/15 01:49:02 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2007/09/07 15:45:15 rillig Exp $");
 #endif
 #endif
 
@@ -190,7 +190,7 @@
                warnx("missing package name(s)");
                usage();
        }
-#ifndef __INTERIX
+#if !defined(__INTERIX) && !defined(UNPRIVILEGED)
        if (!Fake && Verbose && getuid() != 0) {
                warnx("not running as root - trying to delete anyways");
        }



Home | Main Index | Thread Index | Old Index