From 84d50fe73c78a4034019bbd7906d0bd4b966588b Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 20 Mar 2012 16:59:10 +0545 Subject: Fix case where package names are substrings of each other. e.g. "squid" and "squid_radius_auth". Look for "squid-", which will match the full PBI package name for squid but will not match "squid_radius_auth". Bug #2301 --- etc/inc/pkg-utils.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'etc/inc/pkg-utils.inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 8f60e61..7734cc7 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -8,7 +8,7 @@ * $Id$ ****** * - * Copyright (C) 2010 Ermal Luçi + * Copyright (C) 2010 Ermal Lu�i * Copyright (C) 2005-2006 Colin Smith (ethethlay@gmail.com) * All rights reserved. * Redistribution and use in source and binary forms, with or without @@ -794,11 +794,11 @@ function install_package_xml($pkg) { * change packages to store configs at /usr/pbi/pkg/etc and remove this */ eval_once($pkg_config['custom_php_install_command']); - exec("/usr/local/sbin/pbi_info | grep {$pkg} | xargs /usr/local/sbin/pbi_info | awk '/Prefix/ {print $2}'",$pbidir); - $pbidir = $pbidir[0]; + exec("/usr/local/sbin/pbi_info | grep {$pkg}- | xargs /usr/local/sbin/pbi_info | awk '/Prefix/ {print $2}'",$pbidirarray); + $pbidir0 = $pbidirarray[0]; exec("find /usr/local/etc/ -name *.conf | grep {$pkg}",$files); foreach($files as $f) { - $pbiconf = str_replace('/usr/local',$pbidir,$f); + $pbiconf = str_replace('/usr/local',$pbidir0,$f); unlink($pbiconf); symlink($f,$pbiconf); } -- cgit v1.1