Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How does quickpkg work?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Sep 25, 2018 4:22 am    Post subject: How does quickpkg work? Reply with quote

I was considering how to throw together a starting point for a basic package tool, and I thought I'd take a look at quickpkg to get an idea.

Two questions.

First, what kind of witchcraft is this?
Code:
$ which quickpkg
/usr/bin/quickpkg
$ ls -ld /usr/bin/quickpkg
lrwxrwxrwx 1 root root 31 Sep 17 14:40 /usr/bin/quickpkg -> ../lib/python-exec/python-exec2


Second, how does quickpkg work? :)

I was mainly curious to see if/how it called tar or used a library.

Understanding the binary package format wrote:
Binary packages created by Portage have the file name ending with .tbz2. These files consist of two parts:
A .tar.bz2 archive containing the files that will be installed on the system.
A xpak archive containing package metadata, the ebuild, and the environment file.
See man xpak for a description of the format.
Since xpak appears to only contain metadata, I don't think I need that.

I don't think it matters, but in case it does, this is initially for managing kernels, but eventually more generic. Once I get it working for kernels, I'll mess with a "mini distro" to better familiarize myself with that. I'm not looking for any dependency management, etc., simply "install this package." Unless of course that's a horribly misguide thing to do even for something this simple.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Josef.95
Advocate
Advocate


Joined: 03 Sep 2007
Posts: 4553
Location: Germany

PostPosted: Tue Sep 25, 2018 5:15 am    Post subject: Reply with quote

Quote:
First, what kind of witchcraft is this?
quickpkg is from sys-apps/portage
Code:
equery f portage | grep quickpkg
/usr/bin/quickpkg
/usr/lib/python-exec/python2.7/quickpkg
/usr/lib/python-exec/python3.6/quickpkg
/usr/share/man/man1/quickpkg.1.bz2
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Tue Sep 25, 2018 9:18 am    Post subject: Reply with quote

pjp,

python-exec is a wrapper around all things python in Gentoo.
You can run everything without using python-exec, like you would if you mistakenly removed it. That breaks emerge.

Take care installing tarballs produced by quickpkg. Optionally, they can include the configuration files from your installed system.
That would be a verybadthing for some packages.
Consider the effect of accidentally distributing /etc/shadow, or your net file if it specifies MAC addresses. You will be able to think of other examples.
You have a whole new world of pain awaiting.

Making binary packages at build time gets you clean config files and you can still install them with tar.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Sep 25, 2018 9:24 am    Post subject: Re: How does quickpkg work? Reply with quote

pjp wrote:
First, what kind of witchcraft is this?

pjp ... 'python-exec2' calls '/usr/lib*/python-exec/python-$version/quickpkg

pjp wrote:
I'm not looking for any dependency management, etc., simply "install this package." Unless of course that's a horribly misguide thing to do even for something this simple.

I'm not really sure why you need a "package manager" then, when all you require of it is 'tar xvf foo.tar.bz2 -C /path'.

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Tue Sep 25, 2018 9:44 am    Post subject: Reply with quote

khayyam,

Does tar xvf preserve permissions too?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Sep 25, 2018 9:51 am    Post subject: Reply with quote

NeddySeagoon wrote:
Does tar xvf preserve permissions too?

NeddySeagoon ... yes, if '-p,--preserve-permissions' is used, or is that a rhetorical question?

best ... khay
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6098
Location: Dallas area

PostPosted: Tue Sep 25, 2018 10:05 am    Post subject: Reply with quote

if the superuser (root) uses tar then permissions are preserved automatically re. the man page, otherwise add the flag re. khayyams post
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Tue Sep 25, 2018 10:22 am    Post subject: Reply with quote

Anon-E-moose,

Thank you for responding to the question I really intended to ask.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Sep 25, 2018 3:10 pm    Post subject: Reply with quote

NeddySeagoon wrote:
python-exec is a wrapper around all things python in Gentoo.
You can run everything without using python-exec, like you would if you mistakenly removed it. That breaks emerge.
I was thinking it might have been something like that, but the warning at the top of python-exec threw me off ("This is not the script you are looking for"). Not being a developer, the few times I've tried poking a stick at code related to portage, my initial reaction has been laws and sausages.

NeddySeagoon wrote:
Take care installing tarballs produced by quickpkg. Optionally, they can include the configuration files from your installed system.
That would be a verybadthing for some packages.
Consider the effect of accidentally distributing /etc/shadow, or your net file if it specifies MAC addresses. You will be able to think of other examples.
You have a whole new world of pain awaiting.

Making binary packages at build time gets you clean config files and you can still install them with tar.
Thanks for the warning. I don't have any plans to use quickpkg, I just thought it might have been an easy reference point.



khayyam wrote:
'python-exec2' calls '/usr/lib*/python-exec/python-$version/quickpkg
Seems the "python" in the name made me think it was a python tool, not a portage tool written in python. When I looked at /usr/lib/python-exec/, I was expecting its subdirectories to be populated more like /usr/lib/python* subdirectories. I will try to remember to verify next time.

khayyam wrote:
I'm not really sure why you need a "package manager" then, when all you require of it is 'tar xvf foo.tar.bz2 -C /path'.
I may not, that's partly why I asked. Although package selection would seem to be included in package management, so I'll ultimately end up with something slightly less manual than type tar.



Anon-E-moose wrote:
if the superuser (root) uses tar then permissions are preserved automatically re. the man page, otherwise add the flag re. khayyams post
Somewhere along the way I got into the habit of always using -p. I'm not sure if I ever realized permissions were preserved as root. Perhaps that hasn't always been the behavior across *nix?



Thanks. I'll stick with tar.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
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