Use dpkg status check
All checks were successful
PikaOS Package Build & Release (amd64-v3) / build (push) Successful in 1m46s

This commit is contained in:
Ward from fusion-voyager-3 2024-09-02 03:38:40 +03:00
parent fcee87ce46
commit 7f4683c653
5 changed files with 15 additions and 6 deletions

View File

@ -1 +1 @@
5
6

10
data/scripts/check-pkg.sh Executable file
View File

@ -0,0 +1,10 @@
#! /usr/bin/bash
export LANG=C
package=$1
if dpkg-query -W -f='${Status}' $package 2>/dev/null | grep -q "install ok installed"
then
exit 0
else
exit 1
fi

View File

@ -19,7 +19,7 @@ INSTALLED="no"
package_check() {
# Check if codecs are already installed
dpkg -s pika-codecs-meta
/usr/lib/pika/pika-welcome/scripts/check-pkg.sh pika-codecs-meta
if [ $? -eq 0 ]; then
export INSTALLED="yes"
fi

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
pika-welcome (5.0.0-101pika3) pika; urgency=low
pika-welcome (5.0.0-101pika4) pika; urgency=low
* Port to PikaOS 4

View File

@ -156,8 +156,7 @@ pub fn recommended_addons_page(
gio::spawn_blocking(
clone!(@strong checkpkg_status_loop_sender, @strong entry_checkpkg => move || loop {
let checkpkg_command = Command::new("dpkg")
.arg("-s")
let checkpkg_command = Command::new("/usr/lib/pika/pika-welcome/scripts/check-pkg.sh")
.arg(&entry_checkpkg)
.output()
.expect("failed to execute process");