Puppy Equivalent of apt-key add - ???

Using applications, configuring, problems
Post Reply
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Puppy Equivalent of apt-key add - ???

#1 Post by s243a »

What is the puppy equivalent of "apt-key add -". I'm trying to add the tor repo to depup strech. There are the following instructions for adding a key the pgp keyrying so that the debian package manager can download stuff from the repo:

Code: Select all

# gpg2 --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
# gpg2 --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add -
https://www.torproject.org/docs/debian.html.en

The - I think has to do with adding the key to the root user. I'll try installing apt-key but I"m not sure that is the correct solution. Perhaps there is a separate keyring for wget that I should add it to somehow.

Edit #1 I installed apt, which contained the apt-key and also coreutils because the busybox version of mktemp doesn't support a needed option that is used by apt-key. This didn't help the puppy package manager use the pgp key though :(. I'll have to look at the code.

Edit #2, I see that puppy was looking for a .xz file but if I look at the link the extension should be .gz. I'll make the necessary adjustments than try again.

so repo adding instructions can be found at:

Code: Select all

/usr/local/petget/README-add-repo.htm
I had in
/root/.packages/DISTRO_COMPAT_REPOS

Code: Select all

PKG_DOCS_DISTRO_COMPAT="
z|http://http.us.debian.org/debian/dists/${DISTRO_COMPAT_VERSION}/main/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-main
z|http://http.us.debian.org/debian/dists/${DISTRO_COMPAT_VERSION}/non-free/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-non-free
z|http://http.us.debian.org/debian/dists/${DISTRO_COMPAT_VERSION}/contrib/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-contrib
z|http://deb-multimedia.org/dists/${DISTRO_COMPAT_VERSION}/main/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-multimedia
z|https://deb.torproject.org/torproject.org/dists/${DISTRO_COMPAT_VERSION}/main/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-Tor-debian-${DISTRO_COMPAT_VERSION}
"
and will change in the last line ${DDB_COMP} of the above snipit to .gz

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#2 Post by s243a »

I found something in the woofCE github repo that I think will prevent me from adding the tor repo to the puppy package manager. There issue is here:

Code: Select all

   PKGLISTS_COMPAT_U=$(echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | grep -v 'deb-multimedia' | \
     sed -e "s|-${DISTRO_COMPAT_VERSION}-|-${DISTRO_COMPAT_VERSION}_updates-|" \
         -e "s|/${DISTRO_COMPAT_VERSION}/|/${DISTRO_COMPAT_VERSION}-updates/|")
download_compat_pkg_dbs $PKGLISTS_COMPAT_U
https://github.com/puppylinux-woof-CE/w ... setup#L311


The problem is that the debian tor repo doesn't follow this name convention where ${DISTRO_COMPAT_VERSION} has the suffix "_updates" in the url where the available package information is located. Is there any reason that this transformation couldn't be done instead in

Code: Select all

/root/.packages/DISTRO_COMPAT_REPOS 
so that it only needs to be applied where applicable?

In

Code: Select all

/root/.packages/DISTRO_COMPAT_REPOS 
I have

Code: Select all

PKG_DOCS_DISTRO_COMPAT="
z|http://http.us.debian.org/debian/dists/${DISTRO_COMPAT_VERSION}/main/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-main
z|http://http.us.debian.org/debian/dists/${DISTRO_COMPAT_VERSION}/non-free/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-non-free
z|http://http.us.debian.org/debian/dists/${DISTRO_COMPAT_VERSION}/contrib/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-contrib
z|http://deb-multimedia.org/dists/${DISTRO_COMPAT_VERSION}/main/binary-${DBIN_ARCH}/Packages.${DDB_COMP}|Packages-debian-${DISTRO_COMPAT_VERSION}-multimedia
z|https://deb.torproject.org/torproject.org/dists/stretch/main/binary-${DBIN_ARCH}/Packages.gz|Packages-Tor-debian-stretch
"
and I'm getting the error:

/var/woof

Code: Select all

This is a report on the last time the '0setup' script was run.
Date and time '0setup' last run: Sat Nov 17 20:16:55 MST 2018
Compatible-distro and release-name: debian, stretch
Mostly only errors get logged, so the less seen below, the better.
Log of last run of '0setup':


	Failed to download db file: 
	 https://deb.torproject.org/torproject.org/dists/stretch-updates/main/binary-i386/Packages.gz
	...exited from 0setup script.
and I'm getting this error because the function 0setup is chaing "stretch" to "stretch-updates" on me!

hmmm... a workaround may be to use URL encoding :)

Edit: the url encoding prevented the substitution. However, the server didn't like the path:

Code: Select all

https://deb.torproject.org/torproject.org/dists%2Fstretch/main/binary-i386/
I could work around this by using a proxy server that modifies an encoded path. I could use Nginx as the proxy server.

Alternatively I could modify 0setup.I'll have to think about how I want to do the latter. The proxy server approach is probably faster.

Edit #2 Maybe I can translate an encoded url in 0setup. This way the script would know not to do the translation if the url is encoded.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#3 Post by s243a »

I opened the basesfs for view and did:

Code: Select all

# find . -name '0setup'
./usr/local/petget/0setup
Now that I know where the file is located I can modify it to translate URL encoding after the following translation

Code: Select all

-e "s|/${DISTRO_COMPAT_VERSION}/|/${DISTRO_COMPAT_VERSION}-updates/|"
https://github.com/puppylinux-woof-CE/w ... setup#L313

is done so that the path isn't changed in encoded URLs.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#4 Post by s243a »

Okay, I successfully added the tor repo to my puppy package manager. Aside from the changes to

Code: Select all

/root/.packages/DISTRO_COMPAT_REPOS 
I changed line #303 of /usr/local/petget/0setup from:

Code: Select all

download_compat_pkg_dbs $PKG_DOCS_DISTRO_COMPAT #---
to

Code: Select all

Decoded_PKG_DOCS_DISTRO_COMPAT=$(echo $PKG_DOCS_DISTRO_COMPAT | sed -e "s|%2F|/|")
download_compat_pkg_dbs $Decoded_PKG_DOCS_DISTRO_COMPAT # $PKG_DOCS_DISTRO_COMPAT #---
This removes my encoding of one of the slashes before puppy tries to download the package database from the repo.

Then I also
changed lines #311 to #314 from:

Code: Select all

   PKGLISTS_COMPAT_U=$(echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | grep -v 'deb-multimedia' | \
     sed -e "s|-${DISTRO_COMPAT_VERSION}-|-${DISTRO_COMPAT_VERSION}_updates-|" \
         -e "s|/${DISTRO_COMPAT_VERSION}/|/${DISTRO_COMPAT_VERSION}-updates/|")
to

Code: Select all

   PKGLISTS_COMPAT_U=$(echo "$PKG_DOCS_DISTRO_COMPAT" | tr ' ' '\n' | grep -v 'deb-multimedia' | \
     grep -v '%2F' |
     sed -e "s|-${DISTRO_COMPAT_VERSION}-|-${DISTRO_COMPAT_VERSION}_updates-|" \
         -e "s|/${DISTRO_COMPAT_VERSION}/|/${DISTRO_COMPAT_VERSION}-updates/|")
the %2F is being used as a flag for repos that don't have a second -upadate associated with them. These items are removed with the "grep -v '%2F' "

A better way to do this would be to verify that each link is valid in PKGLISTS_COMPAT_U before passing the list to the function download_compat_pkg_dbs

The reason being is that there should be nothing abnormal about a repo not have a second -update repo associated with it so it shouldn't crash the whole process of updating the package databases.

Post Reply