Skip to content

Commit

Permalink
Adds installationMethod key to package.json
Browse files Browse the repository at this point in the history
requested upstream yarnpkg/yarn#1326 (comment)
  • Loading branch information
errm committed Feb 1, 2017
1 parent fd8acf9 commit 1900b2d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
12 changes: 8 additions & 4 deletions testing/yarn/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ url="https://yarnpkg.com/"
arch="noarch"
license="BSD-2"
depends="nodejs"
source="https://yarnpkg.com/downloads/$pkgver/$pkgname-v$pkgver.tar.gz"
source="https://yarnpkg.com/downloads/$pkgver/$pkgname-v$pkgver.tar.gz
add-apk-install-method.patch"
builddir="$srcdir/dist"

prepare() {
Expand Down Expand Up @@ -46,6 +47,9 @@ package() {
ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarn
ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarnpkg
}
md5sums="12df75bdb018b0412580ccc5ffee5c6e yarn-v0.20.0.tar.gz"
sha256sums="4622f3c7a2fdf0dac3ef38b49eb636b813734e06a5a688fb2545df857792ebe3 yarn-v0.20.0.tar.gz"
sha512sums="9f1a63b7e41a52059b3f30c029b4c249e44c24a7a48dc55bec2806009fcd725b39205fd8b4c292bc19fa968b0694d692616610cf038de2c50d2f91dbb7ab7bb8 yarn-v0.20.0.tar.gz"
md5sums="12df75bdb018b0412580ccc5ffee5c6e yarn-v0.20.0.tar.gz
d2eb334f05cd80950aefaf42e80e9eea add-apk-install-method.patch"
sha256sums="4622f3c7a2fdf0dac3ef38b49eb636b813734e06a5a688fb2545df857792ebe3 yarn-v0.20.0.tar.gz
f30bc08dc1e791913d112e57e7b6288baf71d429695a48802315995e7f348f94 add-apk-install-method.patch"
sha512sums="9f1a63b7e41a52059b3f30c029b4c249e44c24a7a48dc55bec2806009fcd725b39205fd8b4c292bc19fa968b0694d692616610cf038de2c50d2f91dbb7ab7bb8 yarn-v0.20.0.tar.gz
c568a26472fa50c45adfdf1eaa5df69ee8a3674d5c95128a4adb29ef490e5a8454c38a52bd8e283e94a0923cd9d9cf122c2bd1cf3c1fc7e572e22fa8a9593100 add-apk-install-method.patch"
48 changes: 48 additions & 0 deletions testing/yarn/add-apk-install-method.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Only in dist: .DS_Store
diff -urp dist/lib/cli/commands/install.js patched/lib/cli/commands/install.js
--- dist/lib/cli/commands/install.js 2017-02-01 00:36:23.000000000 +0000
+++ patched/lib/cli/commands/install.js 2017-02-01 01:25:41.000000000 +0000
@@ -226,6 +226,10 @@ function getUpdateCommand() {
return 'choco upgrade yarn';
}

+ if (YARN_INSTALL_METHOD === 'apk') {
+ return 'apk update && apk add -u yarn';
+ }
+
return null;
}

diff -urp dist/lib-legacy/cli/commands/install.js patched/lib-legacy/cli/commands/install.js
--- dist/lib-legacy/cli/commands/install.js 2017-01-30 14:13:43.000000000 +0000
+++ patched/lib-legacy/cli/commands/install.js 2017-02-01 01:32:32.000000000 +0000
@@ -238,6 +238,10 @@ function getUpdateCommand() {
return 'choco upgrade yarn';
}

+ if (YARN_INSTALL_METHOD === 'apk') {
+ return 'apk update && apk add -u yarn';
+ }
+
return null;
}

@@ -1011,4 +1015,4 @@ function setFlags(commander) {
commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`');
commander.option('-E, --save-exact', 'DEPRECATED');
commander.option('-T, --save-tilde', 'DEPRECATED');
-}
\ No newline at end of file
+}
Only in dist/node_modules: .DS_Store
diff -urp dist/package.json patched/package.json
--- dist/package.json 2017-02-01 01:23:37.000000000 +0000
+++ patched/package.json 2017-02-01 01:23:50.000000000 +0000
@@ -1,6 +1,6 @@
{
"name": "yarn",
- "installationMethod": "tar",
+ "installationMethod": "apk",
"version": "0.20.0",
"license": "BSD-2-Clause",
"preferGlobal": true,

0 comments on commit 1900b2d

Please sign in to comment.