Edit report at http://pear.php.net/bugs/bug.php?id=17350&edit=1
ID: 17350
Updated by: [email protected]
Reported By: tim at timj dot co dot uk
Summary: "pear install --force" doesn't uninstall files from
previous pkg versions
-Status: Assigned
+Status: Closed
Type: Bug
Package: PEAR
Operating System: Linux
Package Version: 1.9.0
PHP Version: Irrelevant
Assigned To: dufuz
Roadmap Versions:
New Comment:
-Status: Assigned
+Status: Closed
This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2010-08-07 17:21:33] dufuz
If you use the upgrade command, it would in fact clean it out; And
installation
assumes there is no earlier incarnation of the package and it's quite
clearly shown by
the fact that you can't install another version of the package unless
you use the force
option; An upgrade would be the proper one to use...
I can look into hooking up the same cleaning procedures into the
installation process
but it might just add extra overhead to a usage scenario that should not
really happen
- It might be an idea tho to pass the installation command off to
upgrade if installation
detects the package has already been installed, be it with force option
or not, but at
the same time, it might give people unexpected results.
------------------------------------------------------------------------
[2010-04-29 03:07:36] dufuz
-Assigned To:
+Assigned To: dufuz
------------------------------------------------------------------------
[2010-04-28 09:16:13] timj
Second package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<package version="2.0" xmlns="http://pear.php.net/dtd/package-2.0"
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
" rel="nofollow">http://pear.php.net/dtd/package-2.0.xsd">
<name>Test_Package99</name>
<channel>__uri</channel>
<summary>A test package</summary>
<description>Whatever</description>
<lead>
<name>Example User</name>
<user>example</user>
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2007-02-03</date>
<version>
<release>1.1.0</release>
<api>1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license>Foo License</license>
<notes>This is the first release.
</notes>
<contents>
<dir name="/">
<file role="php" name="test1.php" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>4.3.0</min>
</php>
<pearinstaller>
<min>1.4.0</min>
</pearinstaller>
</required>
</dependencies>
<phprelease />
</package>
------------------------------------------------------------------------
[2010-04-28 09:15:55] timj
First package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<package version="2.0" xmlns="http://pear.php.net/dtd/package-2.0"
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
" rel="nofollow">http://pear.php.net/dtd/package-2.0.xsd">
<name>Test_Package99</name>
<channel>__uri</channel>
<summary>A test package</summary>
<description>Whatever</description>
<lead>
<name>Example User</name>
<user>example</user>
<email>[email protected]</email>
<active>yes</active>
</lead>
<date>2007-02-03</date>
<version>
<release>1.0.0</release>
<api>1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license>Foo License</license>
<notes>This is the first release.
</notes>
<contents>
<dir name="/">
<file role="php" name="test1.php" />
<file role="php" name="test2.php" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>4.3.0</min>
</php>
<pearinstaller>
<min>1.4.0</min>
</pearinstaller>
</required>
</dependencies>
<phprelease />
</package>
------------------------------------------------------------------------
[2010-04-28 09:14:32] timj
Description:
------------
When using "pear install --force" to install a different version of
package which is already installed, any files existing in the original
version but not in the version being force-installed are not removed.
Test script:
---------------
See attached package.xml files for two packages:
- Test_Package99-1.0.0 which has two files, test1.php and test2.php
- Test_Package99-1.1.0 which has only one file, test1.php
pear install Test_Package99-1.0.0/package2.xml
pear install -f Test_Package99-1.1.0/package2.xml
This test case is for illustration only; here, there's no reason to
force the install. The point still applied in the general case though.
Expected result:
----------------
Only one file, test1.php is in php_dir
Actual result:
--------------
Two files, test1.php and test2.php are in php_dir. test2.php is left
over from the old installation of Test_Package99-1.0.0 and is orphaned;
it will never be removed.
------------------------------------------------------------------------