New backup 2025-07-19 11:15:08
This commit is contained in:
parent
5ac0e76fc9
commit
d38c14535c
1 changed files with 9 additions and 8 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
software_json_cache="${HOME}/.cache/software-release-monitor.json"
|
||||||
|
|
||||||
source ${HOME}/.secrets
|
source ${HOME}/.secrets
|
||||||
function get_package_info(){
|
function get_package_info(){
|
||||||
packages_array=()
|
packages_array=()
|
||||||
|
|
@ -19,16 +21,15 @@ function get_package_info(){
|
||||||
package_json=$( jq -n --arg name "${package_name}" --arg pkgver "${package_version}" --arg upstreamver "${upstream_version}" --arg uptodate "${up_to_date}" '{package_name: $name, package_version: $pkgver, upstream_version: $upstreamver, up_to_date: $uptodate}' )
|
package_json=$( jq -n --arg name "${package_name}" --arg pkgver "${package_version}" --arg upstreamver "${upstream_version}" --arg uptodate "${up_to_date}" '{package_name: $name, package_version: $pkgver, upstream_version: $upstreamver, up_to_date: $uptodate}' )
|
||||||
packages_array+=("${package_json}")
|
packages_array+=("${package_json}")
|
||||||
done < <(jq -c '.[]' "${HOME}/.config/software-release-monitor/config.json")
|
done < <(jq -c '.[]' "${HOME}/.config/software-release-monitor/config.json")
|
||||||
packages_json=$(printf '%s\n' "${packages_array[@]}" | jq -s .)
|
#packages_json=$(printf '%s\n' "${packages_array[@]}" | jq -s .)
|
||||||
echo "${packages_json}"
|
#echo "${packages_json}"
|
||||||
|
printf '%s\n' "${packages_array[@]}" | jq -s . | tee "${software_json_cache}" >/dev/null
|
||||||
#echo "${package_array_item}"
|
#echo "${package_array_item}"
|
||||||
#echo "${package_array[@]}"
|
#echo "${package_array[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_package_info
|
if [[ ! $(find "${software_json_cache}" -cmin -180 -print 2>/dev/null) ]]; then
|
||||||
|
get_package_info
|
||||||
|
fi
|
||||||
|
|
||||||
#printf '%s\n' "${package_array[@]}" | jq -s .
|
cat "${software_json_cache}"
|
||||||
|
|
||||||
|
|
||||||
#dpkg-query -W -f='${Version}' swayfx
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue