#25080 [NEW]: packages with optional dependencies can't be uninstalled

From: Date: Wed, 13 Aug 2003 21:14:07 +0000
Subject: #25080 [NEW]: packages with optional dependencies can't be uninstalled
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19692@lists.php.net to get a copy of this message
From: cellog@php.net Operating system: na PHP version: Irrelevant PHP Bug Type: PEAR related Bug description: packages with optional dependencies can't be uninstalled Description: ------------ if a package has an optional dependency, it can't be uninstalled if the optional dependency is installed. This patch fixes that Index: pear/PEAR/Dependency.php =================================================================== RCS file: /repository/php-src/pear/PEAR/Dependency.php,v retrieving revision 1.23 diff -u -r1.23 Dependency.php --- pear/PEAR/Dependency.php 3 Aug 2003 13:44:36 -0000 1.23 +++ pear/PEAR/Dependency.php 13 Aug 2003 21:13:31 -0000 @@ -151,11 +151,12 @@ * Check package dependencies on uninstall * * @param string $error The resultant error string + * @param string $warning The resultant warning string * @param string $name Name of the package to test * * @return bool true if there were errors */ - function checkPackageUninstall(&$error, $package) + function checkPackageUninstall(&$error, &$warning, $package) { $error = null; $packages = $this->registry->listPackages(); @@ -169,7 +170,11 @@ } foreach ($deps as $dep) { if ($dep['type'] == 'pkg' && strcasecmp($dep['name'], $package) == 0) { - $error .= "Package '$pkg' depends on '$package'\n"; + if (isset($dep['optional']) && $dep['optional'] == 'yes') { + $warning .= "\nWarning: Package '$pkg' optionally depends on '$package'"; + } else { + $error .= "Package '$pkg' depends on '$package'\n"; + } } } } -- Edit bug report at http://bugs.php.net/?id=25080&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25080&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25080&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25080&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25080&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25080&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25080&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25080&r=support Expected behavior: http://bugs.php.net/fix.php?id=25080&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25080&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25080&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25080&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25080&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25080&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25080&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25080&r=gnused

« previous php.pear.dev (#19692) next »