Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AUTOMAGICALLY unmask installed unstable packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
dreamer3
Guru
Guru


Joined: 24 Sep 2002
Posts: 553

PostPosted: Wed Dec 11, 2002 1:31 am    Post subject: AUTOMAGICALLY unmask installed unstable packages Reply with quote

Do you run a few unstable (~x86) or masked (package.mask) packages? Tired of weeding through them when you do emerge -up world... I always have to look carefully, remember the OLD versions of stuff and then emerge by hand the new things so my old things don't get overwritten...

The new D (for downgrade) feature of portage 2.45 is pretty sweet, but it still can create a long cluttered update list. I'd thought maybe there would be a new flag to not display or offer to update (read: down-date) those pacakges, but I haven't heard tell of such a beast.

So I wrote this simple script... It automatically unmaskes ~x86 masked packages, but you have to provide it a list of lines from your package.mask file to comment out...

Sounds like a pain for KDE and other large packages but it does use sed to process each of these lines, so regular expressions could be used to help out. If anyone would like to use this as part of an automated update script (I know some people have emerge -up world in their crontab) and you have KDE or Gnome unstable installed I'd by happy to show you what you'd need to place in the unmask variable for it to work... on the other hand, copying and pasting from package.mask prolly isn't all that hard either...

I haven't found this super useful yet (because I NEVER do unattended or even attended emerge -u world), but it does make a much nicer update list to look at...

Code:
# unmask v0.01
# entires in your package mask that you want unmasked
unmask=">=net-mail/evolution-1.1.90
        >=gnome-extra/gtkhtml-1.1.4
        =app-text/gnome-spell-0.5"

packs=` find /var/db/pkg/ -iname '*.ebuild' -exec grep 'KEYWORDS=".*~x86' -H {} \
; | cut -d/ -f5,6 | sed -e "s:\(.*\)/\(.*\)\(-[0-9]\):\1/\2/\2\3:"     `
#echo ${packs}
for pkg in ${packs}; do
        ebuild="/usr/portage/${pkg}.ebuild"
        echo [ E ] ${pkg}...
        sed -e "s:\(KEYWORDS=\".*\)~x86:\1x86:" ${ebuild} > /tmp/work.ebuild
        mv /tmp/work.ebuild ${ebuild}
done

cp /usr/portage/profiles/package.mask /tmp/package.mask
for mask in ${unmask}; do
        cat /tmp/package.mask | sed -e "s:\(${mask}$\):#\1   # auto-commented by
unmask.sh:" > /tmp/package.mask2
        mv /tmp/package.mask2 /tmp/package.mask
        echo [ M ] ${mask}
done
mv /tmp/package.mask /usr/portage/profiles/package.mask
Back to top
View user's profile Send private message
phong
Bodhisattva
Bodhisattva


Joined: 16 Jul 2002
Posts: 778
Location: Michigan - 15 & Ryan

PostPosted: Wed Dec 11, 2002 4:02 am    Post subject: Reply with quote

This looks useful... This isn't really a support question - I'm moving it from Portage and Programming to Documentation tips and tricks.
_________________
"An empty head is not really empty; it is stuffed with rubbish. Hence the difficulty of forcing anything into an empty head."
-- Eric Hoffer
Back to top
View user's profile Send private message
dreamer3
Guru
Guru


Joined: 24 Sep 2002
Posts: 553

PostPosted: Wed Dec 11, 2002 4:22 am    Post subject: Reply with quote

phong wrote:
This looks useful... This isn't really a support question - I'm moving it from Portage and Programming to Documentation tips and tricks.

Sorry, I thought since both the tools were Portage related that that would be the right place. I'll put future tools and tips in Documentation...
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
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