]> granicus.if.org Git - php/commitdiff
- Sync, HEAD is now uptodate
authorPierre Joye <pajoye@php.net>
Fri, 27 Jun 2003 10:59:43 +0000 (10:59 +0000)
committerPierre Joye <pajoye@php.net>
Fri, 27 Jun 2003 10:59:43 +0000 (10:59 +0000)
pear/PEAR/Command/Remote.php
pear/PEAR/Registry.php
pear/package-PEAR.xml

index b3f1e14315de2d54fbc13d9dd7f601b96f347465..9d23dc73910147fba09f5ae8dc7433a378073b45 100644 (file)
@@ -334,7 +334,8 @@ parameter.
             'border' => 1,
             'headline' => array('Package', 'Version', 'Size'),
             );
-        foreach ($latest as $package => $info) {
+        foreach ($latest as $pkg => $info) {
+            $package = strtolower($pkg);
             if (!isset($inst[$package])) {
                 // skip packages we don't have installed
                 continue;
@@ -354,7 +355,7 @@ parameter.
             } else {
                 $fs = "  -"; // XXX center instead
             }
-            $data['data'][] = array($package, $version, $fs);
+            $data['data'][] = array($pkg, $version, $fs);
         }
         if (empty($data['data'])) {
             $this->ui->outputData('No upgrades available');
index 6450d202025758306853bffd0652d37df14d1608..16a9b497d4c092945c184bb42c5862519c354e98 100644 (file)
@@ -98,6 +98,18 @@ class PEAR_Registry extends PEAR
         $this->statedir = $pear_install_dir.$ds.'.registry';
         $this->filemap  = $pear_install_dir.$ds.'.filemap';
         $this->lockfile = $pear_install_dir.$ds.'.lock';
+
+        // XXX Compatibility code should be removed in the future
+        // rename all registry files if any to lowercase
+        if (!OS_WINDOWS && $handle = opendir($this->statedir)) {
+            $dest = $this->statedir . DIRECTORY_SEPARATOR;
+            while (false !== ($file = readdir($handle))) {
+                if (preg_match('/^.*[A-Z].*\.reg$/', $file)) {
+                    rename($dest . $file, $dest . strtolower($file));
+                }
+            }
+            closedir($handle);
+        }
         if (!file_exists($this->filemap)) {
             $this->rebuildFileMap();
         }
@@ -155,23 +167,7 @@ class PEAR_Registry extends PEAR
      */
     function _packageFileName($package)
     {
-        if (is_file("{$this->statedir}/{$package}.reg")) {
-            return "{$this->statedir}/{$package}.reg";
-        }
-        /**
-         * Iterate through the directory to find the matching
-         * registry file, even if it has been provided in
-         * another case (foobar vs. FooBar)
-         */
-        $package = strtolower($package);
-        if ($handle = opendir($this->statedir)) {
-            while (false !== ($file = readdir($handle))) {
-               if (strtolower($file) == $package . ".reg") {
-                   return "{$this->statedir}/{$file}";
-               }
-            }
-            closedir($handle);
-        }
+        return $this->statedir . DIRECTORY_SEPARATOR . strtolower($package) . '.reg';
     }
 
     // }}}
index f76e9d2d5cc9bc1e1ddfeae7142a7add1c3a1e9c..5aa793ba18e80066da4ebf3b1b86905a59e3a0d3 100644 (file)
     </maintainer>
   </maintainers>
   <release>
-    <version>1.2</version>
-    <state>stable</state>
-    <date>2003-01-10</date>
+    <version>1.2b2</version>
+    <state>beta</state>
+    <date>2003-06-23</date>
     <notes>
 * Changed license from PHP 2.02 to 3.0
 * Added support for optional dependencies
+* Made upgrade and uninstall package case insensitive
 * pear makerpm, now works and generates a better system independant spec file
 * pear install|build &lt;pecl-package&gt;, now exposes the compilation progress
 * Added new pear bundle command, which downloads and uncompress a &lt;pecl-package&gt;.