Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script fails if gpg is not available and $YARN_GPG is not set to no #2012

Closed
BanzaiMan opened this issue Nov 23, 2016 · 9 comments
Closed
Assignees
Labels

Comments

@BanzaiMan
Copy link
Contributor

BanzaiMan commented Nov 23, 2016

What is the current behavior?

When gpg is not available and $YARN_GPG is not set to no, the installation with the script fails

If the current behavior is a bug, please provide the steps to reproduce.

Remove gpg from $PATH and execute:

curl -o- -L https://yarnpkg.com/install.sh | bash

What is the expected behavior?

Installation succeeds

Please mention your node.js, yarn and operating system version.

Not relevant.


Analysis

The offending part is here:

# Check if GPG is installed
command -v gpg >/dev/null 2>&1 || (
printf "$yellow> WARNING: GPG is not installed, integrity can not be verified!$reset\n"
return
)

  command -v gpg >/dev/null 2>&1 || (
    printf "$yellow> WARNING: GPG is not installed, integrity can not be verified!$reset\n"
    return
  )

return does not get out of the function yarn_verify_integrity.

Instead, it should be more complete with if:

  if [[ -z "$(command -v gpg)" ]]; then
    printf "$yellow> WARNING: GPG is not installed, integrity can not be verified!$reset\n"
    return
  fi
@Daniel15
Copy link
Member

Oops, my mistake. Thanks @BanzaiMan

Daniel15 added a commit to Daniel15/yarn that referenced this issue Nov 24, 2016
 - Old versions of Mac OS (10.10 and below) require the `-t` option for `mktemp`
 - The check for GPG wasn't returning correctly, and tried to run GPG even when not available

Closes yarnpkg#2012
Closes yarnpkg#1984
Daniel15 added a commit that referenced this issue Nov 24, 2016
- Old versions of Mac OS (10.10 and below) require the `-t` option for `mktemp`
 - The check for GPG wasn't returning correctly, and tried to run GPG even when not available

Closes #2012
Closes #1984
@maximelafarie
Copy link

I still run into this warning while upgrading.

curl -o- -L https://yarnpkg.com/install.sh | bash

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6875    0  6875    0     0  17131      0 --:--:-- --:--:-- --:--:-- 17144
Installing Yarn!
/Users/lafarie/.yarn/bin/yarn
> Downloading tarball...

[1/2]: https://yarnpkg.com/latest.tar.gz --> /var/folders/gl/hzn4_ptd2y710rnxmx0__4y00000gn/T/yarn.tar.gz.XXXXXXXXXX.0V6JALoB
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    90  100    90    0     0    169      0 --:--:-- --:--:-- --:--:--   169
100   608    0   608    0     0    350      0 --:--:--  0:00:01 --:--:--  1223
100  864k  100  864k    0     0   250k      0  0:00:03  0:00:03 --:--:--  623k

[2/2]: https://yarnpkg.com/latest.tar.gz.asc --> /var/folders/gl/hzn4_ptd2y710rnxmx0__4y00000gn/T/yarn.tar.gz.XXXXXXXXXX.0V6JALoB.asc
100    94  100    94    0     0    696      0 --:--:-- --:--:-- --:--:--   696
100   612    0   612    0     0   1364      0 --:--:-- --:--:-- --:--:--  1364
100  1028  100  1028    0     0   1599      0 --:--:-- --:--:-- --:--:-- 1003k
> WARNING: GPG is not installed, integrity can not be verified!
> Extracting to ~/.yarn...
> Adding to $PATH...
> We've added the following to your /Users/lafarie/.zshrc
> If this isn't the profile of your current shell then please add the following to your correct profile:

export PATH="$HOME/.yarn/bin:$PATH"

> Successfully installed Yarn 1.2.1! Please open another terminal where the `yarn` command will now be available.

@Daniel15
Copy link
Member

@maximelafarie - I don't see any errors in your output? Seems like the installer worked?

@maximelafarie
Copy link

@Daniel15 You're right, that's just a warning 😅

@Daniel15
Copy link
Member

Daniel15 commented Oct 13, 2017 via email

@doublesharp
Copy link

To possibly save someone a Google search: brew install gpg

@njlr
Copy link

njlr commented Sep 17, 2019

In my case (Travis CI + Windows):

choco install gpg4win-vanilla -y

@mattclegg
Copy link

And for alpine:
apk add --no-cache gnupg

@letallan
Copy link

To possibly save someone a Google search: brew install gpg

Right now it's brew install gnupg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants