summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www-client/arcanist/Manifest9
-rw-r--r--www-client/arcanist/arcanist-20160701.ebuild4
-rw-r--r--www-client/arcanist/arcanist-20161021.ebuild146
-rw-r--r--www-client/arcanist/arcanist-9999.ebuild5
-rw-r--r--www-client/arcanist/files/20161021-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch45
-rw-r--r--www-client/arcanist/files/20161021-MINOR-Disable-self-upgrade.patch149
-rw-r--r--www-client/arcanist/files/9999-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch45
-rw-r--r--www-client/arcanist/files/9999-MINOR-Disable-self-upgrade.patch149
8 files changed, 545 insertions, 7 deletions
diff --git a/www-client/arcanist/Manifest b/www-client/arcanist/Manifest
index ae2cf7fc..e453b957 100644
--- a/www-client/arcanist/Manifest
+++ b/www-client/arcanist/Manifest
@@ -1,3 +1,8 @@
-EBUILD arcanist-20160701.ebuild 3812 SHA256 824ac6987685ab3ad40176075a9fae5cf1e81bf1e269450b7598451bb26faa64 WHIRLPOOL e8a15d6c76e329dfc76c40979496324cabb9d92404246c66d895baa4fdd14777aff9062bb5abce83dcc9eb04da020298f0fddc6b06d64f6a3dafed459824dc46
-EBUILD arcanist-9999.ebuild 3724 SHA256 6c66d053b89496b860c0614d7d93bb04b7c98377d84266603c525a4420ad19a5 WHIRLPOOL 7943d84cd410304eefbbfedb027b81ff7f9e637116c7d2e330bcc8175b4e25dc6283c4b5fa2771dfebb45805a8affcd10efcc8d242f61c28c75c285aa9cd2754
+AUX 20161021-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch 1840 SHA256 cdb6ed7cd2f3c963ef6c18cef1877d2478b20033948c31768474b5a21ba03840 WHIRLPOOL c86e137af62d75e68a3d20af58237a3fa372ec5d23d128a44f8e58cdc9c67fdd4d18a188314805e60fc81d7e0561a7f9883480dd599300855f1cb9192137eac9
+AUX 20161021-MINOR-Disable-self-upgrade.patch 5628 SHA256 5cfd9add03275bfc916df9e2d8215937bd870f97befd388de895ec498761a75d WHIRLPOOL a5ba1d0ae9a40166204625f35c7192ab1185ab468f4dac01efcab9ad037344c6cfc80c74c6c760e08addf8c6083369e0a82fda7c3497106f87768a5431a1d178
+AUX 9999-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch 1840 SHA256 39e2ed2f9670fd4b450fdb56389199bcad6b5c5df8bac3a876765fbf511a0e2e WHIRLPOOL e11bdac8794439a5a2d80462cb10e86f420363e501e08a298cab9382134a1b9bfecc2fcca355c00da8af0b29675bdf313a3ced2fae52ae41ea0b32594df3d1bd
+AUX 9999-MINOR-Disable-self-upgrade.patch 5628 SHA256 1967de8934f632e79d3fd8fb9cd12ba0ccc6f789542a2ecec3eb8f6f77a83dfd WHIRLPOOL 0d13e6876d2f59b7e7025b34cb3ee9268f72e08c06db000c37b9a2c80a2d7ee4fc116b0244f699eae2e6b96a245bb18cf82ad29ae73e07752ab5becd0c259257
+EBUILD arcanist-20160701.ebuild 3776 SHA256 41cb3f9eca3770e72ee6b43f1c30120d38ac2fe486ea941649cfc2fd67f371a4 WHIRLPOOL 22d6ada6a914144f961eab96c0cb178d4bd919330790a5200dbcf7f17278a61e2afe4bd234fba00d44f2095d05bf49ab45a1769bd33a8bd00d4d7ea01aa02bc5
+EBUILD arcanist-20161021.ebuild 3925 SHA256 5ca1097b974f248cf8b62cc2f42275a0593d980f7183e966caf3b18f031e9009 WHIRLPOOL 3af0f01eea27b45d45cb3ad43ed6d0979e0d5f5906dc472132e6f0c8ec748bdad7180eb19f141b304862467ec105374cee1aab5254e6814aa74944c27565db92
+EBUILD arcanist-9999.ebuild 3834 SHA256 759c9a1b68690ecedefef1a4b0741555fd59b4f52d74312b2a46a985cef820f8 WHIRLPOOL 5ae96631cd25816b0fafb741356e293a744ffa3eedc3aec1e0f4a9c86186493c356432ae59b8230435fcce1284f676fde2e42dd0d8c08cf4b739ecc4426120d3
MISC metadata.xml 466 SHA256 e8c4c077e1e6b6cf074cea25fd43f0b0774e0f3b149d9f9c12262f716430a518 WHIRLPOOL 213ad10f180ddb9c808036e98e2cf72971c0cb702ed4d1cc2fb6679e24f86099529d727eb863fafc540574ddaabf5f4ba8f1708d8e4efb40ca31beed2d5abd38
diff --git a/www-client/arcanist/arcanist-20160701.ebuild b/www-client/arcanist/arcanist-20160701.ebuild
index 7a53502f..4143c6d0 100644
--- a/www-client/arcanist/arcanist-20160701.ebuild
+++ b/www-client/arcanist/arcanist-20160701.ebuild
@@ -17,18 +17,16 @@ EGIT_COMMIT="f1c45a3323ae20eefe29c0a22c7923fe8b151bbf"
LICENSE="Apache-2.0"
SLOT="0"
-KEYWORDS="~amd64"
+KEYWORDS="amd64 x86"
IUSE="git lint mercurial subversion ssl test"
REQUIRED_USE="test? ( lint )"
DEPEND="virtual/awk:0
test? (
>=dev-lang/php-5.2.3:*[xmlwriter]
- <dev-lang/php-7:*
=dev-php/libphutil-20160709:0[test]
)"
RDEPEND=">=dev-lang/php-5.2.3:*[cli,curl,json,ssl?]
- <dev-lang/php-7:*
=dev-php/libphutil-20160709:0[ssl?]
git? ( dev-vcs/git:0 )
mercurial? ( dev-vcs/mercurial:0 )
diff --git a/www-client/arcanist/arcanist-20161021.ebuild b/www-client/arcanist/arcanist-20161021.ebuild
new file mode 100644
index 00000000..850cf342
--- /dev/null
+++ b/www-client/arcanist/arcanist-20161021.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ncurses"
+
+inherit bash-completion-r1 python-single-r1 git-r3
+
+DESCRIPTION="Command-line tool for Phabricator"
+HOMEPAGE="https://www.phacility.com"
+EGIT_REPO_URI="git://github.com/phacility/arcanist.git"
+EGIT_BRANCH="stable"
+EGIT_COMMIT="e17fe43ca3fe6dc6dd0b5ce056f56310ea1d3d51"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="git lint mercurial subversion ssl test"
+REQUIRED_USE="test? ( lint )"
+
+DEPEND="virtual/awk:0
+ test? (
+ >=dev-lang/php-5.2.3:*[xmlwriter]
+ =dev-php/libphutil-20161209:0[test]
+ )"
+RDEPEND=">=dev-lang/php-5.2.3:*[cli,curl,json,ssl?]
+ =dev-php/libphutil-20161209:0[ssl?]
+ git? ( dev-vcs/git:0 )
+ mercurial? ( dev-vcs/mercurial:0 )
+ subversion? ( dev-vcs/subversion:0 )
+ lint? (
+ app-admin/puppet-lint:0
+ dev-haskell/hlint:0
+ dev-php/PHP_CodeSniffer:0
+ dev-python/pylint:0[${PYTHON_USEDEP}]
+ dev-python/flake8:0[${PYTHON_USEDEP}]
+ dev-util/cppcheck:0
+ dev-util/cpplint:0
+ net-libs/nodejs:0[npm]
+ )"
+
+src_test() {
+ einfo "Note that you need to install some Node JS script manually:"
+ einfo " npm install -g coffeelint"
+ einfo " npm install -g csslint"
+ einfo " npm install -g jscs"
+ einfo " npm install -g jshint"
+ einfo " npm install -g jsonlint"
+ einfo " npm install -g less"
+
+ local GIT_NAME="${FUNCNAME} for ${CATEGORY}/${PF}"
+ local GIT_EMAIL="portage@localhost"
+
+ export GIT_AUTHOR_NAME="${GIT_NAME}"
+ export GIT_AUTHOR_EMAIL="${GIT_EMAIL}"
+
+ export GIT_COMMITTER_NAME="${GIT_NAME}"
+ export GIT_COMMITTER_EMAIL="${GIT_EMAIL}"
+
+ # Unable to locate binary "golint" to run linter ArcanistGoLintLinter. You may need to install the binary, or adjust your linter configuration.
+ # TO INSTALL: Install Golint using `go get github.com/golang/lint/golint`.
+
+ # Set config in .git/arc/config for ArcanistPyLintLinter
+ bin/arc set-config --local lint.pylint.codes.advice '^(C|R).*' > /dev/null
+ bin/arc set-config --local lint.pylint.codes.error '^(E|F).*' > /dev/null
+ bin/arc set-config --local lint.pylint.codes.warning '^W.*' > /dev/null
+
+ # + https://secure.phabricator.com/T7170
+
+ bin/arc unit --everything --no-coverage || die "arc unit failed"
+}
+
+src_prepare() {
+ default
+
+ git log --format='%H %ct' -n 1 > "${S}/GIT_COMMIT_INFO"
+
+ epatch "${FILESDIR}/${PV}-MINOR-Disable-self-upgrade.patch"
+ epatch "${FILESDIR}/${PV}-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch"
+
+ find "${S}" -type f -name .gitignore -print0 \
+ | xargs -0 --no-run-if-empty -- \
+ rm
+
+ rm bin/*.bat
+
+ # Replace 'env' shebang to files it point to
+ find "${S}" -type f \
+ | sort \
+ | xargs -n 1 --no-run-if-empty -- \
+ awk 'NR == 1 && /^#!\/usr\/bin\/env/ {print FILENAME}' \
+ | while read ; do
+ set -- $(sed -ne '1 s:^#!\([^ ]*\) ::p;q' ${REPLY})
+ cmd="$1" ; shift ; args="$@"
+
+ case "${cmd}" in
+ bash|php) ;;
+ *) continue ;;
+ esac
+
+ path="$(type -p ${cmd})" || continue
+ [[ -z "${path}" ]] && continue
+
+ einfo "Replace ${REPLY/#${S}\/} shebang to #!${path} ${args}"
+ sed -i \
+ -e "1 s:^#!.*:#!${path} ${args}:" \
+ "${REPLY}"
+ eend $?
+ done
+}
+
+src_install() {
+ newbashcomp resources/shell/bash-completion "arc"
+
+ insinto "/usr/share/${PN}"
+ doins GIT_COMMIT_INFO
+
+ insinto "/usr/share/php/${PN}"
+ doins -r bin externals resources scripts src
+
+ python_scriptinto "/usr/share/php/${PN}/scripts"
+ python_doscript scripts/breakout.py
+
+ # Make executable all shebanged files
+ find "${ED}" -type f \
+ | xargs -n 1 --no-run-if-empty -- \
+ awk 'NR == 1 && /^#!/ {print FILENAME}' \
+ | sed -e "s:${ED}:/:" \
+ | xargs --no-run-if-empty -- \
+ fperms 755
+
+ dosym "/usr/share/php/${PN}/bin/arc" /usr/bin/arc
+
+ dodoc NOTICE README.md
+}
+
+pkg_postinst() {
+ if use lint; then
+ elog
+ elog "Some linter need external NodeJS script. To install them, use:"
+ elog " npm install -g csslint"
+ fi
+}
diff --git a/www-client/arcanist/arcanist-9999.ebuild b/www-client/arcanist/arcanist-9999.ebuild
index 97e9303a..298167e4 100644
--- a/www-client/arcanist/arcanist-9999.ebuild
+++ b/www-client/arcanist/arcanist-9999.ebuild
@@ -22,11 +22,9 @@ REQUIRED_USE="test? ( lint )"
DEPEND="virtual/awk:0
test? (
>=dev-lang/php-5.2.3:*[xmlwriter]
- <dev-lang/php-7:*
=dev-php/libphutil-${PV}:0[test]
)"
RDEPEND=">=dev-lang/php-5.2.3:*[cli,curl,json,ssl?]
- <dev-lang/php-7:*
=dev-php/libphutil-${PV}:0[ssl?]
git? ( dev-vcs/git:0 )
mercurial? ( dev-vcs/mercurial:0 )
@@ -78,6 +76,9 @@ src_prepare() {
git log --format='%H %ct' -n 1 > "${S}/GIT_COMMIT_INFO"
+ epatch "${FILESDIR}/${PV}-MINOR-Disable-self-upgrade.patch"
+ epatch "${FILESDIR}/${PV}-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch"
+
find "${S}" -type f -name .gitignore -print0 \
| xargs -0 --no-run-if-empty -- \
rm
diff --git a/www-client/arcanist/files/20161021-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch b/www-client/arcanist/files/20161021-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch
new file mode 100644
index 00000000..de7961a1
--- /dev/null
+++ b/www-client/arcanist/files/20161021-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch
@@ -0,0 +1,45 @@
+From 55030461656fc2789c28c8a4d0272bc349d29d4d Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sun, 18 Dec 2016 01:59:52 +0000
+Subject: [PATCH] MEDIUM: Get VERSION for files in
+ /usr/share/<PN>/GIT_COMMIT_INFO rather than from git
+
+---
+ src/workflow/ArcanistVersionWorkflow.php | 19 +++++++------------
+ 1 file changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/src/workflow/ArcanistVersionWorkflow.php b/src/workflow/ArcanistVersionWorkflow.php
+index 807c573275bf..fefd972786dc 100644
+--- a/src/workflow/ArcanistVersionWorkflow.php
++++ b/src/workflow/ArcanistVersionWorkflow.php
+@@ -35,23 +35,18 @@ EOTEXT
+ }
+
+ $roots = array(
+- 'arcanist' => dirname(phutil_get_library_root('arcanist')),
+- 'libphutil' => dirname(phutil_get_library_root('phutil')),
++ 'arcanist',
++ 'libphutil'
+ );
+
+- foreach ($roots as $lib => $root) {
+- $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
+- $configuration_manager = clone $this->getConfigurationManager();
+- $configuration_manager->setWorkingCopyIdentity($working_copy);
+- $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
+- $configuration_manager);
+-
+- if (!Filesystem::pathExists($repository->getMetadataPath())) {
++ foreach ($roots as $lib) {
++ $commit_info = "/usr/share/" . $lib . "/GIT_COMMIT_INFO";
++ if (!Filesystem::pathExists($commit_info)) {
+ throw new ArcanistUsageException(
+- pht('%s is not a git working copy.', $lib));
++ pht('%s has no version registered in %s.', $lib, $commit_info));
+ }
+
+- list($stdout) = $repository->execxLocal('log -1 --format=%s', '%H %ct');
++ $stdout = file_get_contents($commit_info);
+ list($commit, $timestamp) = explode(' ', $stdout);
+
+ $console->writeOut(
diff --git a/www-client/arcanist/files/20161021-MINOR-Disable-self-upgrade.patch b/www-client/arcanist/files/20161021-MINOR-Disable-self-upgrade.patch
new file mode 100644
index 00000000..842f9342
--- /dev/null
+++ b/www-client/arcanist/files/20161021-MINOR-Disable-self-upgrade.patch
@@ -0,0 +1,149 @@
+From 9872f11c49000c9ee30503489df4ba271deef66f Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sun, 18 Dec 2016 02:15:13 +0000
+Subject: [PATCH] MINOR: Disable self upgrade
+
+---
+ src/__phutil_library_map__.php | 2 -
+ src/workflow/ArcanistUpgradeWorkflow.php | 112 -------------------------------
+ 2 files changed, 114 deletions(-)
+ delete mode 100644 src/workflow/ArcanistUpgradeWorkflow.php
+
+diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
+index d8f10dd401a7..af9c8ef7e056 100644
+--- a/src/__phutil_library_map__.php
++++ b/src/__phutil_library_map__.php
+@@ -381,7 +381,6 @@ phutil_register_library_map(array(
+ 'ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase.php',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase.php',
+- 'ArcanistUpgradeWorkflow' => 'workflow/ArcanistUpgradeWorkflow.php',
+ 'ArcanistUploadWorkflow' => 'workflow/ArcanistUploadWorkflow.php',
+ 'ArcanistUsageException' => 'exception/ArcanistUsageException.php',
+ 'ArcanistUseStatementNamespacePrefixXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUseStatementNamespacePrefixXHPASTLinterRule.php',
+@@ -795,7 +794,6 @@ phutil_register_library_map(array(
+ 'ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
+- 'ArcanistUpgradeWorkflow' => 'ArcanistWorkflow',
+ 'ArcanistUploadWorkflow' => 'ArcanistWorkflow',
+ 'ArcanistUsageException' => 'Exception',
+ 'ArcanistUseStatementNamespacePrefixXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
+diff --git a/src/workflow/ArcanistUpgradeWorkflow.php b/src/workflow/ArcanistUpgradeWorkflow.php
+deleted file mode 100644
+index 50449ef75f27..000000000000
+--- a/src/workflow/ArcanistUpgradeWorkflow.php
++++ /dev/null
+@@ -1,112 +0,0 @@
+-<?php
+-
+-/**
+- * Upgrade arcanist itself.
+- */
+-final class ArcanistUpgradeWorkflow extends ArcanistWorkflow {
+-
+- public function getWorkflowName() {
+- return 'upgrade';
+- }
+-
+- public function getCommandSynopses() {
+- return phutil_console_format(<<<EOTEXT
+- **upgrade**
+-EOTEXT
+- );
+- }
+-
+- public function getCommandHelp() {
+- return phutil_console_format(<<<EOTEXT
+- Supports: cli
+- Upgrade arcanist and libphutil to the latest versions.
+-EOTEXT
+- );
+- }
+-
+- public function run() {
+- $roots = array(
+- 'libphutil' => dirname(phutil_get_library_root('phutil')),
+- 'arcanist' => dirname(phutil_get_library_root('arcanist')),
+- );
+-
+- foreach ($roots as $lib => $root) {
+- echo phutil_console_format(
+- "%s\n",
+- pht('Upgrading %s...', $lib));
+-
+- $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
+- $configuration_manager = clone $this->getConfigurationManager();
+- $configuration_manager->setWorkingCopyIdentity($working_copy);
+- $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
+- $configuration_manager);
+-
+- if (!Filesystem::pathExists($repository->getMetadataPath())) {
+- throw new ArcanistUsageException(
+- pht(
+- "%s must be in its git working copy to be automatically upgraded. ".
+- "This copy of %s (in '%s') is not in a git working copy.",
+- $lib,
+- $lib,
+- $root));
+- }
+-
+- $this->setRepositoryAPI($repository);
+-
+- // NOTE: Don't use requireCleanWorkingCopy() here because it tries to
+- // amend changes and generally move the workflow forward. We just want to
+- // abort if there are local changes and make the user sort things out.
+- $uncommitted = $repository->getUncommittedStatus();
+- if ($uncommitted) {
+- $message = pht(
+- 'You have uncommitted changes in the working copy for this '.
+- 'library:');
+-
+- $list = id(new PhutilConsoleList())
+- ->setWrap(false)
+- ->addItems(array_keys($uncommitted));
+-
+- id(new PhutilConsoleBlock())
+- ->addParagraph($message)
+- ->addList($list)
+- ->draw();
+-
+- throw new ArcanistUsageException(
+- pht('`arc upgrade` can only upgrade clean working copies.'));
+- }
+-
+- $branch_name = $repository->getBranchName();
+- if ($branch_name != 'master' && $branch_name != 'stable') {
+- throw new ArcanistUsageException(
+- pht(
+- "%s must be on either branch '%s' or '%s' to be automatically ".
+- "upgraded. ".
+- "This copy of %s (in '%s') is on branch '%s'.",
+- $lib,
+- 'master',
+- 'stable',
+- $lib,
+- $root,
+- $branch_name));
+- }
+-
+- chdir($root);
+-
+- try {
+- execx('git pull --rebase');
+- } catch (Exception $ex) {
+- // If we failed, try to go back to the old state, then throw the
+- // original exception.
+- exec_manual('git rebase --abort');
+- throw $ex;
+- }
+- }
+-
+- echo phutil_console_format(
+- "**%s** %s\n",
+- pht('Updated!'),
+- pht('Your copy of arc is now up to date.'));
+- return 0;
+- }
+-
+-}
diff --git a/www-client/arcanist/files/9999-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch b/www-client/arcanist/files/9999-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch
new file mode 100644
index 00000000..2630aaea
--- /dev/null
+++ b/www-client/arcanist/files/9999-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch
@@ -0,0 +1,45 @@
+From 7b721630b50d554cbe38242db074667497f9731f Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sun, 18 Dec 2016 01:59:52 +0000
+Subject: [PATCH] MEDIUM: Get VERSION for files in
+ /usr/share/<PN>/GIT_COMMIT_INFO rather than from git
+
+---
+ src/workflow/ArcanistVersionWorkflow.php | 19 +++++++------------
+ 1 file changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/src/workflow/ArcanistVersionWorkflow.php b/src/workflow/ArcanistVersionWorkflow.php
+index 807c573275bf..fefd972786dc 100644
+--- a/src/workflow/ArcanistVersionWorkflow.php
++++ b/src/workflow/ArcanistVersionWorkflow.php
+@@ -35,23 +35,18 @@ EOTEXT
+ }
+
+ $roots = array(
+- 'arcanist' => dirname(phutil_get_library_root('arcanist')),
+- 'libphutil' => dirname(phutil_get_library_root('phutil')),
++ 'arcanist',
++ 'libphutil'
+ );
+
+- foreach ($roots as $lib => $root) {
+- $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
+- $configuration_manager = clone $this->getConfigurationManager();
+- $configuration_manager->setWorkingCopyIdentity($working_copy);
+- $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
+- $configuration_manager);
+-
+- if (!Filesystem::pathExists($repository->getMetadataPath())) {
++ foreach ($roots as $lib) {
++ $commit_info = "/usr/share/" . $lib . "/GIT_COMMIT_INFO";
++ if (!Filesystem::pathExists($commit_info)) {
+ throw new ArcanistUsageException(
+- pht('%s is not a git working copy.', $lib));
++ pht('%s has no version registered in %s.', $lib, $commit_info));
+ }
+
+- list($stdout) = $repository->execxLocal('log -1 --format=%s', '%H %ct');
++ $stdout = file_get_contents($commit_info);
+ list($commit, $timestamp) = explode(' ', $stdout);
+
+ $console->writeOut(
diff --git a/www-client/arcanist/files/9999-MINOR-Disable-self-upgrade.patch b/www-client/arcanist/files/9999-MINOR-Disable-self-upgrade.patch
new file mode 100644
index 00000000..dee1e416
--- /dev/null
+++ b/www-client/arcanist/files/9999-MINOR-Disable-self-upgrade.patch
@@ -0,0 +1,149 @@
+From e8c95ddafbffef8991b4f4eed93343d75ffc4200 Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sun, 18 Dec 2016 02:15:13 +0000
+Subject: [PATCH] MINOR: Disable self upgrade
+
+---
+ src/__phutil_library_map__.php | 2 -
+ src/workflow/ArcanistUpgradeWorkflow.php | 112 -------------------------------
+ 2 files changed, 114 deletions(-)
+ delete mode 100644 src/workflow/ArcanistUpgradeWorkflow.php
+
+diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
+index d8f10dd401a7..af9c8ef7e056 100644
+--- a/src/__phutil_library_map__.php
++++ b/src/__phutil_library_map__.php
+@@ -381,7 +381,6 @@ phutil_register_library_map(array(
+ 'ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase.php',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase.php',
+- 'ArcanistUpgradeWorkflow' => 'workflow/ArcanistUpgradeWorkflow.php',
+ 'ArcanistUploadWorkflow' => 'workflow/ArcanistUploadWorkflow.php',
+ 'ArcanistUsageException' => 'exception/ArcanistUsageException.php',
+ 'ArcanistUseStatementNamespacePrefixXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUseStatementNamespacePrefixXHPASTLinterRule.php',
+@@ -795,7 +794,6 @@ phutil_register_library_map(array(
+ 'ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
+ 'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
+- 'ArcanistUpgradeWorkflow' => 'ArcanistWorkflow',
+ 'ArcanistUploadWorkflow' => 'ArcanistWorkflow',
+ 'ArcanistUsageException' => 'Exception',
+ 'ArcanistUseStatementNamespacePrefixXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
+diff --git a/src/workflow/ArcanistUpgradeWorkflow.php b/src/workflow/ArcanistUpgradeWorkflow.php
+deleted file mode 100644
+index 50449ef75f27..000000000000
+--- a/src/workflow/ArcanistUpgradeWorkflow.php
++++ /dev/null
+@@ -1,112 +0,0 @@
+-<?php
+-
+-/**
+- * Upgrade arcanist itself.
+- */
+-final class ArcanistUpgradeWorkflow extends ArcanistWorkflow {
+-
+- public function getWorkflowName() {
+- return 'upgrade';
+- }
+-
+- public function getCommandSynopses() {
+- return phutil_console_format(<<<EOTEXT
+- **upgrade**
+-EOTEXT
+- );
+- }
+-
+- public function getCommandHelp() {
+- return phutil_console_format(<<<EOTEXT
+- Supports: cli
+- Upgrade arcanist and libphutil to the latest versions.
+-EOTEXT
+- );
+- }
+-
+- public function run() {
+- $roots = array(
+- 'libphutil' => dirname(phutil_get_library_root('phutil')),
+- 'arcanist' => dirname(phutil_get_library_root('arcanist')),
+- );
+-
+- foreach ($roots as $lib => $root) {
+- echo phutil_console_format(
+- "%s\n",
+- pht('Upgrading %s...', $lib));
+-
+- $working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
+- $configuration_manager = clone $this->getConfigurationManager();
+- $configuration_manager->setWorkingCopyIdentity($working_copy);
+- $repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
+- $configuration_manager);
+-
+- if (!Filesystem::pathExists($repository->getMetadataPath())) {
+- throw new ArcanistUsageException(
+- pht(
+- "%s must be in its git working copy to be automatically upgraded. ".
+- "This copy of %s (in '%s') is not in a git working copy.",
+- $lib,
+- $lib,
+- $root));
+- }
+-
+- $this->setRepositoryAPI($repository);
+-
+- // NOTE: Don't use requireCleanWorkingCopy() here because it tries to
+- // amend changes and generally move the workflow forward. We just want to
+- // abort if there are local changes and make the user sort things out.
+- $uncommitted = $repository->getUncommittedStatus();
+- if ($uncommitted) {
+- $message = pht(
+- 'You have uncommitted changes in the working copy for this '.
+- 'library:');
+-
+- $list = id(new PhutilConsoleList())
+- ->setWrap(false)
+- ->addItems(array_keys($uncommitted));
+-
+- id(new PhutilConsoleBlock())
+- ->addParagraph($message)
+- ->addList($list)
+- ->draw();
+-
+- throw new ArcanistUsageException(
+- pht('`arc upgrade` can only upgrade clean working copies.'));
+- }
+-
+- $branch_name = $repository->getBranchName();
+- if ($branch_name != 'master' && $branch_name != 'stable') {
+- throw new ArcanistUsageException(
+- pht(
+- "%s must be on either branch '%s' or '%s' to be automatically ".
+- "upgraded. ".
+- "This copy of %s (in '%s') is on branch '%s'.",
+- $lib,
+- 'master',
+- 'stable',
+- $lib,
+- $root,
+- $branch_name));
+- }
+-
+- chdir($root);
+-
+- try {
+- execx('git pull --rebase');
+- } catch (Exception $ex) {
+- // If we failed, try to go back to the old state, then throw the
+- // original exception.
+- exec_manual('git rebase --abort');
+- throw $ex;
+- }
+- }
+-
+- echo phutil_console_format(
+- "**%s** %s\n",
+- pht('Updated!'),
+- pht('Your copy of arc is now up to date.'));
+- return 0;
+- }
+-
+-}