Skip to content

Commit

Permalink
Box86 and Box64: switch to add_external_repo and rm_external_repo
Browse files Browse the repository at this point in the history
  • Loading branch information
theofficialgman committed Dec 31, 2023
1 parent 316664f commit 261b157
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 40 deletions.
17 changes: 5 additions & 12 deletions apps/Box64/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,12 @@ if dpkg -l box64 &>/dev/null ;then
sudo apt purge -y --allow-change-held-packages box64*
fi

sudo wget https://pi-apps-coders.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
if [ $? != 0 ];then
sudo rm -f /etc/apt/sources.list.d/box64.list
error "Failed to add box64.list file!"
fi

sudo rm -f /usr/share/keyrings/box64-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
sudo mkdir -p /etc/apt/trusted.gpg.d
wget -qO- https://pi-apps-coders.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg > /dev/null
add_external_repo "box64" "https://Pi-Apps-Coders.github.io/box64-debs/debian ./" "https://pi-apps-coders.github.io/box64-debs/KEY.gpg" || exit 1

if [ $? != 0 ];then
sudo rm -f /etc/apt/sources.list.d/box64.list
error "Failed to add KEY.gpg to APT keyring!"
apt_update
if [ $? != 0 ]; then
rm_external_repo "box64"
error "Failed to perform apt update after adding box64 repository."
fi

# obtain SOC_ID
Expand Down
5 changes: 3 additions & 2 deletions apps/Box64/uninstall
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
purge_packages || exit 1

sudo rm -f /etc/apt/sources.list.d/box64.list || error "Failed to remove repo!"
# remove deprecated key locations
sudo rm -f /usr/share/keyrings/box64-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg

sudo rm -f /usr/share/keyrings/box64-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg || error "Failed to remove GPG key!"
rm_external_repo "box64"
17 changes: 5 additions & 12 deletions apps/Box86/install-32
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ if dpkg -l box86 &>/dev/null ;then
sudo apt purge -y --allow-change-held-packages box86*
fi

sudo wget https://pi-apps-coders.github.io/box86-debs/box86.list -O /etc/apt/sources.list.d/box86.list
if [ $? != 0 ];then
sudo rm -f /etc/apt/sources.list.d/box86.list
error "Failed to add box86.list file!"
fi

sudo rm -f /usr/share/keyrings/box86-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
sudo mkdir -p /etc/apt/trusted.gpg.d
wget -qO- https://pi-apps-coders.github.io/box86-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg > /dev/null
add_external_repo "box86" "https://Pi-Apps-Coders.github.io/box86-debs/debian ./" "https://pi-apps-coders.github.io/box86-debs/KEY.gpg" || exit 1

if [ $? != 0 ];then
sudo rm -f /etc/apt/sources.list.d/box86.list
error "Failed to add KEY.gpg to APT keyring!"
apt_update
if [ $? != 0 ]; then
rm_external_repo "box86"
error "Failed to perform apt update after adding box86 repository."
fi

# obtain SOC_ID
Expand Down
17 changes: 5 additions & 12 deletions apps/Box86/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,12 @@ install_packages libc6:armhf libstdc++6:armhf \
libgssapi-krb5-2:armhf libkrb5-3:armhf \
$rpi_arm_userspace $mesa_va_drivers libegl1:armhf libglx-mesa0:armhf libgl1:armhf libgles2:armhf

sudo wget https://pi-apps-coders.github.io/box86-debs/box86.list -O /etc/apt/sources.list.d/box86.list
if [ $? != 0 ];then
sudo rm -f /etc/apt/sources.list.d/box86.list
error "Failed to add box86.list file!"
fi

sudo rm -f /usr/share/keyrings/box86-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
sudo mkdir -p /etc/apt/trusted.gpg.d
wget -qO- https://pi-apps-coders.github.io/box86-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg > /dev/null
add_external_repo "box86" "https://Pi-Apps-Coders.github.io/box86-debs/debian ./" "https://pi-apps-coders.github.io/box86-debs/KEY.gpg" || exit 1

if [ $? != 0 ];then
sudo rm -f /etc/apt/sources.list.d/box86.list
error "Failed to add KEY.gpg to APT keyring!"
apt_update
if [ $? != 0 ]; then
rm_external_repo "box86"
error "Failed to perform apt update after adding box86 repository."
fi

# obtain SOC_ID
Expand Down
5 changes: 3 additions & 2 deletions apps/Box86/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ function check-armhf() {

purge_packages || exit 1

sudo rm -f /etc/apt/sources.list.d/box86.list || error "Failed to remove repo!"
# remove deprecated key locations
sudo rm -f /usr/share/keyrings/box86-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg

sudo rm -f /usr/share/keyrings/box86-debs-archive-keyring.gpg /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg || error "Failed to remove GPG key!"
rm_external_repo "box86"

if [ "$arch" == 64 ]; then
# remove armhf architecture if no packages from it are currently installed
Expand Down

0 comments on commit 261b157

Please sign in to comment.