pkgsrc-Changes archive

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

CVS commit: pkgsrc/bootstrap



Module Name:    pkgsrc
Committed By:   bacon
Date:           Thu Aug 20 13:04:01 UTC 2020

Modified Files:
        pkgsrc/bootstrap: bootstrap

Log Message:
bootstrap: Default to PREFER_PKGSRC=yes on Linux

Avoids problems caused by linking against aging enterprise Linux libraries or
libraries from Linux package managers that undergo ABI changes outside pkgsrc
control.

Add --prefer-native flag to bootstrap script so all PREFER_* values can be
set during bootstrap. This resolves issues where bootstrap links packages
against native libraries and pkgsrc equivalents are installed afterward due
to changes to PREFER_NATIVE after bootstrap.

Automatically document danger of changing PREFER_PKGSRC or PREFER_NATIVE after
boostrap in mk.conf


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 pkgsrc/bootstrap/bootstrap

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/bootstrap/bootstrap
diff -u pkgsrc/bootstrap/bootstrap:1.291 pkgsrc/bootstrap/bootstrap:1.292
--- pkgsrc/bootstrap/bootstrap:1.291    Fri Aug 14 08:45:30 2020
+++ pkgsrc/bootstrap/bootstrap  Thu Aug 20 13:04:01 2020
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: bootstrap,v 1.291 2020/08/14 08:45:30 jperkin Exp $
+# $NetBSD: bootstrap,v 1.292 2020/08/20 13:04:01 bacon Exp $
 #
 # Copyright (c) 2001-2011 Alistair Crooks <agc%NetBSD.org@localhost>
 # All rights reserved.
@@ -70,6 +70,7 @@ usage="Usage: $0 "'
     [ --pkginfodir <pkginfodir> ]
     [ --pkgmandir <pkgmandir> ]
     [ --prefer-pkgsrc <list|yes|no> ]
+    [ --prefer-native <list|yes|no> ]
     [ --prefix <prefix> ]
     [ --preserve-path ]
     [ --quiet ]
@@ -448,6 +449,10 @@ while [ $# -gt 0 ]; do
                        prefer_pkgsrc=`get_optarg "$1"` ;;
        --prefer-pkgsrc)
                        prefer_pkgsrc="$2"; shift ;;
+       --prefer-native=*)
+                       prefer_native=`get_optarg "$1"` ;;
+       --prefer-native)
+                       prefer_native="$2"; shift ;;
        --preserve-path) preserve_path=yes ;;
        --mk-fragment=*)
                        mk_fragment=`get_optarg "$1"` ;;
@@ -1064,10 +1069,29 @@ echo "PKGINFODIR=               $pkginfodir" >> ${TAR
 echo "PKGMANDIR=               $pkgmandir" >> ${TARGET_MKCONF}
 echo "" >> ${TARGET_MKCONF}
 
+case $opsys in
+Linux)
+       # Default to PREFER_PKGSRC=yes unless user specifies --prefer-native=yes
+       # Linux systems likely have software from other packages managers
+       # like yum or apt that can leak into pkgsrc and cause issues as they
+       # age, undergo ABI changes, or get added/removed behind our backs.
+       # Let pkgsrc maintain all dependencies to avoid these problems.
+       if [ -z "$prefer_pkgsrc" ] && [ "$prefer_native" != "yes" ]; then
+               prefer_pkgsrc="yes"
+       fi
+       ;;
+esac
+
 if [ -n "$prefer_pkgsrc" ]; then
+       echo "# WARNING: Changing PREFER_* after bootstrap will require rebuilding all" >> ${TARGET_MKCONF}
+       echo "# packages with a dependency that switched between native/pkgsrc." >> ${TARGET_MKCONF}
        echo "PREFER_PKGSRC=            $prefer_pkgsrc" >> ${TARGET_MKCONF}
        echo "" >> ${TARGET_MKCONF}
 fi
+if [ -n "$prefer_native" ]; then
+       echo "PREFER_NATIVE=            $prefer_native" >> ${TARGET_MKCONF}
+       echo "" >> ${TARGET_MKCONF}
+fi
 
 BOOTSTRAP_MKCONF=${wrkdir}/mk.conf
 cp ${TARGET_MKCONF} ${BOOTSTRAP_MKCONF}



Home | Main Index | Thread Index | Old Index