Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unmask script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Fri Mar 21, 2003 6:36 pm    Post subject: Unmask script Reply with quote

For whatever reason, the gentoo developers seem to throw everything into package.mask - though on some rare occasions, they'll use the ~x86, seemingly at random. I'd much rather have something else - `x86 perhaps - which is used for beta programs, in addition to the ~x86 for experimental ones.

Thus, to fix my problem, a couple months ago I got fed up enough. Every time I `emerge rsync', it replaces the package.mask file, which I had, of course, changed. Then, the several packages that I've unmasked are of course masked again, and the few masks that I added myself for packages that aren't working for me are removed. So, it made an `emerge rsync' a painstaking process - so I wrote a script called 'unmask', which simply had a big perl regular expression for unmasking packages, and a list of packages to add to the end of package.mask. After each emerge rsync, I'd just run my script and I'd have all the unwanted masks commented out, and all the wanted ones added back in.

It worked for me for a couple months (I unmask about 25 packages, and mask 8), until a friend of mine decided to write something much more sophisticated (it beats me as to why, since he just adds two masks, but he did). This new one is far more sophisticated in that it doesn't simply have a list of things in the file, as mine did, but it performs a merge of /usr/local/portage/profiles/package.mask and the /usr/portage/profiles/package.mask.

Since there is no way to attach a file to a post (hint, hint, forum maintainers), I've put it up here:

http://www.gforum.org/unmask

It requires perl, PORTDIR_OVERLAY enabled, and a $PORTDIR_OVERLAY/profiles/package.mask file.

Here is my sample /usr/local/portage/profiles/package.mask file:

Code:

# Don't want to deal with this yet
>=dev-perl/mod_perl-1.99
# Don't want to deal with this yet
>=net-www/apache-2
# The ATI drivers don't support this yet
>=x11-base/xfree-4.2.99
# Can't emerge this until I find a new working kernel
>=sys-apps/lm_sensors-2.7.0
# Broken kernel
=sys-kernel/gentoo-sources-2.4.20-r1
# won't compile. Darn.
=app-text/docbook-sgml-utils-0.6.12
# Doesn't compiled (missing semicolons!? Who releases these ebuilds??)
=net-fs/samba-2.2.8_pre1
# Reports speed as -inf
>=sys-apps/hdparm-5.3

# <azarah@gentoo.org> (07 Jan 2003)
# new alpha release.  do not use tmpfs by default for dep cache, and
# move dep cache dir to /var/state/init.d.  also some raid updates.
!>=sys-apps/baselayout-1.8.6.0
#!=sys-apps/baselayout-1.8.6.1
#!=sys-apps/baselayout-1.8.6.2
#!=sys-apps/baselayout-1.8.6.3
#!=sys-apps/baselayout-1.8.6.4

# <phoenix@gentoo.org> (21 Nov 2002)
# The huge nsplugins mask. These plugins use
# the new layout (/usr/lib/nsbrowser/plugins)
# and should work in both mozilla and phoenix.
!=app-text/acroread-5.06-r2
!=net-www/netscape-flash-6.0b-r1
!=net-www/netscape-plugger-4.0-r2
!=media-video/realplayer-8-r3
!=app-text/djvu-3.5.9-r1
!=dev-java/sun-jdk-1.4.1.01-r1
!=dev-java/sun-jdk-1.3.1.06-r1
!=dev-java/ibm-jdk-1.4.0-r2
!=dev-java/ibm-jre-1.4.0-r2
!=dev-java/ibm-jdk-1.3.1-r2
!=dev-java/ibm-jre-1.3.1-r2

# MySQL 4
!>=dev-db/mysql-4.0.1_alpha

# Gtk2 version of glade:
!>=dev-util/glade-1.1.0
!>=dev-util/glademm-1.1.0

# gimp-1.3 supports perl 5.8 (1.2 does not)
!>=media-gfx/gimp-1.3.5

# evolution beta and friends. may cause breakage!
!>=net-mail/evolution-1.3.1
!>=gnome-extra/gal-1.99
!>=app-text/gnome-spell-1.0
!>=gnome-extra/gtkhtml-3.0
!>=gnome-extra/libgtkhtml-3.0
!>=net-libs/libsoup-1.99

# depends on moz gtk2 which is not well tested yet
!>=net-www/galeon-1.3.2


The items with a leading ! indicate something for the script to unmask, otherwise the mask is added to the normal packages.mask file. What's interesting to note is this:

!>=sys-apps/baselayout-1.8.6.0

That does just what you expect it to do - it unmasks any baselayout mask that applies to 1.8.6.0 or above (thus actually unmasking 5 lines in the file).

Please download it, and give it a try - I saved it to /usr/local/bin/unmask, but anywhere in your path will work. If you use sudo, as I do, it'll let you run it as a user; otherwise you have to be root.
Back to top
View user's profile Send private message
bsolar
Bodhisattva
Bodhisattva


Joined: 12 Jan 2003
Posts: 2764

PostPosted: Fri Mar 21, 2003 7:03 pm    Post subject: Reply with quote

That's interesting, and you might want to write a report in bugzilla. It's the right place to propose improvments of portage.
_________________
I may not agree with what you say, but I'll defend to the death your right to say it.
Back to top
View user's profile Send private message
axxackall
l33t
l33t


Joined: 06 Nov 2002
Posts: 651
Location: Toronto, Ontario, 3rd Rock From Sun

PostPosted: Fri Mar 21, 2003 7:22 pm    Post subject: Reply with quote

Excelent implementation! I did something similar with my home-made scripts (same concept with custom masks in OVERLAY), planning to generalize it. But now I'll throw it away. Your way is much better.

I recommend you to submit it to bugzilla - perhaps they will include it into gentoolkit. Many users will appreciate it. If you are in doubts about users - use a Poll in the chat forum.
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Fri Mar 21, 2003 8:02 pm    Post subject: Reply with quote

axxackall wrote:
I recommend you to submit it to bugzilla - perhaps they will include it into gentoolkit.

Done!

https://bugs.gentoo.org/show_bug.cgi?id=17952
Back to top
View user's profile Send private message
bline
n00b
n00b


Joined: 17 Oct 2002
Posts: 2
Location: Vancouver

PostPosted: Fri Mar 21, 2003 8:51 pm    Post subject: Re: Unmask script Reply with quote

jagerman wrote:
(it beats me as to why, since he just adds two masks, but he did).


Hey, I plan on adding more later...
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Fri Mar 21, 2003 9:18 pm    Post subject: Re: Unmask script Reply with quote

bline wrote:
Hey, I plan on adding more later...


I was just messing around (my original unmask script was just a big hack, and a nuissance to add to) - hopefully this'll make it into gentoolkit.
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Mon Mar 24, 2003 3:41 am    Post subject: Reply with quote

I've uploaded an updated version, with a few changes - such as comments, and I switched it to use '/usr/lib/portage/bin/portageq' instead of parsing 'emerge info' - but unfortunately it makes it slow because each call takes about half a second - on my Athlon 3000++ system. Nice fast Python. :evil:
Back to top
View user's profile Send private message
NeGz
n00b
n00b


Joined: 11 Mar 2003
Posts: 4
Location: Perth, WA

PostPosted: Wed Jul 16, 2003 9:57 pm    Post subject: Reply with quote

That's the most useful thing I've seen all day, thanks jagerman and co.
Works well for masking the latest baselayout quickly after an emerge sync, since it breaks glftpd's zipscript for me.

As mentioned earlier, this would be very handy built into portage, perhaps as emerge --unmask sync, or just something it does as standard, though emerge sync && unmask works fine for now. :)
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Wed Jul 16, 2003 10:22 pm    Post subject: Reply with quote

NeGz wrote:
As mentioned earlier, this would be very handy built into portage, perhaps as emerge --unmask sync, or just something it does as standard, though emerge sync && unmask works fine for now. :)


Given the direction Gentoo seems to be taking lately*, I doubt this will ever making it into emerge. A gentoolkit tool, perhaps, but emerge is doubtful.

* This is my feeling of late - developers are slow to release new or updated ebuilds, and experimental packages/releases are officially "BAD" - witness the CVS package purge, for example. ~x86 tends to be the "testing" phase of packages, rather than the "experimental" phase it was meant to be. Don't get me wrong - I still think Gentoo's above any other distribution, but it's losing some of the "cool" factor by going more mainstream in packages and development. :( I guess that's what happen when things get bigger. :cry:
Back to top
View user's profile Send private message
robmoss
Retired Dev
Retired Dev


Joined: 27 May 2003
Posts: 2634
Location: Jesus College, Oxford

PostPosted: Thu Jul 17, 2003 2:22 am    Post subject: Reply with quote

I take it you know about /etc/portage/package.unmask?

However, I must say, I've been getting increasingly irritated at the fact that I'm unable to mask multiple (or even all) versions of specific packages myself. This should be very useful, and hopefully a little easier to work with than my rather confusing concatenation of sed-based shell scripts. Thanks! :D
Back to top
View user's profile Send private message
TGL
Bodhisattva
Bodhisattva


Joined: 02 Jun 2002
Posts: 1978
Location: Rennes, France

PostPosted: Sat Jul 19, 2003 4:37 pm    Post subject: Reply with quote

robmoss2k wrote:
However, I must say, I've been getting increasingly irritated at the fact that I'm unable to mask multiple (or even all) versions of specific packages myself.


With portage-2.0.48-*, you can create a custom mask file, named /etc/portage/profiles/package.mask. Syntax is the same as the /usr/portage/profiles/package.mask, think of it as if it was concatenate to the official mask (actually, it's nearly what is done). With portage-2.0.49_pre*, it should be named /etc/portage/package.mask, which is more consistent with the package.unmask.[/i]
Back to top
View user's profile Send private message
jagerman
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jun 2002
Posts: 104
Location: Vancouver, BC, Canada

PostPosted: Sat Jul 19, 2003 10:36 pm    Post subject: Reply with quote

The /etc/portage/package.{mask,unmask} files (2.0.49_pre) are pretty nice; I've stopped using the unmask script above in favour of them. It doesn't do everything the unmask script does, but it does what I need nontheless. I only wish it was documented somewhere (perhaps creating empty package.mask/unmask files with descriptive comments at the top) as to exactly what the files do (hint, hint).
Back to top
View user's profile Send private message
xlyz
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1470
Location: Italy

PostPosted: Tue Jul 29, 2003 7:47 pm    Post subject: Reply with quote

I feel dumb but I'm not able to use package.unmask

does it work with latest stable portage (currently 2.0.48-r5)? how?

EDIT ****

never mind, I were dumb. I was just using > instead of < :oops:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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