Last active
March 2, 2020 02:13
-
-
Save apstndb/cd9234cdbdb3a37072f32c5b063462fe to your computer and use it in GitHub Desktop.
Create google-cloud-sdk repo from apt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s https://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-amd64/Packages | | |
gojq -srR 'def ver: split("-")[0]; | |
split("\n\n") | | |
map(gsub("\n "; " ") | | |
split("\n") | | |
map(capture("^(?<key>[A-Z][a-zA-Z-]*): (?<value>.*)$"; "")) | | |
from_entries) | | |
group_by(.Package) | | |
map({key: .[0].Package, value: (sort_by(.Version))}) | | |
from_entries | | |
."google-cloud-sdk"[] | | |
"date && echo \(.Version | ver) && rm -rf usr etc ; curl -s https://packages.cloud.google.com/apt/\(.Filename) | dpkg -x - . && git add usr && git commit -m \(.Version | ver)"' | | |
sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment