mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-01 09:28:22 +01:00
Add more status checks for binaries
Summary: Expands on D7488, which looks way better than the config checks. I'm leaving the config checks for now, but maybe we should just get rid of them? This advice is delivered in a far more timely way. - Check for normal VCS binaries too. - Link to `environment.append-paths`. - Get rid of untranslated names (I think they're probably not too useful?) Test Plan: See screenshots. Reviewers: hach-que, btrahan Reviewed By: hach-que CC: aran Differential Revision: https://secure.phabricator.com/D7495
This commit is contained in:
parent
10659ece8e
commit
9d069963ed
1 changed files with 52 additions and 34 deletions
|
@ -597,61 +597,79 @@ final class DiffusionRepositoryEditMainController
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$binaries = array();
|
||||||
|
switch ($repository->getVersionControlSystem()) {
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
|
$binaries[] = 'git';
|
||||||
|
break;
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
|
$binaries[] = 'svn';
|
||||||
|
break;
|
||||||
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
|
$binaries[] = 'hg';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ($repository->isHosted()) {
|
if ($repository->isHosted()) {
|
||||||
$binaries = array();
|
|
||||||
if ($repository->getServeOverHTTP() != PhabricatorRepository::SERVE_OFF) {
|
if ($repository->getServeOverHTTP() != PhabricatorRepository::SERVE_OFF) {
|
||||||
switch ($repository->getVersionControlSystem()) {
|
switch ($repository->getVersionControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
$binaries['Git HTTP serve'] = 'git-http-backend';
|
$binaries[] = 'git-http-backend';
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
$binaries['SVN serve'] = 'svnserve';
|
$binaries[] = 'svnserve';
|
||||||
$binaries['SVN admin'] = 'svnadmin';
|
$binaries[] = 'svnadmin';
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
$binaries['Mercurial'] = 'hg';
|
$binaries[] = 'hg';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($repository->getServeOverSSH() != PhabricatorRepository::SERVE_OFF) {
|
if ($repository->getServeOverSSH() != PhabricatorRepository::SERVE_OFF) {
|
||||||
switch ($repository->getVersionControlSystem()) {
|
switch ($repository->getVersionControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
$binaries['Git SSH receive'] = 'git-receive-pack';
|
$binaries[] = 'git-receive-pack';
|
||||||
$binaries['Git SSH upload'] = 'git-upload-pack';
|
$binaries[] = 'git-upload-pack';
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||||
$binaries['SVN serve'] = 'svnserve';
|
$binaries[] = 'svnserve';
|
||||||
$binaries['SVN admin'] = 'svnadmin';
|
$binaries[] = 'svnadmin';
|
||||||
break;
|
break;
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:
|
||||||
$binaries['Mercurial'] = 'hg';
|
$binaries[] = 'hg';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$binaries = array_unique($binaries);
|
}
|
||||||
foreach ($binaries as $name => $binary) {
|
|
||||||
if (!Filesystem::binaryExists($binary)) {
|
$binaries = array_unique($binaries);
|
||||||
$view->addItem(
|
foreach ($binaries as $binary) {
|
||||||
id(new PHUIStatusItemView())
|
$where = Filesystem::resolveBinary($binary);
|
||||||
->setIcon('warning-red')
|
if (!$where) {
|
||||||
->setTarget(pht(
|
$config_href = '/config/edit/environment.append-paths/';
|
||||||
'%s tool not found in PATH',
|
$config_link = phutil_tag(
|
||||||
$name))
|
'a',
|
||||||
->setNote(pht(
|
array(
|
||||||
'You may need to configure %s.',
|
'href' => $config_href,
|
||||||
phutil_tag('tt', array(), 'environment.append-paths'))));
|
),
|
||||||
} else {
|
'environment.append-paths');
|
||||||
$view->addItem(
|
|
||||||
id(new PHUIStatusItemView())
|
$view->addItem(
|
||||||
->setIcon('accept-green')
|
id(new PHUIStatusItemView())
|
||||||
->setTarget(pht(
|
->setIcon('warning-red')
|
||||||
'%s tool found',
|
->setTarget(
|
||||||
$name))
|
pht('Missing Binary %s', phutil_tag('tt', array(), $binary)))
|
||||||
->setNote(phutil_tag(
|
->setNote(pht(
|
||||||
'tt',
|
"Unable to find this binary in the webserver's PATH. You may ".
|
||||||
array(),
|
"need to configure %s.",
|
||||||
Filesystem::resolveBinary($binary))));
|
$config_link)));
|
||||||
}
|
} else {
|
||||||
|
$view->addItem(
|
||||||
|
id(new PHUIStatusItemView())
|
||||||
|
->setIcon('accept-green')
|
||||||
|
->setTarget(
|
||||||
|
pht('Found Binary %s', phutil_tag('tt', array(), $binary)))
|
||||||
|
->setNote(phutil_tag('tt', array(), $where)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue