From 2d8385a1cdbda3f420acb50248a1bd9414e5ddac Mon Sep 17 00:00:00 2001 From: Matej Kafka Date: Tue, 2 Apr 2024 18:00:04 +0200 Subject: [PATCH] _knowledge: Add notes about GitHub package generators --- app/Pog/Pog.psm1 | 3 ++ .../_knowledge/github package generators.txt | 47 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 app/Pog/_knowledge/github package generators.txt diff --git a/app/Pog/Pog.psm1 b/app/Pog/Pog.psm1 index 274349b..8bbdb06 100644 --- a/app/Pog/Pog.psm1 +++ b/app/Pog/Pog.psm1 @@ -210,6 +210,9 @@ function UpdateSinglePackage([string]$PackageName, [string[]]$Version, [switch] } # TODO: run this inside a container +# run both scriptblocks in the same container instance +# think what utility cmdlets can Pog reasonably provide and which is best left to existing tools like iwr/import +# likely provide cmdlets to work with github (listing releases, using regex to select asset URL) and calculate hash (Show-PogManifestHash) # FIXME: if -Force is passed, track if there are any leftover manifests (for removed versions) and delete them Export function Update-PogManifest { # .SYNOPSIS diff --git a/app/Pog/_knowledge/github package generators.txt b/app/Pog/_knowledge/github package generators.txt new file mode 100644 index 0000000..fec0f2d --- /dev/null +++ b/app/Pog/_knowledge/github package generators.txt @@ -0,0 +1,47 @@ +Github cmdlets: +- pass name of github repository +- lists matching release versions (new/all/selected), with support for filters, automatically parses version (e.g. stripping out "v" prefix?) +- retrieves download URLs (using a regex like '.*windows.*\.exe'? figure out how to support multiple resources, e.g. Alacritty) +- has parameters indicating how to retrieve the hash: + - download the file and calculate the hash + - scriptblock that returns the URL of a checksums.txt or a similar file + - custom scriptblock that receives hashtable of Version/Url and returns the hash (e.g. custom checksum file format, + copying hash from another package manager repo,...) + + + +@{ + GithubRepo = "obsproject/obs-studio" + FileNamePattern = "OBS-Studio-*-Full-x64.zip" + Checksum = "Calculate" +} + +Get-GithubRelease "obsproject/obs-studio" -FileName "OBS-Studio-*-Full-x64.zip" -Checksum Calculate + + + +how hashes are presented for a github release: +- CHECKSUMS.txt (or similar) 22 +- they aren't, small archive 30 +- they aren't, medium archive 12 +- they aren't, large archive 11 + nixman mingw + https://github.com/texstudio-org/texstudio/releases/3.0.4/ + https://github.com/telegramdesktop/tdesktop/releases/v3.2.5/ + https://github.com/beardypig/streamlink-portable/releases/3.2.0/ + https://github.com/Qalculate/qalculate-gtk/releases/v3.20.1/ + https://github.com/pdfarranger/pdfarranger/releases/1.9.0/ + https://github.com/obsproject/obs-studio/releases/25.0.4/ + https://github.com/marp-team/marp-cli/releases/v3.1.0/ + https://github.com/DynamoRIO/drmemory/releases/tag/cronbuild-2.5.19327 + https://github.com/GyanD/codexffmpeg/releases/6.0/ + https://github.com/icsharpcode/ILSpy/releases/v8.1/ +- checksum file with algorithm other than sha256 2 + https://github.com/atom/atom/releases/v1.56.0/ + https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/gs9540/ +- in release description 5 + https://github.com/ndbeals/winssh-pageant/releases/v2.3.1/ + https://github.com/neovim/neovim/releases/v0.8.3/ + https://github.com/tannerhelland/PhotoDemon/releases/v8.4/ + https://github.com/notepad-plus-plus/notepad-plus-plus/releases/v7.9.4/ + https://github.com/git-for-windows/git/releases/v2.42.0.windows.1/ \ No newline at end of file