Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit cf5f477

Browse files
committed
Use scraping to get latest version of node/npm
In FreeBSD VM hosted on Google GCE, with `pkg search` command, it fails to retrieve the latest list even after `pkg update -f` with `latest` repository selected (checked with `pkg -vv search`). There seems to be some caching mechanism involved, which I couldn't find a way to avoid.
1 parent 43e078b commit cf5f477

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

.cirrus.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ freebsd_build_task:
55

66
env:
77
matrix:
8-
- node_js: "11"
9-
nodePattern: "^node-11.*V8"
10-
npmPattern: "^npm-6\\."
11-
- node_js: "10"
12-
nodePattern: "^node10-.*V8"
13-
npmPattern: "^npm-node10-"
14-
- node_js: "8"
15-
nodePattern: "^node8-.*V8"
16-
npmPattern: "^npm-node8-"
17-
- node_js: "6"
18-
nodePattern: "^node6-.*V8"
19-
npmPattern: "^npm-node6-"
8+
- node_js: 11
9+
nodeTxzKey: node-11
10+
npmTxzKey: npm-6
11+
- node_js: 10
12+
nodeTxzKey: node10
13+
npmTxzKey: npm-node10
14+
- node_js: 8
15+
nodeTxzKey: node8
16+
npmTxzKey: npm-node8
17+
- node_js: 6
18+
nodeTxzKey: node6
19+
npmTxzKey: npm-node6
2020

2121
env:
2222
matrix:
@@ -38,8 +38,12 @@ freebsd_build_task:
3838
$execPrefix pkg install -y python2 > /dev/null;
3939
fi
4040
- $execPrefix pkg install -y c-ares gmake icu libnghttp2 libuv git > /dev/null
41-
- $execPrefix pkg add http://pkg.freebsd.org/$abi/latest/All/$(pkg search node | grep $nodePattern | cut -d' ' -f 1).txz
42-
- $execPrefix pkg add http://pkg.freebsd.org/$abi/latest/All/$(pkg search npm | grep $npmPattern | cut -d' ' -f 1).txz
41+
- |
42+
fetch http://pkg.freebsd.org/$abi/latest/All/ -o list
43+
nodeTxz=$(sed -n "/\"$nodeTxzKey/s/.*\"\($nodeTxzKey[^\"]*\).*/\1/p" list)
44+
npmTxz=$(sed -n "/\"$npmTxzKey/s/.*\"\($npmTxzKey[^\"]*\).*/\1/p" list)
45+
$execPrefix pkg add http://pkg.freebsd.org/$abi/latest/All/$nodeTxz
46+
$execPrefix pkg add http://pkg.freebsd.org/$abi/latest/All/$npmTxz
4347
- $execPrefix node --version
4448
- $execPrefix npm --version
4549
- $execPrefix clang++ --version

0 commit comments

Comments
 (0)