Brew available files for different macOS version - macos

Take install Python for example.
==> Installing opencv dependency: python
==> Downloading https://homebrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.tar.gz
The brew SW download the one that's matched with my current macOS version as default. (In this case, it's for high_sierra (10.13.x) macOS).
But I'd like to get other build version for previous macOS version (e.g. 10.10.x).
I notice that the SW that's all downloaded from https://homebrew.bintray.com/bottles/.
But unfortunately, I can't view the available files under the https://homebrew.bintray.com/bottles/ path.
Is there a command to view available files (e.g. Python) for different macOS version ?

You can use either brew info --json=v1 <formula> or Homebrew’s public JSON API:
$ brew info --json=v1 python | jq .
[
{
"name": "python",
"desc": "Interpreted, interactive, object-oriented programming language",
"homepage": "https://www.python.org/",
// ...
"bottle": {
"stable": {
// ...
"files": {
"high_sierra": {
"url": "https://linuxbrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.1.tar.gz",
"sha256": "7e0fc1b078b51d9478ab08660d5df01611976a7af0f6c24054bda58264bb506c"
},
"sierra": {
"url": "https://linuxbrew.bintray.com/bottles/python-3.6.5.sierra.bottle.1.tar.gz",
"sha256": "2fe5ca9be0f1596798927c4aa1d4d187ca7f83adc4681483cec2cc52d7c95386"
},
"el_capitan": {
"url": "https://linuxbrew.bintray.com/bottles/python-3.6.5.el_capitan.bottle.1.tar.gz",
"sha256": "bccf50de973644608af29652f2660124d033f3213d422fe44a7f012a47643a95"
}
}
}
},
// ...
]
Using jq:
$ brew info --json=v1 python | jq -r '.[]|.bottle.stable.files[]|.url'
https://linuxbrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.1.tar.gz
https://linuxbrew.bintray.com/bottles/python-3.6.5.sierra.bottle.1.tar.gz
https://linuxbrew.bintray.com/bottles/python-3.6.5.el_capitan.bottle.1.tar.gz
Note it works with multiple formulae:
$ brew info --json=v1 python git | jq -r '.[]|.bottle.stable.files[]|.url'
https://linuxbrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.1.tar.gz
https://linuxbrew.bintray.com/bottles/python-3.6.5.sierra.bottle.1.tar.gz
https://linuxbrew.bintray.com/bottles/python-3.6.5.el_capitan.bottle.1.tar.gz
https://linuxbrew.bintray.com/bottles/git-2.17.1.high_sierra.bottle.tar.gz
https://linuxbrew.bintray.com/bottles/git-2.17.1.sierra.bottle.tar.gz
https://linuxbrew.bintray.com/bottles/git-2.17.1.el_capitan.bottle.tar.gz

Related

How to determine version of a golang module through its source code?

Recently, I am trying to determine the version of a golang module. Usually, I will download a module's source code knowing the version of main module. But sometimes there are few submodules in other directories. Like github.com/hashicorp/consul, it contains two submodules as hashicorp/consul/sdk and hashicorp/consul/api. However when I download github.com/hashicorp/consul (version: v1.9.1), it's very difficult to determine the version of consul/sdk and consul/api because go.mod file doesn't contain any version information about this module. So, my question is how to get version of submodule in a golang module?
I read the checksum documents and endpoints documents. I wonder if I can compute a checksum of source files and compare it with versions' checksum in golang database to determine the version. As I read the endpoints api, I think this way is a little complex.
Another thought is to determine the version through git tag history. However, I don't think it's an accurate way.
If you look in the go.mod file of github.com/hashicorp/consul you can see the versions:
github.com/hashicorp/consul/api v1.8.0
github.com/hashicorp/consul/sdk v0.7.0
(See e.g. https://github.com/hashicorp/consul/blob/master/go.mod#L31)
Depending on what version you are using, check the respective go.mod file of that version.
As #Volker said, your go.mod file will probably also have the versions. If not your go.sum file will as it contains the checksums of all dependencies.
To determine all version of dependencies try to use go list tool (List packages or modules)
For example (list of all dependencies with versions)
% cat go.mod
module github.com/hashicorp/consul
go 1.13
replace github.com/hashicorp/consul/api => ./api πŸ‘ˆπŸ» replace ➑️ consul/api v1.8.0
replace github.com/hashicorp/consul/sdk => ./sdk πŸ‘ˆπŸ» replace ➑️ consul/sdk v0.7.0
replace launchpad.net/gocheck => github.com/go-check/check v0.0.0-20140225173054-eb6ee6f84d0a
require (
github.com/Microsoft/go-winio v0.4.3 // indirect
github.com/NYTimes/gziphandler v1.0.1
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/armon/go-metrics v0.3.6
github.com/armon/go-radix v1.0.0
github.com/aws/aws-sdk-go v1.25.41
github.com/coredns/coredns v1.1.2
github.com/coreos/go-oidc v2.1.0+incompatible
github.com/digitalocean/godo v1.10.0 // indirect
github.com/docker/go-connections v0.3.0
github.com/elazarl/go-bindata-assetfs v0.0.0-20160803192304-e1a2a7ec64b0
github.com/envoyproxy/go-control-plane v0.9.5
github.com/frankban/quicktest v1.11.0 // indirect
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
github.com/golang/protobuf v1.3.5
github.com/google/go-cmp v0.5.2
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v1.2.0
github.com/google/tcpproxy v0.0.0-20180808230851-dfa16c61dad2
github.com/hashicorp/consul/api v1.8.0 πŸ‘ˆπŸ» replace
github.com/hashicorp/consul/sdk v0.7.0 πŸ‘ˆπŸ» replace
...
% go list -json -m -u all
{
"Path": "github.com/hashicorp/consul",
"Main": true,
"Dir": "/Users/a18388871/GoProjects/consul",
"GoMod": "/Users/a18388871/GoProjects/consul/go.mod",
"GoVersion": "1.13"
}
...
{
"Path": "github.com/grpc-ecosystem/grpc-gateway",
"Version": "v1.9.0",
"Time": "2019-05-14T09:07:28Z",
"Update": {
"Path": "github.com/grpc-ecosystem/grpc-gateway",
"Version": "v1.16.0",
"Time": "2020-10-28T10:29:51Z"
},
"Indirect": true,
"Dir": "/Users/a18388871/go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway#v1.9.0",
"GoMod": "/Users/a18388871/go/pkg/mod/cache/download/github.com/grpc-ecosystem/grpc-gateway/#v/v1.9.0.mod"
}
{
"Path": "github.com/hashicorp/consul/api",
"Version": "v1.8.0",
"Replace": { πŸ‘ˆπŸ». Replace field describes the replacement module, and its Dir field is set to the replacement's source code
"Path": "./api",
"Dir": "/Users/a18388871/GoProjects/consul/api",
"GoMod": "/Users/a18388871/GoProjects/consul/api/go.mod",
"GoVersion": "1.12"
},
"Update": { πŸ‘ˆπŸ»' The -u flag adds information about available upgrades'
"Path": "github.com/hashicorp/consul/api",
"Version": "v1.8.1",
"Time": "2020-12-10T20:49:49Z"
},
"Dir": "/Users/a18388871/GoProjects/consul/api",
"GoMod": "/Users/a18388871/GoProjects/consul/api/go.mod",
"GoVersion": "1.12"
}
...

How to use the result of an NPM script in another NPM script?

It might be simple. But I can't get it work.
Let's consider the simple (and troncated) package.json below.
{
"name": "appName",
"version": "1.0.0",
"TEST": "1-0-0",
"scripts": {
"TEST_IN_SCRIPTS": " echo ${npm_package_version} | sed 's/\\./-/g' ",
"deploy": "gcloud app deploy --version ${npm_package_scripts_TEST_IN_SCRIPTS}"
},
"dependencies": {
"express": "^4.16.2",
...
}
}
I want to deploy an app with --version equals version (aka 1.0.0).
However, Google App Engine does not allow . (dot).
The idea is then to deploy a 1-0-0 (instead of 1.0.0) which is allowed by GAE.
TEST_IN_SCRIPTS works and returns 1-0-0
However, when I pass ${npm_package_scripts_TEST_IN_SCRIPTS} to deploy script, it fails because it returns the string ${npm_package_scripts_TEST_IN_SCRIPTS} instead of its result (1-0-0).
Any clue to make it works?
Thanks.
Try piping the output of the TEST_IN_SCRIPTS:
"deploy": "npm run TEST_IN_SCRIPTS | xargs gcloud app deploy --version",
I've found a simple solution that works for me.
Thanks #Juan, you show me the road!
Below my troncated package.json
{
"name": "...",
"version": "1.0.1",
"scripts": {
"deploy": "GAE_VERSION=$(echo ${npm_package_version} | sed 's/\\./-/g') && gcloud app deploy --version $GAE_VERSION"
},
"dependencies": {...},
"devDependencies": {...}
}
This is - in fact - pretty simple.
get npm_package_version and change with sed . by - (GAE is ok with hyphen)
Assign the result to a variable (here : GAE_VERSION)
Use gcloud command to deploy using GAE_VERSION variable.
An identical question where I post this very same answer.

new composer-wallet - jszip error

I am making a new composer-wallet with composer 0.19.0
All test passed fine - test based on composer-wallet-filesystem
I can successfully import business network cards to the new wallet and use them for transactions.
I am only one issue
$ composer card list
Error: Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html
Command failed
I tryed to update jszip to the lastest version in composer-cli, but same problem
Here is the environment variable to configure the connection
export NODE_CONFIG='{
"composer": {
"wallet": {
"type": "composer-wallet-mongodb",
"desc": "Uses a local mongodb instance",
"options": {
"uri": "mongodb://localhost:27017/yourCollection",
"collectionName": "myWallet",
"options": {
}
}
}
}
}'
Any help is welcomed

Godep cant find gin when pushing go project to PCF-dev

Yesterday my app was pushing fine. When I came back today to push I am having issues where godeps can't find certain dependencies. Im able to godep go install just fine on my local machine, which leads me to believe this is a PCF issue of some type.
go push output:
Starting app business-service in org pcfdev-org / space pcfdev-space as user...
Downloading dotnet_core_buildpack_beta...
Downloading go_buildpack...
Downloading nodejs_buildpack...
Downloading ruby_buildpack...
Downloading staticfile_buildpack...
Downloaded ruby_buildpack
Downloading python_buildpack...
Downloaded go_buildpack
Downloading php_buildpack...
Downloaded nodejs_buildpack
Downloading binary_buildpack...
Downloaded dotnet_core_buildpack_beta
Downloading java_buildpack...
Downloaded binary_buildpack
Downloaded php_buildpack
Downloaded python_buildpack
Downloaded staticfile_buildpack
Downloaded java_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (9.1K)
Staging...
-------> Buildpack version 1.7.10
file:///tmp/buildpacks/d17226e3d1bc5f728403b1521b69c8ae/dependencies/https___buildpacks.cloudfoundry.org_concourse-binaries_godep_godep-v74-linux-x64.tgz
file:///tmp/buildpacks/d17226e3d1bc5f728403b1521b69c8ae/dependencies/https___buildpacks.cloudfoundry.org_concourse-binaries_glide_glide-v0.11.0-linux-x64.tgz
-----> Checking Godeps/Godeps.json file.
-----> Installing go1.6.3... done
Downloaded [file:///tmp/buildpacks/d17226e3d1bc5f728403b1521b69c8ae/dependencies/https___storage.googleapis.com_golang_go1.6.3.linux-amd64.tar.gz]
!! Installing package '.' (default)
-----> Running: godep go install -v -tags cloudfoundry --buildmode=pie .
server/server.go:4:2: cannot find package "gopkg.in/gin-gonic/gin.v1" in any of:
/tmp/cache/go1.6.3/go/src/gopkg.in/gin-gonic/gin.v1 (from $GOROOT)
/tmp/app/.heroku/go/src/business-service/Godeps/_workspace/src/gopkg.in/gin-gonic/gin.v1 (from $GOPATH)
/tmp/app/.heroku/go/src/gopkg.in/gin-gonic/gin.v1
godep: go exit status 1
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
Successfully destroyed container
Godeps.json:
{
"ImportPath": "business-service",
"GoVersion": "go1.6",
"GodepVersion": "v74",
"Deps": [
{
"ImportPath": "github.com/gin-gonic/gin/binding",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/gin-gonic/gin/render",
"Comment": "v1.0-2-g3900df0",
"Rev": "3900df04d2a88e22beaf6a2970c63648b9e1b0e1"
},
{
"ImportPath": "github.com/golang/protobuf/proto",
"Rev": "98fa357170587e470c5f27d3c3ea0947b71eb455"
},
{
"ImportPath": "github.com/manucorporat/sse",
"Rev": "ee05b128a739a0fb76c7ebd3ae4810c1de808d6d"
},
{
"ImportPath": "golang.org/x/net/context",
"Rev": "65dfc08770ce66f74becfdff5f8ab01caef4e946"
},
{
"ImportPath": "gopkg.in/gin-gonic/gin.v1",
"Comment": "v1.0",
"Rev": "2dae550eb5392006a4582ce9c90016a9b5a74e8b"
},
{
"ImportPath": "gopkg.in/go-playground/validator.v8",
"Comment": "v8.18.1",
"Rev": "5f57d2222ad794d0dffb07e664ea05e2ee07d60c"
},
{
"ImportPath": "gopkg.in/yaml.v2",
"Rev": "a5b47d31c556af34a302ce5d659e6fea44d90de0"
}
]
}

sublime text build system for jekyll

I'm trying to get a build system for the Jekyll gem in sublime text. In my sublime-project I have the following:
"build_systems":
[
{
"name":"jekyll",
"cmd":"/Users/kaass/.rvm/gems/ruby-1.9.3-p327/bin/jekyll",
"shell":true,
"path":"/Users/kaass/.rvm/bin/rvm-auto-ruby",
"working_dir":"$project_path"
}
]
I have tried playing around with env as well as different options above, but always get some sort of error pertaining to ruby or jekyll not found or env: ruby_noexec_wrapper not found
I'm running 10.8.2 and my path :
kaass:~ kaass$ echo $PATH
/Users/kaass/.rvm/gems/ruby-1.9.3-p327/bin:/Users/kaass/.rvm/gems/ruby-1.9.3-p327#global/bin:/Users/kaass/.rvm/rubies/ruby-1.9.3-p327/bin:/Users/kaass/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/bin:/usr/X11R6/bin
Everything I'm trying to call is already in my path.
I had a similar problem running rake within the correct rvm environment.
This is the sublime-project file I ended up with:
{
"folders":
[
{
"path": "data"
}
],
"build_systems":
[
{
"name": "rake",
"cmd": "source ~/.rvm/environments/ruby-1.9.3-p194#mygemset && rake",
"shell": true,
"path": "/bin:/usr/bin:/usr/local/bin:~/.rvm/bin",
"working_dir": "$project_path"
}
]
}
The trick was to add ~/.rvm/bin to the path and to source the environment of the rvm gemset.
Then I can even use the "rake" command without specifying a full path.
The rest is straight-forward.

Resources