Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Portage utility: bumper
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sun Aug 03, 2003 4:18 am    Post subject: Portage utility: bumper Reply with quote

I wrote a utility for portage named "bumper".

You notice that version 2.0 is out for your favorite software, but portage only has 1.0 (foobar-1.0.ebuild) and you want it now.

bumper will copy the 1.0 ebuild to your portage overlay directory, creating the necessary directories, and name it foobar-2.0.ebuild. It will then create a digest, which will also download the new package. It also copies any non-digest files in ${FILESDIR}.

Its a Python script you can get here:
http://dev.gentoo.org/~pythonhead/bumper/bumper-0.0.10

Usage:

Code:
bumper app-games/pacman-1.0 2.0


Its also useful for simply copying an ebuild from your PORTDIR to your overlay (no version bump) for editing. Just use the same version number:
Code:
bumper apps-foo/boo-1.0 1.0


Last edited by Pythonhead on Sun Mar 06, 2005 5:10 am; edited 12 times in total
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Sun Aug 03, 2003 3:28 pm    Post subject: Reply with quote

Moved from Portage & Programming.
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Sun Aug 03, 2003 3:39 pm    Post subject: Reply with quote

wouldnt it be better as a bash script?

ie:
Code:
<get PORTAGE_OVERLAY from make.conf using some obsfusticated sed command>
cp $1 overlay/$2 etc /w name changes
ebuild <new ebuild> digest
emerge <ebuild>

why python?
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Sun Aug 03, 2003 3:46 pm    Post subject: Reply with quote

Neat! I think this calls for a request!
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sun Aug 03, 2003 4:51 pm    Post subject: Reply with quote

TheCoop wrote:
wouldnt it be better as a bash script?


What difference does the language matter as long as it works?

Quote:


ie:
Code:
<get PORTAGE_OVERLAY from make.conf using some obsfusticated sed command>
cp $1 overlay/$2 etc /w name changes
ebuild <new ebuild> digest
emerge <ebuild>

why python?


Well, thats nice pseudo-code, but my Python psudeo-code looked about the same before I actually wrote the finished code. Look at all the error checking in my code.

Why Python? It sounds better than "bash".

Write in in bash if it'll make you feel better.


Last edited by Pythonhead on Sun Aug 03, 2003 4:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Sun Aug 03, 2003 4:58 pm    Post subject: Reply with quote

It kinda pukes with something like:
Code:
bumper app-misc/blah-1.0.1-r1 blah-2.0
It trys to look in app-misc/blah-1.0.1/
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sun Aug 03, 2003 5:20 pm    Post subject: Reply with quote

floam wrote:
It kinda pukes with something like:
Code:
bumper app-misc/blah-1.0.1-r1 blah-2.0
It trys to look in app-misc/blah-1.0.1/


Thanks Floam!

EDIT: Fixed in version 0.0.2, same link in first post.
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Mon Aug 04, 2003 1:44 am    Post subject: Reply with quote

Also gets messed up if people have multiple PORTDIR_OVERLAY's. In recent versions of portage it is legal to do a
PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage2" or similar, which I happen to use. Could the script only use the first directory? Right now it dies with a Couldn't copy file error.
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Aug 04, 2003 2:40 am    Post subject: Reply with quote

floam wrote:
Also gets messed up if people have multiple PORTDIR_OVERLAY's. In recent versions of portage it is legal to do a
PORTDIR_OVERLAY="/usr/local/portage /usr/local/portage2" or similar, which I happen to use. Could the script only use the first directory? Right now it dies with a Couldn't copy file error.


Ok, thanks for the heads up. I didn't know you could use more than one PORTDIR_OVERLAY. It would be easy enough to fix it to check the first one, but let me read up on it and see why people would use two. Was this announced somewhere? I'd like to be a little more informed before I change it.

How does portage use it? Does the first one take precedence over the second?
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Mon Aug 04, 2003 4:54 am    Post subject: Reply with quote

PythonHead: You see a few mentions of it in the portage changelog. The first takes precidence. I use it because I have a script that does some weird stuff there to specific ebuilds and I don't want it affecting my real overlay. People could also use it to sync up with like the breakmygentoo.net development gnome stuff and able to keep it seperate, and stuff like that. It's a very little used feature.
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Aug 04, 2003 6:17 am    Post subject: Reply with quote

floam wrote:
PythonHead: You see a few mentions of it in the portage changelog. The first takes precidence. I use it because I have a script that does some weird stuff there to specific ebuilds and I don't want it affecting my real overlay. People could also use it to sync up with like the breakmygentoo.net development gnome stuff and able to keep it seperate, and stuff like that. It's a very little used feature.


Ok, good enough. I'll go update it to use the first one in the list.
Back to top
View user's profile Send private message
wizy
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2002
Posts: 133

PostPosted: Mon Aug 04, 2003 1:59 pm    Post subject: nice Reply with quote

This is great. I do this by hand a lot of the time, thank you.
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Mon Aug 04, 2003 3:05 pm    Post subject: Re: nice Reply with quote

wizy wrote:
This is great. I do this by hand a lot of the time, thank you.


Thank you.

Version 0.3 is ready and fixes the multiple overlay directory bug, thanks Floam.

http://abeni.sourceforge.net/ebuilds/bumper-0.3
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Wed Aug 06, 2003 5:47 am    Post subject: Reply with quote

Thanks! Works almost great now :) One more suggestion, since many ebuilds have patches and stuff they need in the /files/ dir, maybe you should copy that over to overlay as well?
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Wed Aug 06, 2003 5:55 am    Post subject: Reply with quote

floam wrote:
Thanks! Works almost great now :) One more suggestion, since many ebuilds have patches and stuff they need in the /files/ dir, maybe you should copy that over to overlay as well?


Ok, I'll test that out. I'm not sure how well that will work since the names of patches are tied to the version number. It'd be some trick to guess the patch names, since there isn't a standard. If it doesn't work out, I'll have a message showing the files that were copied that aren't digests.

Thanks for the suggestion.
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Wed Aug 06, 2003 6:39 am    Post subject: Reply with quote

Yeah, you can't really be sure itll always work, but just moving /files/ over and then basically s/oldversion/newversion/'ing all the filenames seems like it would work a good percent of the time.
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sun Aug 17, 2003 6:48 am    Post subject: Reply with quote

Bumper 0.4 is ready for testing:

From the ChangeLog:

- Changed delimiter for PORTDIR_OVERLAY from space to colon.
https://bugs.gentoo.org/show_bug.cgi?id=10803
https://bugs.gentoo.org/show_bug.cgi?id=26773
- Copy non-digest files from ${FILESDIR}
- More error checking for env vars, warn and exit if no PORTDIR_OVERLAY
- Exits if user isn't root
Back to top
View user's profile Send private message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 741
Location: Barcelona, Spain

PostPosted: Wed Sep 03, 2003 7:18 am    Post subject: nice Reply with quote

pythonhead rules!
thanks, nice app :D (also for learning python)
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Sat Oct 25, 2003 3:43 am    Post subject: Reply with quote

Code:
( floam  ~ ) bumper enchant-1.0.0 enchant-1.1.1
Traceback (most recent call last):
  File "/usr/bin/bumper", line 99, in ?
    cat, p = ebuild_from.split("/")
ValueError: unpack list of wrong size

_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Sat Oct 25, 2003 3:52 am    Post subject: Reply with quote

floam wrote:
Code:
( floam  ~ ) bumper enchant-1.0.0 enchant-1.1.1
Traceback (most recent call last):
  File "/usr/bin/bumper", line 99, in ?
    cat, p = ebuild_from.split("/")
ValueError: unpack list of wrong size


You should be using this instead:
Code:
bumper app-text/enchant-1.0.0 enchant-1.1.1


I'll fix it so it shows the usage message though, thanks.
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Tue Jun 15, 2004 2:14 am    Post subject: Reply with quote

Version 0.5 is out and works with newer versions of portage. The code is cleaned up a bit thanks to the use of gentoolkit.py now.

EDIT
0.6 is ready for testing due to major problem in 0.5:

http://dev.gentoo.org/~pythonhead/bumper-0.6
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Sun Jun 27, 2004 11:01 pm    Post subject: Reply with quote

I think "0.0.4 - Changed delimiter for PORTDIR_OVERLAY from space to colon." was incorrect. While the portage documentation says a colon should be used, looking in the source shows that it actually uses a space to seperate multiple overlays. Trying to use colons will cause in an error:
Code:
( floam@Aluminium ~ ) emerge -puD world
!!! Invalid PORTDIR_OVERLAY (not a dir): /usr/local/overlays/personal/:/usr/local/overlays/public

_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
JasonRogers
n00b
n00b


Joined: 21 Jul 2004
Posts: 7

PostPosted: Wed Jul 21, 2004 1:11 pm    Post subject: problems with 0.6 Reply with quote

2 problems actually.
First, I had to change line#53
Code:

+++ l = os.listdir(package_path)
--- l = os.listdir(pacakge_path)

Second, I get this error trying to bump resin-2.1.9 which is located in net-www/resin
Code:

# bumper net-www/resin-2.1.9 3.0.8
!!! aux_get(): ebuild for 'net-www/resin-resin-3.0.8' does not exist at:
!!!            /usr/portage/net-www/resin-resin/resin-resin-3.0.8.ebuild
Error - Can't find ebuild for net-www/resin-2.1.9

Give the category and ebuild name in this format:
bumper games-arcade/pacman-0.1 0.2


So I thought that perhaps I need to just use 'resin' instead of 'resin-2.1.9', but then I get this error.
Code:

eanus resin # bumper net-www/resin 3.0.8
!!! aux_get(): ebuild for 'net-www/resin-resin-3.0.8' does not exist at:
!!!            /usr/portage/net-www/resin-resin/resin-resin-3.0.8.ebuild
Error - Can't find ebuild for net-www/resin

Give the category and ebuild name in this format:
bumper games-arcade/pacman-0.1 0.2


What's with the '/usr/portage/net-www/resin-resin/resin-resin-3.0.8.ebuild'? Shouldn't it be '/usr/portage/net-www/resin/resin-3.0.8.ebuild'?
_________________
Jason Rogers

"I am crucified with Christ: nevertheless I live; yet not I, but Christ liveth in me: and the life which I now live in the flesh I live by the faith of the Son of God, who loved me, and gave himself for me."
Galatians 2:20
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Tue Sep 14, 2004 3:51 am    Post subject: Reply with quote

floam wrote:
I think "0.0.4 - Changed delimiter for PORTDIR_OVERLAY from space to colon." was incorrect. While the portage documentation says a colon should be used, looking in the source shows that it actually uses a space to seperate multiple overlays. Trying to use colons will cause in an error:
Code:
( floam@Aluminium ~ ) emerge -puD world
!!! Invalid PORTDIR_OVERLAY (not a dir): /usr/local/overlays/personal/:/usr/local/overlays/public


Thanks, changed to space.
Back to top
View user's profile Send private message
Pythonhead
Developer
Developer


Joined: 16 Dec 2002
Posts: 1801
Location: Redondo Beach, Republic of Calif.

PostPosted: Tue Sep 14, 2004 3:54 am    Post subject: Reply with quote

JasonRogers, sorry, guess I should watch my own threads. I fixed the typo in the latest version:

http://dev.gentoo.org/~pythonhead/bumper/bumper-0.0.8

As for the second problem, I'm not sure what happened, but you may have been caught when they were changing categories? I see resin is in www-servers now, not net-www.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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