head	1.4;
access;
symbols
	pkgsrc-2013Q2:1.4.0.6
	pkgsrc-2013Q2-base:1.4
	pkgsrc-2012Q4:1.4.0.4
	pkgsrc-2012Q4-base:1.4
	pkgsrc-2011Q4:1.4.0.2
	pkgsrc-2011Q4-base:1.4
	pkgsrc-2011Q3:1.3.0.34
	pkgsrc-2011Q3-base:1.3
	pkgsrc-2011Q2:1.3.0.32
	pkgsrc-2011Q2-base:1.3
	pkgsrc-2011Q1:1.3.0.30
	pkgsrc-2011Q1-base:1.3
	pkgsrc-2010Q4:1.3.0.28
	pkgsrc-2010Q4-base:1.3
	pkgsrc-2010Q3:1.3.0.26
	pkgsrc-2010Q3-base:1.3
	pkgsrc-2010Q2:1.3.0.24
	pkgsrc-2010Q2-base:1.3
	pkgsrc-2010Q1:1.3.0.22
	pkgsrc-2010Q1-base:1.3
	pkgsrc-2009Q4:1.3.0.20
	pkgsrc-2009Q4-base:1.3
	pkgsrc-2009Q3:1.3.0.18
	pkgsrc-2009Q3-base:1.3
	pkgsrc-2009Q2:1.3.0.16
	pkgsrc-2009Q2-base:1.3
	pkgsrc-2009Q1:1.3.0.14
	pkgsrc-2009Q1-base:1.3
	pkgsrc-2008Q4:1.3.0.12
	pkgsrc-2008Q4-base:1.3
	pkgsrc-2008Q3:1.3.0.10
	pkgsrc-2008Q3-base:1.3
	cube-native-xorg:1.3.0.8
	cube-native-xorg-base:1.3
	pkgsrc-2008Q2:1.3.0.6
	pkgsrc-2008Q2-base:1.3
	cwrapper:1.3.0.4
	pkgsrc-2008Q1:1.3.0.2
	pkgsrc-2008Q1-base:1.3
	pkgsrc-2007Q4:1.1.0.6
	pkgsrc-2007Q4-base:1.1
	pkgsrc-2007Q3:1.1.0.4
	pkgsrc-2007Q3-base:1.1
	pkgsrc-2007Q2:1.1.0.2
	pkgsrc-2007Q2-base:1.1;
locks; strict;
comment	@# @;


1.4
date	2011.10.15.00.23.09;	author reed;	state dead;
branches;
next	1.3;

1.3
date	2008.03.11.17.44.03;	author joerg;	state Exp;
branches;
next	1.2;

1.2
date	2008.03.10.20.05.59;	author joerg;	state Exp;
branches;
next	1.1;

1.1
date	2007.05.22.16.17.16;	author joerg;	state Exp;
branches;
next	;


desc
@@


1.4
log
@Rename "flavor" to "pkgformat".

This is from Anton Panev's GSoC 2011 project to add RPM and DPKG
support to pkgsrc. (I am not adding that further support in this
commit.)

This is just a rename of the existing functionality. Now it will
be easy to test the GSoC work by simply putting in a single
directory (such as "rpm" or "deb"). See
http://addpackageforma.sourceforge.net/ for some details.

This is from Anton's CVS, but I made some minor changes:

- changed plural pkgformats to singular pkgformat (to be consistent)

- fixed a few places (in comments) that were missed

- catch up on some additions to flavor not in the pkgforma cvs:
PKGSRC_SETENV and _flavor-destdir-undo-replace and
undo-destdir-replace-install.
@
text
@#!/bin/sh
#
######################################################################
#
# NAME
#	resolve-dependencies -- resolve package dependencies
#
# SYNOPSIS
#	resolve-dependencies
#
# DESCRIPTION
#	resolve-dependencies checks all entries in ${DEPENDS_FILE}
#	for existance.  The best matching pattern is printed similiar
#	to list-dependencies
#
######################################################################

: ${CAT:=cat}
: ${ECHO:=echo}
: ${TEST:=test}
: ${TRUE:=true}

set -e

DEPENDS_FILE=${_DEPENDS_FILE}
unset _DEPENDS_FILE

error_msg() {
	${ECHO} "ERROR:" "$*" 1>&2
}

find_best() {
	${PKG_INFO} -E "$1" || ${TRUE}
}

${CAT} ${DEPENDS_FILE} | while read type pattern dir; do
	pkg=`find_best "$pattern"`
	case "$pkg" in
	"")
		error_msg "[resolve-dependencies] A package matching \`\`$pattern'' should"
		error_msg "    be installed, but one cannot be found.  Perhaps there is a"
		error_msg "    stale work directory for $dir?"
		exit 1
		;;
	*)
		${ECHO} "$type	$pattern	$pkg"
		;;
	esac
done
@


1.3
log
@Explicitly "" around $1, so that e.g. csh-like expansion of {} doesn't
happen.
@
text
@@


1.2
log
@Replace "pkg_admin -S lsbest" usage with pkg_info -E. The base stripping
in bsd.buildlink3.mk was broken with pkg_install-20080309 was it
returned a relative path. It would have failed before e.g. with symbolic
links in the path. pkg_info -E is simpler and was added exactly for this
purpose. Fixes PR 38213 and PR 38211.
@
text
@d33 1
a33 1
	${PKG_INFO} -E $1 || ${TRUE}
@


1.1
log
@Make depends-cookie a flavor indendepent target. Before it was used to
trace the dependency information. This is computed and stored in
.depends directly now before anything else is done. The output is locked
and the locking is supposed to work before the bootstrap-depends are
installed.

Add a new hook for flavors after all dependencies are added and before
the depends-cookie is created. Use this to compute which package is used
to fulfill each dependency and store it in .rdepends. Adjust
register-dependencies and some other places to use this information
directly instead of recomputing it all the time.

The code to list all dependencies and to recursively install missing
ones is moved to a separate shell script. This makes it easier to
understand what is going on and extend them later.

Change the calling of pkg_create to prepend the dependencies directly to
the passed-in PLIST and not via -P and -T. This is in preperation of
changing the way they are stored in the packages.

Discussed with, recieved minor disagreement about install-dependencies,
but otherwise OKed by jlam.
@
text
@d33 1
a33 1
	${PKG_ADMIN} -b -d ${_PKG_DBDIR} -S lsbest $1 || ${TRUE}
@

