ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / in / intune-portal / update.sh
blob4908bcf4379412805982a769341a1f58859559f6
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)
6 latest_version="0"
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}"
20 echo $latest_version
23 Package=""
24 Version=""
26 done | tail -n 1 | (read version; update-source-version intune-portal $version)