[Gambas-user] PPA for Raspberry Pi OS

Bruce Steers bsteers4 at gmail.com
Thu Jan 28 22:48:13 CET 2021


Responding this incase it got bounced with an attachment.

The examle script is small so I'll paste it at the end of the forwarded
text...


On Thu, 28 Jan 2021, 13:06 Bruce Steers, <bsteers4 at gmail.com> wrote:

>
>
> On Thu, 28 Jan 2021 at 02:44, Bruce Steers <bsteers4 at gmail.com> wrote:
>
>> I've been poking around the launchpad site and cannot find a way to
>> download the packages as one file.
>> but i did see you can download all the packages individually.
>>
>> I could probably write a script to read the launchpad page and get and
>> install all the .deb files.
>>
>>
>> On Wed, 27 Jan 2021 at 16:02, Benoît Minisini <g4mba5 at gmail.com> wrote:
>>
>>> Le 27/01/2021 à 16:55, Bruce Steers a écrit :
>>> >
>>> > wait what?!
>>> > I was under the impression PPA was Ubuntu only not Debian?
>>> >
>>> > I am sure i have tried it on debian and it didn't work?
>>> > I will have to try again..
>>> > BruceS
>>> >
>>>
>>> The PPA won't, but I think the packages work. Of course I didn't test.
>>>
>>
> I made a script for debian/raspbian. (hopefully attached)
> what it does...
> Lets you select Stable or Daily build. (default is Daily)
> Lets you select amd64 or armhf (default if amd64)
> Reads launchpad page and gets latest PPA path.
> Makes a folder in $HOME and downloads all the packages into it.
>
> So far so good but now the problem...
> I tried to run *dpkg -i -R /sourcefolder*
> It cannot install.  mostly the packages complain that other gambas
> packages have not been installed yet.
>
> I Need to now if there is a specific order that the packages need to be
> installed in.
> and if there is a way to get dpkg to auto install any other missing
> dependencies.
>
> or if apt might do better?
> How does the PPA site do it for Ubuntu?
> Any advice appreciated, hopefully not much else involved in making a
> working PPA installer for debian based OSs.
>
> BruceS
>

# begin script..

#!/usr/bin/env bash

# New bash Script file...
if [ -z $(which curl 2>/dev/null) ]; then
echo "curl is needed to download and process web pages with this script."
echo "press return to install curl or press"
read -e -p "Ctrl-C to exit."
sudo apt install -y curl
fi
if [ -z $(which wget 2>/dev/null) ]; then
echo "wget is needed to download the gambas packages."
echo "press return to install wget or press"
read -e -p "Ctrl-C to exit."
sudo apt install -y wget
fi
VERSION="gambas-daily"
echo "Do you want the Gambas Daily builds or Stable verison?"
read -p "Type S or stable for stable build or press return for the daily
build: " REPLY

if [ "${REPLY,,}" = "s" ] || [ "${REPLY,,}" = "stable" ]; then
VERSION="gambas3"; fi

echo "getting $VERSION version."
read -p "Press return for okay, Ctrl-C to exit.: "

echo "Reading Launchpad PPA page..."
BUILDS=$(curl "
https://launchpad.net/~gambas-team/+archive/ubuntu/$VERSION/+packages"
2>/dev/null|grep "href=\"+sourcepub/"|awk '{print $4}'|tr "\"" "\n")
BUILDS=$(echo "$BUILDS"|grep +|tr "\n" " ")
BUILD=${BUILDS%% *}


read -e -p "Select architacture, type amd64 (default) or armhf: " REPLY

if [ -z "$REPLY" ]; then REPLY="amd64"; fi

echo "getting package info..."

if [ "${REPLY,,}" = "armhf" ]; then
DEBS=$(curl "
https://launchpad.net/~gambas-team/+archive/ubuntu/$VERSION/$BUILD"|grep
"armhf.deb")
else
DEBS=$(curl "
https://launchpad.net/~gambas-team/+archive/ubuntu/$VERSION/$BUILD"|grep
"amd64.deb")
DEBS="$DEBS
$(curl
https://launchpad.net/~gambas-team/+archive/ubuntu/$VERSION/$BUILD|grep
all)"
fi

OIFS=$IFS
IFS=$'\n'

read -d "ç" -a DLIST <<< "$DEBSç"
CNT=0
while [ $CNT -lt ${#DLIST[@]} ]; do
DEB="${DLIST[$CNT]#*\"}"
DLIST[$CNT]="${DEB%%\"*}"
#echo ${DLIST[$CNT]}
((CNT++))
done
FILES=${#DLIST[@]}
echo "Need to get $FILES packages."
echo "Press return to download"
read -p "Ctrl-C to exit: "

CNT=0

#if [ -e "$HOME/pkgs-$VERSION" ]; then rm -rf "$HOME/pkgs-$VERSION"; fi
#mkdir "$HOME/pkgs-$VERSION"
cd "$HOME/pkgs-$VERSION"
while [ $CNT -lt ${#DLIST[@]} ]; do
URL=${DLIST[$CNT]}
echo -en "geting file $CNT of $FILES\r"
# wget -q "$URL" 2>/dev/null
((CNT++))
done

echo "Press return to install."
read -p "Ctrl-C to exit: "

# sudo dpkg -i -R "$HOME/pkgs-$VERSION"



>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210128/cd862740/attachment-0001.htm>


More information about the User mailing list