openbsd-ports/infrastructure/package/check-plist
espie 33f5e8c2c7 pkglocatedb is a pkgpath like others. make sure it's there, even though
it's in arch's plists.

fix absolute path handling (yeah, I'm stupid)
2010-07-26 12:34:43 +00:00

59 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
# $OpenBSD: check-plist,v 1.7 2010/07/26 12:34:43 espie Exp $
# Copyright (c) 2001
# Marc Espie. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Neither the name of OpenBSD nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY ITS AUTHOR AND THE OpenBSD project ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
# starting from an initial list, check package dependencies, and build
# derived updated lists.
# list.depends: all package dependencies
# list.dirs: corresponding extended directories
# list.pkgs: corresponding package names
if [ $# -ne 1 ]; then
echo "This script takes exactly one parameter"
exit 1
fi
initial=$1
case "$initial" in
/*);;
*)initial=`pwd`"/$initial";;
esac
depends="$initial.depends"
list="$initial.dirs"
packages="$initial.pkgs"
trimmed="$initial.trimmed"
: ${PORTSDIR:=/usr/ports}
cd ${PORTSDIR}
make ECHO_MSG='echo >&2' SUBDIRLIST=$initial show=FULLPKGPATH >$trimmed
echo databases/pkglocatedb >>$trimmed
make ECHO_MSG='echo >&2' SUBDIRLIST=$trimmed run-dir-depends >$depends
tsort -h $trimmed -r $depends >$list
make ECHO_MSG='echo >&2' show='FULLPKGNAME${SUBPACKAGE}' SUBDIRLIST=$list|sed -e 's,$,.tgz,' >$packages
echo "Packages with distribution problems:"
echo "------------------------------------"
make ECHO_MSG='echo -n' show=PERMIT_PACKAGE_CDROM SUBDIRLIST=$list|\
grep -v -i 'Yes$'