summaryrefslogtreecommitdiff
blob: 5ed7f1cfbc5c975a41cf75552b33ec8d0fa0ec29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- PEAR-1.4.6/PEAR/Installer.php	2006/01/06 04:47:36	1.224
+++ PEAR-1.4.6/PEAR/Installer.php	2006/01/16 12:24:23	1.225
@@ -1329,7 +1329,11 @@
             }
             $dest = $ext['dest'];
             $this->log(1, "Installing '$ext[file]'");
-            $copyto = $this->_prependPath($dest, $this->installroot);
+            $packagingroot = '';
+            if (isset($this->_options['packagingroot'])) {
+                $packagingroot = $this->_options['packagingroot'];
+            }
+            $copyto = $this->_prependPath($dest, $packagingroot);
             $copydir = dirname($copyto);
             if (!@is_dir($copydir)) {
                 if (!$this->mkDirHier($copydir)) {
--- PEAR-1.4.6/PEAR/Command/Install.php	2006/01/06 04:47:36	1.112
+++ PEAR-1.4.6/PEAR/Command/Install.php	2006/01/16 12:24:23	1.113
@@ -543,16 +543,19 @@
                     $reg = &$this->config->getRegistry();
                 }
                 $pkg = &$reg->getPackage($param->getPackage(), $param->getChannel());
-                $pkg->setConfig($this->config);
-                if ($list = $pkg->listPostinstallScripts()) {
-                    $pn = $reg->parsedPackageNameToString(array('channel' =>
-                        $param->getChannel(), 'package' => $param->getPackage()), true);
-                    $extrainfo[] = $pn . ' has post-install scripts:';
-                    foreach ($list as $file) {
-                        $extrainfo[] = $file;
+                // $pkg may be NULL if install is a 'fake' install via --packagingroot
+                if (is_object($pkg)) {
+                    $pkg->setConfig($this->config);
+                    if ($list = $pkg->listPostinstallScripts()) {
+                        $pn = $reg->parsedPackageNameToString(array('channel' =>
+                           $param->getChannel(), 'package' => $param->getPackage()), true);
+                        $extrainfo[] = $pn . ' has post-install scripts:';
+                        foreach ($list as $file) {
+                            $extrainfo[] = $file;
+                        }
+                        $extrainfo[] = 'Use "pear run-scripts ' . $pn . '" to run';
+                        $extrainfo[] = 'DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES';
                     }
-                    $extrainfo[] = 'Use "pear run-scripts ' . $pn . '" to run';
-                    $extrainfo[] = 'DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES';
                 }
             } else {
                 return $this->raiseError("$command failed");