aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Jones <carpaski@gentoo.org>2005-02-26 11:22:38 +0000
committerNicholas Jones <carpaski@gentoo.org>2005-02-26 11:22:38 +0000
commit26e88cdb8c8d4c513fd3a2b975616ac8492fe999 (patch)
tree5d5bf8465e614aa4e592b93896288dea82373122
parentconfig files for x86-fbsd 82978 (diff)
downloadportage-cvs-26e88cdb8c8d4c513fd3a2b975616ac8492fe999.tar.gz
portage-cvs-26e88cdb8c8d4c513fd3a2b975616ac8492fe999.tar.bz2
portage-cvs-26e88cdb8c8d4c513fd3a2b975616ac8492fe999.zip
BSD/Darwin patch.portage_2_0_51_17
BSD/GNU userland one-liner. Xpak xpak.tbz2.getboth() function. portage-2.0.51.17
-rw-r--r--ChangeLog15
-rwxr-xr-xbin/ebuild.sh27
-rwxr-xr-xbin/emerge-webrsync4
-rwxr-xr-xbin/etc-update7
-rwxr-xr-xbin/repoman4
-rw-r--r--pym/portage.py8
-rw-r--r--pym/portage_data.py16
-rw-r--r--pym/xpak.py13
8 files changed, 68 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 32eda2b..a34597a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,25 @@
# ChangeLog for Portage; the Gentoo Linux ports system
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Id: ChangeLog,v 1.796.2.72 2005/02/22 02:39:56 ferringb Exp $
+# $Id: ChangeLog,v 1.796.2.73 2005/02/26 11:22:37 carpaski Exp $
MAJOR CHANGES in 2.0.51:
1. /var/cache/edb/virtuals is no longer used at all. It's calculated now.
2. /var/cache/edb/world is now /var/lib/portage/world.
3. /etc/portage/profile/virtuals is _USER_ configs only.
+*portage-2.0.51.17 (26 Feb 2004): Maintainence Release + BSD chflags
+
+ 26 Feb 2005; Nicholas Jones <carpaski@gentoo.org> *: Darwin userland patch
+ from Kito (bug 82312). Adjusted a couple bits like the file was installed
+ with message and etc-update's USERLAND check per Jason suggestion.
+
+ 26 Feb 2005; Nicholas Jones <carpaski@gentoo.org> portage_data.py: Added
+ the 'gnu' suffix check for the BSD/GNU people. (bug 80018)
+
+ 26 Feb 2005; Nicholas Jones <carpaski@gentoo.org> pym/xpak.py: Added in a
+ method to get both the data and index segments for use with the other memory
+ based functions.
+
21 Feb 2005; Brian Harring <ferringb@gentoo.org> pym/portage.py: So yeah.
Don't fool with the eclass_cache.porttree ordering unless you understand that
it -must- match bash's inherit order (where overlays override portdir).
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2b642a5..014314f 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.201.2.23 2005/02/06 02:48:43 jstubbs Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v 1.201.2.24 2005/02/26 11:22:37 carpaski Exp $
export SANDBOX_PREDICT="${SANDBOX_PREDICT}:/proc/self/maps:/dev/console:/usr/lib/portage/pym:/dev/random"
export SANDBOX_WRITE="${SANDBOX_WRITE}:/dev/shm:${PORTAGE_TMPDIR}"
@@ -690,6 +690,10 @@ dyn_clean() {
chflags -R noschg,nouchg,nosappnd,nouappnd,nosunlnk,nouunlnk \
"${BUILDDIR}"
fi
+
+ if [ "$USERLAND" == "Darwin" ] && type -p chflags &>/dev/null; then
+ chflags -R noschg,nouchg,nosappnd,nouappnd "${BUILDDIR}"
+ fi
rm -rf "${BUILDDIR}/image"
@@ -1063,7 +1067,7 @@ dyn_install() {
python -c "import os,stat; print '%o' % os.stat('$1')[stat.ST_MODE]"
}
else
- if [ "${USERLAND}" == "BSD" ]; then
+ if [ "${USERLAND}" == "BSD" ] || [ "${USERLAND}" == "Darwin" ]; then
do_stat() {
# BSD version -- Octal result
$(type -p stat) -f '%p' "$1"
@@ -1083,20 +1087,31 @@ dyn_install() {
}
local file s
+ local count=0
find "${D}/" -user portage | while read file; do
- ewarn "file $file was installed with user portage!"
+ count=$(( $count + 1 ))
s=$(stat_perms $file)
chown root "$file"
chmod "$s" "$file"
done
+ if (( $count > 0 )); then
+ ewarn "$count files were installed with user portage!"
+ fi
+ count=0
find "${D}/" -group portage | while read file; do
- ewarn "file $file was installed with group portage!"
+ count=$(( $count + 1 ))
s=$(stat_perms "$file")
- [ "$USERLAND" == "BSD" ] && chgrp wheel "$file"
- [ "$USERLAND" != "BSD" ] && chgrp root "$file"
+ if [ "$USERLAND" == "BSD" ] || [ "$USERLAND" == "Darwin" ];then
+ chgrp wheel "$file"
+ else
+ chgrp root "$file"
+ fi
chmod "$s" "$file"
done
+ if (( $count > 0 )); then
+ ewarn "$count files were installed with group portage!"
+ fi
unset -f stat_perms
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index fbe4d21..c33872c 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/Attic/emerge-webrsync,v 1.8.2.3 2005/01/17 16:38:22 jstubbs Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/Attic/emerge-webrsync,v 1.8.2.4 2005/02/26 11:22:38 carpaski Exp $
# Author: Karl Trygve Kalleberg <karltk@gentoo.org>
# Rewritten from the old, Perl-based emerge-webrsync script
@@ -68,7 +68,7 @@ while (( $attempts < 40 )) ; do
attempts=$(( attempts + 1 ))
#this too, sucks. it works in the interim though.
- if [ "$USERLAND" == "BSD" ] ; then
+ if [ "$USERLAND" == "BSD" ] || [ "$USERLAND" == "Darwin" ] ; then
daysbefore=$(expr $(date +"%s") - 86400 \* $attempts)
day=$(date -r $daysbefore +"%d")
month=$(date -r $daysbefore +"%m")
diff --git a/bin/etc-update b/bin/etc-update
index 0f4f8dc..19145e4 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.23.2.2 2005/01/30 11:33:02 jstubbs Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/etc-update,v 1.23.2.3 2005/02/26 11:22:38 carpaski Exp $
# Author Brandon Low <lostlogic@gentoo.org>
#
@@ -12,7 +12,10 @@
export PORTAGE_CALLER="etc-update"
-if [ $(/usr/lib/portage/bin/portageq envvar USERLAND) = BSD ] ; then
+USERLAND="$(/usr/lib/portage/bin/portageq envvar USERLAND)"
+if [ "$USERLAND" == "BSD" ] ; then
+ function sed() { gsed "$@"; }
+elif [ "$USERLAND" == "Darwin" ] && [ -x /bin/gsed ]; then
function sed() { gsed "$@"; }
fi
diff --git a/bin/repoman b/bin/repoman
index f206b47..d40df62 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,7 +1,7 @@
#!/usr/bin/python -O
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/repoman,v 1.98.2.12 2005/02/05 14:31:25 jstubbs Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/repoman,v 1.98.2.13 2005/02/26 11:22:38 carpaski Exp $
# Next to do: dep syntax checking in mask files
# Then, check to make sure deps are satisfiable (to avoid "can't find match for" problems)
@@ -347,7 +347,7 @@ if os.path.isdir("CVS"):
print "rm -Rf [a-z]*"
print "cvs up"
print
- if portage.userland=="BSD":
+ if portage.userland=="BSD" or portage.userland=="Darwin":
print "find ./ -type f -regex '.*/CVS/Root$' -print0 | xargs -0 sed \\"
else:
print "find ./ -type f -regex '.*/CVS/Root$' -print0 | xargs -0r sed \\"
diff --git a/pym/portage.py b/pym/portage.py
index 9028968..22c4160 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1,10 +1,10 @@
# portage.py -- core Portage functionality
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.524.2.42 2005/02/22 02:39:55 ferringb Exp $
-cvs_id_string="$Id: portage.py,v 1.524.2.42 2005/02/22 02:39:55 ferringb Exp $"[5:-2]
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage.py,v 1.524.2.43 2005/02/26 11:22:38 carpaski Exp $
+cvs_id_string="$Id: portage.py,v 1.524.2.43 2005/02/26 11:22:38 carpaski Exp $"[5:-2]
-VERSION="$Revision: 1.524.2.42 $"[11:-2] + "-cvs"
+VERSION="$Revision: 1.524.2.43 $"[11:-2] + "-cvs"
# ===========================================================================
# START OF IMPORTS -- START OF IMPORTS -- START OF IMPORTS -- START OF IMPORT
@@ -6765,7 +6765,7 @@ class dblink:
# old package won't yank the file with it. (non-cfgprot related)
os.utime(myrealdest,(thismtime,thismtime))
zing="---"
- if self.settings["ARCH"] == "ppc-macos" and myrealdest[-2:] == ".a":
+ if self.settings["USERLAND"] == "Darwin" and myrealdest[-2:] == ".a":
# XXX kludge, bug #58848; can be killed when portage stops relying on
# md5+mtime, and uses refcounts
diff --git a/pym/portage_data.py b/pym/portage_data.py
index 54858f9..96d5f18 100644
--- a/pym/portage_data.py
+++ b/pym/portage_data.py
@@ -1,8 +1,8 @@
# portage_data.py -- Calculated/Discovered Data Values
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_data.py,v 1.5.2.1 2005/01/16 02:35:33 carpaski Exp $
-cvs_id_string="$Id: portage_data.py,v 1.5.2.1 2005/01/16 02:35:33 carpaski Exp $"[5:-2]
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/portage_data.py,v 1.5.2.2 2005/02/26 11:22:38 carpaski Exp $
+cvs_id_string="$Id: portage_data.py,v 1.5.2.2 2005/02/26 11:22:38 carpaski Exp $"[5:-2]
import os,pwd,grp
from portage_util import writemsg
@@ -11,14 +11,16 @@ from output import green,red
ostype=os.uname()[0]
lchown = None
-if ostype=="Linux":
+if ostype=="Linux" or ostype.lower().endswith("gnu"):
userland="GNU"
os.environ["XARGS"]="xargs -r"
-elif ostype in ["Darwin","FreeBSD","OpenBSD"]:
- if ostype == "Darwin":
- lchown=os.chown
- userland="BSD"
+elif ostype == "Darwin":
+ userland="Darwin"
os.environ["XARGS"]="xargs"
+ lchown=os.chown
+elif ostype in ["FreeBSD","OpenBSD"]:
+ userland="BSD"
+ os.environ["XARGS"]="xargs"
else:
writemsg(red("Operating system")+" \""+ostype+"\" "+red("currently unsupported. Exiting.")+"\n")
sys.exit(1)
diff --git a/pym/xpak.py b/pym/xpak.py
index 4472e99..87f8e8f 100644
--- a/pym/xpak.py
+++ b/pym/xpak.py
@@ -1,7 +1,7 @@
# Copyright 2001-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/xpak.py,v 1.13.2.2 2005/01/16 02:35:33 carpaski Exp $
-cvs_id_string="$Id: xpak.py,v 1.13.2.2 2005/01/16 02:35:33 carpaski Exp $"[5:-2]
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/pym/xpak.py,v 1.13.2.3 2005/02/26 11:22:38 carpaski Exp $
+cvs_id_string="$Id: xpak.py,v 1.13.2.3 2005/02/26 11:22:38 carpaski Exp $"[5:-2]
# The format for a tbz2/xpak:
#
@@ -370,6 +370,15 @@ class tbz2:
os.chdir(origdir)
return 1
+ def getboth(self):
+ """Returns an array [indexSegment,dataSegment]"""
+ if not self.scan():
+ return None
+ a = open(self.file,"r")
+ a.seek(self.datapos)
+ mydata =a.read(self.datasize)
+ a.close()
+ return [self.index[:],mydata]