Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 11 Dec 2018, 03:31
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Puppy Equivalent of apt-key add - ???
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
s243a

Joined: 02 Sep 2014
Posts: 1305

PostPosted: Sat 17 Nov 2018, 19:21    Post subject:  Puppy Equivalent of apt-key add - ???  

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:

# 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 Sad. 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:

/usr/local/petget/README-add-repo.htm


I had in
/root/.packages/DISTRO_COMPAT_REPOS
Code:

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
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1305

PostPosted: Sun 18 Nov 2018, 00:21    Post subject:  

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:

   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/woof-CE/blob/2a40f51c184bf878602996e4141efd8e2858c9e2/woof-code/0setup#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:

/root/.packages/DISTRO_COMPAT_REPOS

so that it only needs to be applied where applicable?

In
Code:

/root/.packages/DISTRO_COMPAT_REPOS

I have

Code:
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:

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 Smile

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

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.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1305

PostPosted: Sun 18 Nov 2018, 01:06    Post subject:  

I opened the basesfs for view and did:

Code:

# 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:

-e "s|/${DISTRO_COMPAT_VERSION}/|/${DISTRO_COMPAT_VERSION}-updates/|"

https://github.com/puppylinux-woof-CE/woof-CE/blob/2a40f51c184bf878602996e4141efd8e2858c9e2/woof-code/0setup#L313

is done so that the path isn't changed in encoded URLs.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 1305

PostPosted: Sun 18 Nov 2018, 04:13    Post subject:  

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

/root/.packages/DISTRO_COMPAT_REPOS

I changed line #303 of /usr/local/petget/0setup from:
Code:

download_compat_pkg_dbs $PKG_DOCS_DISTRO_COMPAT #---

to
Code:

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:

   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:

   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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1266s ][ Queries: 12 (0.0332s) ][ GZIP on ]