if (isset($options['f'])) {
$opts['force'] = true;
}
- // The ['force'] and ['nodeps'] options are still missing
+ // XXX The ['nodeps'] option is still missing
if ($installer->install(@$params[0], $opts, $this->config)) {
$this->ui->displayLine("install ok");
} else {
// Register that the package is installed -----------------------
if (empty($options['upgrade'])) {
+ // if 'force' is used, replace the info in registry
+ if (!empty($options['force']) && $this->registry->packageExists($pkgname)) {
+ $this->registry->deletePackage($pkgname);
+ }
$ret = $this->registry->addPackage($pkgname, $this->pkginfo);
} else {
$ret = $this->registry->updatePackage($pkgname, $this->pkginfo, false);
// XXX does not check type of lock (LOCK_SH/LOCK_EX)
return true;
}
+ $php_dir = dirname($this->lockfile);
+ if (!@is_dir($php_dir) && !System::mkDir("-p $php_dir")) {
+ return false;
+ }
$this->lock_fp = @fopen($this->lockfile, "w");
if (!is_resource($this->lock_fp)) {
return null;
$cmdopts = array();
foreach ($opts as $opt) {
- $param = !empty($opt[1]) ? $opt[1] : null;
+ $param = !empty($opt[1]) ? $opt[1] : true;
switch ($opt[0]) {
case 'd':
list($key, $value) = explode('=', $param);