From 65a9a751ee047b84091e1b0c67148076e4d1fe1d Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sat, 13 Jan 2018 19:18:03 +0000 Subject: www-client/arcanist: Version bump Package-Manager: Portage-2.3.13, Repoman-2.3.3 --- www-client/arcanist/arcanist-20170922.ebuild | 148 -------------------- www-client/arcanist/arcanist-20171226.ebuild | 148 ++++++++++++++++++++ ...VERSION-for-files-in-usr-share-PN-GIT_COM.patch | 53 -------- .../20170922-MINOR-Disable-self-upgrade.patch | 149 --------------------- ...VERSION-for-files-in-usr-share-PN-GIT_COM.patch | 53 ++++++++ .../20171226-MINOR-Disable-self-upgrade.patch | 149 +++++++++++++++++++++ 6 files changed, 350 insertions(+), 350 deletions(-) delete mode 100644 www-client/arcanist/arcanist-20170922.ebuild create mode 100644 www-client/arcanist/arcanist-20171226.ebuild delete mode 100644 www-client/arcanist/files/20170922-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch delete mode 100644 www-client/arcanist/files/20170922-MINOR-Disable-self-upgrade.patch create mode 100644 www-client/arcanist/files/20171226-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch create mode 100644 www-client/arcanist/files/20171226-MINOR-Disable-self-upgrade.patch (limited to 'www-client') diff --git a/www-client/arcanist/arcanist-20170922.ebuild b/www-client/arcanist/arcanist-20170922.ebuild deleted file mode 100644 index 0c26f606..00000000 --- a/www-client/arcanist/arcanist-20170922.ebuild +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -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="https://github.com/phacility/arcanist.git" -EGIT_BRANCH="stable" -EGIT_COMMIT="e88a8c077b3355af0f4f75fbe95d7a4b1239088b" - -LICENSE="Apache-2.0" -SLOT="stable" -KEYWORDS="~amd64 ~x86" -IUSE="git lint mercurial subversion ssl test" -REQUIRED_USE="test? ( lint )" - -DEPEND="!${CATEGORY}/${PN}:0 - virtual/awk:0 - test? ( - dev-lang/php[xmlwriter] - =dev-php/libphutil-20170929:stable[test] - )" -RDEPEND="dev-lang/php[cli,curl,json,ssl?] - =dev-php/libphutil-20170929:stable[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" - git remote add origin "${EGIT_REPO_URI}" - git remote -v > "${S}/GIT_REMOTE_INFO" - - eapply "${FILESDIR}/${PV}-MINOR-Disable-self-upgrade.patch" - eapply "${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 GIT_REMOTE_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 "../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-20171226.ebuild b/www-client/arcanist/arcanist-20171226.ebuild new file mode 100644 index 00000000..c0b8b760 --- /dev/null +++ b/www-client/arcanist/arcanist-20171226.ebuild @@ -0,0 +1,148 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +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="https://github.com/phacility/arcanist.git" +EGIT_BRANCH="stable" +EGIT_COMMIT="08674ca997b62b695f773c32f0c20e51128bc053" + +LICENSE="Apache-2.0" +SLOT="stable" +KEYWORDS="~amd64 ~x86" +IUSE="git lint mercurial subversion ssl test" +REQUIRED_USE="test? ( lint )" + +DEPEND="!${CATEGORY}/${PN}:0 + virtual/awk:0 + test? ( + dev-lang/php[xmlwriter] + =dev-php/libphutil-20171201:stable[test] + )" +RDEPEND="dev-lang/php[cli,curl,json,ssl?] + =dev-php/libphutil-20171201:stable[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" + git remote add origin "${EGIT_REPO_URI}" + git remote -v > "${S}/GIT_REMOTE_INFO" + + eapply "${FILESDIR}/${PV}-MINOR-Disable-self-upgrade.patch" + eapply "${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 GIT_REMOTE_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 "../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/files/20170922-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch b/www-client/arcanist/files/20170922-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch deleted file mode 100644 index 22542c00..00000000 --- a/www-client/arcanist/files/20170922-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 47de8ad702a8dc6797fe20d293bc4f80addda7ea Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sun, 18 Dec 2016 01:59:52 +0000 -Subject: [PATCH 1/2] MEDIUM: Get VERSION for files in - /usr/share//GIT_COMMIT_INFO rather than from git - ---- - src/workflow/ArcanistVersionWorkflow.php | 27 ++++++++------------------- - 1 file changed, 8 insertions(+), 19 deletions(-) - -diff --git a/src/workflow/ArcanistVersionWorkflow.php b/src/workflow/ArcanistVersionWorkflow.php -index 9c470fc6ea05..fefd972786dc 100644 ---- a/src/workflow/ArcanistVersionWorkflow.php -+++ b/src/workflow/ArcanistVersionWorkflow.php -@@ -35,30 +35,19 @@ 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)); - } - -- // NOTE: Carefully execute these commands in a way that works on Windows -- // until T8298 is properly fixed. See PHI52. -- -- list($commit) = $repository->execxLocal('log -1 --format=%%H'); -- $commit = trim($commit); -- -- list($timestamp) = $repository->execxLocal('log -1 --format=%%ct'); -- $timestamp = trim($timestamp); -+ $stdout = file_get_contents($commit_info); -+ list($commit, $timestamp) = explode(' ', $stdout); - - $console->writeOut( - "%s %s (%s)\n", diff --git a/www-client/arcanist/files/20170922-MINOR-Disable-self-upgrade.patch b/www-client/arcanist/files/20170922-MINOR-Disable-self-upgrade.patch deleted file mode 100644 index a405117d..00000000 --- a/www-client/arcanist/files/20170922-MINOR-Disable-self-upgrade.patch +++ /dev/null @@ -1,149 +0,0 @@ -From debf320769d3b60a6f069f9e62a76697764e5b35 Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Sun, 18 Dec 2016 02:15:13 +0000 -Subject: [PATCH 2/2] 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 7ab5a448936b..22bf6d5c5fd7 100644 ---- a/src/__phutil_library_map__.php -+++ b/src/__phutil_library_map__.php -@@ -384,7 +384,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', -@@ -801,7 +800,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 @@ -- 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/20171226-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch b/www-client/arcanist/files/20171226-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch new file mode 100644 index 00000000..372cbce7 --- /dev/null +++ b/www-client/arcanist/files/20171226-MEDIUM-Get-VERSION-for-files-in-usr-share-PN-GIT_COM.patch @@ -0,0 +1,53 @@ +From 8235aa85f6d29d9667b67aa910d4756ea9bce168 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 18 Dec 2016 01:59:52 +0000 +Subject: [PATCH 1/2] MEDIUM: Get VERSION for files in + /usr/share//GIT_COMMIT_INFO rather than from git + +--- + src/workflow/ArcanistVersionWorkflow.php | 27 ++++++++------------------- + 1 file changed, 8 insertions(+), 19 deletions(-) + +diff --git a/src/workflow/ArcanistVersionWorkflow.php b/src/workflow/ArcanistVersionWorkflow.php +index 9c470fc6ea05..fefd972786dc 100644 +--- a/src/workflow/ArcanistVersionWorkflow.php ++++ b/src/workflow/ArcanistVersionWorkflow.php +@@ -35,30 +35,19 @@ 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)); + } + +- // NOTE: Carefully execute these commands in a way that works on Windows +- // until T8298 is properly fixed. See PHI52. +- +- list($commit) = $repository->execxLocal('log -1 --format=%%H'); +- $commit = trim($commit); +- +- list($timestamp) = $repository->execxLocal('log -1 --format=%%ct'); +- $timestamp = trim($timestamp); ++ $stdout = file_get_contents($commit_info); ++ list($commit, $timestamp) = explode(' ', $stdout); + + $console->writeOut( + "%s %s (%s)\n", diff --git a/www-client/arcanist/files/20171226-MINOR-Disable-self-upgrade.patch b/www-client/arcanist/files/20171226-MINOR-Disable-self-upgrade.patch new file mode 100644 index 00000000..8a5b97fa --- /dev/null +++ b/www-client/arcanist/files/20171226-MINOR-Disable-self-upgrade.patch @@ -0,0 +1,149 @@ +From 808cc5e954dcd53367680d7141402c9474abe62b Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Sun, 18 Dec 2016 02:15:13 +0000 +Subject: [PATCH 2/2] 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 7fbff131b20a..e15f85eca205 100644 +--- a/src/__phutil_library_map__.php ++++ b/src/__phutil_library_map__.php +@@ -385,7 +385,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', +@@ -803,7 +802,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 @@ +- 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; +- } +- +-} -- cgit v1.2.3