Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 2009 11:18:56 -0900
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Cc:        n j <nino80@gmail.com>
Subject:   Re: Logcheck dependency hell
Message-ID:  <200902161118.56864.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <92bcbda50902120422x7c73808dy650d6918054af9f4@mail.gmail.com>
References:  <92bcbda50902120422x7c73808dy650d6918054af9f4@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 12 February 2009 03:22:04 n j wrote:
> Hello,
>
> could anyone help me what command should I use to find out which
> logcheck-required port _exactly_ is trying to install half of the X
> libraries?
>
> The logcheck port lists the following build depends (output of
> pretty-print-build-depends-list):

# finddep.php security/logcheck x11/xorg-libraries
/usr/ports/textproc/docbook-to-man: /usr/local/libdata/xorg/libraries 
=> /usr/ports/x11/xorg-libraries

Script below sig.

-- 
Mel

#!/usr/local/bin/php -q
<?php
// vim: ts=4 sw=4 nobackup noet
//define('DEBUG', 1);
function usage()
{
	$me = $argv[0];
	echo("Usage: $me <origin> <dep>\n");
	echo("\tFind which dependancy lists dep in origin\n");
	exit(1);
}

function chkdep($val, $check)
{
	if( !is_dir($val) )
	{
		fprintf(STDERR, "No such dir: %s/%s\n", $GLOBALS['PORTSDIR'],
			$val
		);
		return;
	}
	chdir($val);
	$_deps = preg_split('/\s/',
		shell_exec("/usr/bin/make -V LIB_DEPENDS -V RUN_DEPENDS -V BUILD_DEPENDS")
	);
	foreach($_deps AS $_dep)
	{
		list($pkgname, $origin) = explode(':', $_dep);
		if( preg_match('/^\s*$/', $origin) )
			continue;
		if( in_array($origin, $GLOBALS['CHECKED']) )
			continue;
		if( $origin == $GLOBALS['PORTSDIR'] . '/' . $check )
			echo("$val: $pkgname => $origin\n");
		else
		{
			if( defined('DEBUG') )
			{
				fprintf(STDERR, "%s != %s/%s\n", $origin, $GLOBALS['PORTSDIR'],
					$check
				);
			}
			$GLOBALS['CHECKED'][] = $origin;
			chkdep($origin, $check);
		}
	}
}
if( $argc < 3 )
	usage();

$PORTSDIR=('' != getenv('PORTSDIR') ) ? getenv('PORTSDIR') : '/usr/ports';
$pkg = $argv[1];
$dep = $argv[2];
if(!file_exists("$PORTSDIR/$pkg/Makefile") )
{
	fprintf(STDERR, "Orphaned port: $pkg\n");
	exit(2);
}
$CHECKED=array();
chkdep($PORTSDIR . '/' . $pkg, $dep);
?>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902161118.56864.fbsd.questions>