1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash -p curl gzip dpkg common-updater-scripts
4 index_file
=$
(curl
-sL https
://packages.microsoft.com
/ubuntu
/22.04/prod
/dists
/jammy
/main
/binary-amd64
/Packages.gz |
gzip -dc)
8 echo "$index_file" |
while read -r line
; do
9 if [[ "$line" =~ ^Package
:[[:space
:]]*(.
*) ]]; then
10 Package
="${BASH_REMATCH[1]}"
12 if [[ "$line" =~ ^Version
:[[:space
:]]*(.
*) ]]; then
13 Version
="${BASH_REMATCH[1]}"
16 if ! [[ "$line" ]] && [[ "${Package}" == "intune-portal" ]]; then
17 if ( dpkg
--compare-versions ${Version} gt
${latest_version} ); then
18 latest_version
="${Version}"
26 done |
tail -n 1 |
(read version
; update-source-version intune-portal
$version)