View previous topic :: View next topic |
Author |
Message |
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Mon Sep 27, 2004 2:41 am Post subject: Feedback wanted: portage config validator |
|
|
Ok, as we had several bug reports caused by broken config files or wrong permissions I though I'd write a little script to check for those errors, so we don't have to look for non-existant bugs in portage. It's available at http://dev.gentoo.org/~genone/scripts/portage_syntax_checker.py This is a very early version and only checks some files (it doesn't touch the cache or the package database for example) but I want to see if there are any problems with the existing checks, so I encourage everyone to test it and report feedback here (not on bugs.gentoo.org) if it reports a problem and you think it's wrong.
Edit: Sticky --ian!
pjp: Unstuck. Script hasn't been modified since 2004.
Last edited by Genone on Mon Sep 27, 2004 5:06 am; edited 1 time in total |
|
Back to top |
|
|
Halcy0n Developer
Joined: 17 Sep 2003 Posts: 1682 Location: Freehold, NJ
|
Posted: Mon Sep 27, 2004 2:44 am Post subject: |
|
|
Looks nice. Its not nice to run it and see it report errors with files I didn't create, like /usr/portage/profiles/package.mask though
Code: | checking file /usr/portage/profiles/package.mask
ERROR: syntax check failed on line 27:
>=dev-util/cvs-1.12*
WARNING: no category found, this affects performance:
=amarok-1.1_beta2
ERROR: syntax check failed on line 331:
>=net-nds/openldap-2.2* |
_________________ Mark Loeser
http://www.halcy0n.com |
|
Back to top |
|
|
Pythonhead Developer
Joined: 16 Dec 2002 Posts: 1801 Location: Redondo Beach, Republic of Calif.
|
Posted: Mon Sep 27, 2004 3:16 am Post subject: |
|
|
The url to your script is wrong (has a '.' at the end)
Quote: |
localhost ~ # portage_syntax_checker.py
Checking file permissions ...
ERROR: permission problem with file /var/lib/portage/world (uid: 0, gid: 0, mode: 0040)
please fix those permission errors first
|
How about adding something telling us what permissions we should be using? |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Mon Sep 27, 2004 5:08 am Post subject: |
|
|
I've already fixed the errors in package.mask.
URL corrected (blame phpBB).
Permission problem = not readable by the portage group. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20092
|
Posted: Mon Sep 27, 2004 8:30 pm Post subject: |
|
|
I removed any faulty entries that I made in /etc/portage. Here are the results: Code: | Checking file permissions ... done
checking file /etc/portage/package.mask
checking file /etc/portage/package.unmask
checking file /etc/portage/package.keywords
checking file /var/lib/portage/world
checking file /usr/portage/profiles/package.mask
checking file /usr/portage/profiles/arch.list
checking file /usr/portage/profiles/default-amd64-2004.2/virtuals
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/sh-utils sys-apps/coreutils
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/textutils sys-apps/coreutils
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/fileutils sys-apps/coreutils
WARNING: non-virtual used as virtual, might cause problems:
x11-libs/xaw x11-libs/Xaw3d
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/reiserfs-utils sys-fs/reiserfsprogs
checking file /usr/portage/profiles/default-amd64-2004.2/use.mask
ERROR: syntax check failed on line 35:
3dfx
ERROR: syntax check failed on line 52:
3dnow
checking file /usr/portage/profiles/default-amd64-2004.2/packages
checking file /usr/portage/profiles/default-amd64-2004.2/use.defaults
Errors in user configuration:
None
Errors in tree configuration:
None
Errors in profile configuration:
use.mask |
_________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
asph l33t
Joined: 25 Aug 2003 Posts: 741 Location: Barcelona, Spain
|
Posted: Mon Sep 27, 2004 9:06 pm Post subject: |
|
|
i had no errors.. all set _________________ 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 |
|
|
oberyno Guru
Joined: 15 Feb 2004 Posts: 467 Location: /bin/zsh
|
Posted: Mon Sep 27, 2004 10:17 pm Post subject: |
|
|
I got a couple erroneous errors in package.use. Code: | checking file /etc/portage/package.use
ERROR: syntax check failed on line 5:
media-video/mplayer 3dnowex cdparanoia divx4linux -gtk mmx2 network nvidia rtc xv xvid
ERROR: syntax check failed on line 17:
x11-libs/wxGTK no_wxgtk1
checking file /var/lib/portage/world | 3dnowex is the useflag for mplayer that the script complains about.
Other than that, it looks nice. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Mon Sep 27, 2004 10:44 pm Post subject: |
|
|
Ok, updated the regular expression for USE flags.
Thanks to everyone who's testing it. |
|
Back to top |
|
|
singular n00b
Joined: 07 Jun 2003 Posts: 54
|
Posted: Tue Sep 28, 2004 5:38 am Post subject: |
|
|
The only error I get is
Code: |
checking file /var/cache/edb/virtuals
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/console-tools sys-apps/kbd
|
Other than that it works ok. |
|
Back to top |
|
|
Cintra Advocate
Joined: 03 Apr 2004 Posts: 2111 Location: Norway
|
Posted: Tue Sep 28, 2004 7:28 am Post subject: |
|
|
I get..
p4pe / # portage_syntax_checker.py
Checking file permissions ... done
checking file /etc/portage/package.mask
checking file /etc/portage/package.keywords
checking file /var/lib/portage/world
ERROR: syntax check failed on line 84:
<=media-sound/alsa-driver-1.0.3
checking file /mnt/hdb9/portage/profiles/package.mask
checking file /mnt/hdb9/portage/profiles/arch.list
checking file /usr/portage/profiles/default-x86-2004.0/virtuals
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/console-tools sys-apps/kbd
checking file /usr/portage/profiles/default-x86-2004.0/use.mask
checking file /usr/portage/profiles/default-x86-2004.0/packages
checking file /usr/portage/profiles/default-x86-2004.0/use.defaults
Errors in user configuration:
world - 1
Errors in tree configuration:
None
Errors in profile configuration:
None _________________ "I am not bound to please thee with my answers" W.S. |
|
Back to top |
|
|
oberyno Guru
Joined: 15 Feb 2004 Posts: 467 Location: /bin/zsh
|
Posted: Tue Sep 28, 2004 7:44 am Post subject: |
|
|
singular wrote: | The only error I get is
Code: |
checking file /var/cache/edb/virtuals
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/console-tools sys-apps/kbd
|
Other than that it works ok. | A quick grep across all virtual files in the tree shows there is no console-tools virtual. You should be able to remove that line. Anyway, if it was a virtual, it would be in the format "virtual/console-tools sys-apps/kbd".
EDIT:Looking through the forum, I see alot of instances of "sys-apps/console-tools sys-apps/kbd" as a virtual, so I guess it might actually be correct.
Cintra wrote: | checking file /var/lib/portage/world
ERROR: syntax check failed on line 84:
<=media-sound/alsa-driver-1.0.3 | The world file shouldn't have specific versions in it. Try replacing that line with Code: | media-sound/alsa-driver |
|
|
Back to top |
|
|
Cerement Guru
Joined: 14 Jun 2003 Posts: 404
|
Posted: Tue Sep 28, 2004 7:52 am Post subject: |
|
|
I'm assuming it would be a parsing headache, but listening to rac in #gentoo, anything that checked for typos in CFLAGS in /etc/make.conf sounds like it would be a big win with the support staff |
|
Back to top |
|
|
kallamej Administrator
Joined: 27 Jun 2003 Posts: 4975 Location: Gothenburg, Sweden
|
Posted: Tue Sep 28, 2004 7:56 am Post subject: |
|
|
Nothing new to report really. Any particular technical reason that * isn't valid together with > and >= in the depend atoms? Ebuild(5) claims that it is indeed valid. And the console-tools non-virtual virtual is from the time when there was a console-tools package (6 months ago). Code: | # portage_syntax_checker.py
Checking file permissions ... done
checking file /etc/portage/package.mask
ERROR: syntax check failed on line 11:
>dev-java/ant-1.5.4*
checking file /etc/portage/package.unmask
checking file /etc/portage/package.keywords
checking file /etc/portage/package.use
checking file /var/cache/edb/world
checking file /var/cache/edb/virtuals
WARNING: non-virtual used as virtual, might cause problems:
sys-apps/console-tools sys-apps/kbd
checking file /usr/portage/profiles/package.mask
checking file /usr/portage/profiles/arch.list
checking file /usr/portage/profiles/default-x86-1.4/virtuals
checking file /usr/portage/profiles/default-x86-1.4/use.mask
checking file /usr/portage/profiles/default-x86-1.4/packages
checking file /usr/portage/profiles/default-x86-1.4/use.defaults
Errors in user configuration:
package.mask - 1
Errors in tree configuration:
None
Errors in profile configuration:
None
|
_________________ Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Tue Sep 28, 2004 8:36 am Post subject: |
|
|
>=foo-1* doesn't create any problems yet, but it's kind of a contradiction:
- >= means use this version or any version greater than it
- * means use any version that starts with this prefix (simplified, it's a bit more restricted)
so if you have >=foo-1*, would it match foo-2.1 ? If you say yes then you don't need the *, if you say no you want =, not >=. That's why we decided it is invalid. |
|
Back to top |
|
|
kallamej Administrator
Joined: 27 Jun 2003 Posts: 4975 Location: Gothenburg, Sweden
|
Posted: Tue Sep 28, 2004 9:54 am Post subject: |
|
|
Genone wrote: | >=foo-1* doesn't create any problems yet, but it's kind of a contradiction:
- >= means use this version or any version greater than it
- * means use any version that starts with this prefix (simplified, it's a bit more restricted)
so if you have >=foo-1*, would it match foo-2.1 ? If you say yes then you don't need the *, if you say no you want =, not >=. That's why we decided it is invalid. |
The only problem I see with this is if you want to mask anything strictly higher than a particular version range, you now have to mask something higher than that version range instead. _________________ Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Tue Sep 28, 2004 10:03 am Post subject: |
|
|
kallamej wrote: | Genone wrote: | >=foo-1* doesn't create any problems yet, but it's kind of a contradiction:
- >= means use this version or any version greater than it
- * means use any version that starts with this prefix (simplified, it's a bit more restricted)
so if you have >=foo-1*, would it match foo-2.1 ? If you say yes then you don't need the *, if you say no you want =, not >=. That's why we decided it is invalid. |
The only problem I see with this is if you want to mask anything strictly higher than a particular version range, you now have to mask something higher than that version range instead. |
Sorry, can't follow you here. Can you give an example for such a case (where >=foo-x* is different to >=foo-x and =foo-x*) ? The problem is that it's ambigous and redundant (unless we missed something). |
|
Back to top |
|
|
kallamej Administrator
Joined: 27 Jun 2003 Posts: 4975 Location: Gothenburg, Sweden
|
Posted: Tue Sep 28, 2004 10:15 am Post subject: |
|
|
The keyword is strictly. I have foo-1.2.3-r4 and want to keep that version but allow its revisions. To avoid upgrading to higher versions a package.mask of >foo-1.2.3* seemed logical. Instead I have to use >=foo-1.2.4. Your examples are perfectly OK. _________________ Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat |
|
Back to top |
|
|
vdboor Guru
Joined: 03 Dec 2003 Posts: 592 Location: The Netherlands
|
Posted: Thu Sep 30, 2004 7:43 pm Post subject: |
|
|
The only real error I get is
Code: | checking file /etc/portage/package.keywords
ERROR: syntax check failed on line 25:
media-gfx/splashutils ~x68 |
Except for the wording in the error messages, this tool seams like a nice enhancement!
I also get the sys-apps/console-tools sys-apps/kbd virtuals error, I'm not sure what it means though. _________________ The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer
[ screenies | Coding on KMess ] |
|
Back to top |
|
|
ciaranm Retired Dev
Joined: 19 Jul 2003 Posts: 1719 Location: In Hiding
|
Posted: Fri Oct 01, 2004 1:39 pm Post subject: |
|
|
kallamej wrote: | The keyword is strictly. I have foo-1.2.3-r4 and want to keep that version but allow its revisions. To avoid upgrading to higher versions a package.mask of >foo-1.2.3* seemed logical. Instead I have to use >=foo-1.2.4. Your examples are perfectly OK. |
r9999 is your friend. |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Sat Oct 02, 2004 3:18 am Post subject: |
|
|
Hmmm, this is my output, and for the life of me I can't see what the trouble is
Code: | appserver ~ # /usr/local/sbin/portage_syntax_checker.py
Checking file permissions ... done
checking file /etc/portage/package.unmask
checking file /etc/portage/package.use
ERROR: syntax check failed on line 15:
dev-php/php -* bcmath bzlib cpdflib curl curlwrappers dba fam flatfile ftp gd gdbm gmp iconv imap inifile jpeg ldap memlimit mhash mime mysql pcntl pcre png posix sasl session shared sharedmem simplexml snmp soap sockets spell sqlite ssl sysvipc tidy tiff tokenizer truetype wddx xml2 xmlrpc xsl zlib
ERROR: syntax check failed on line 16:
dev-php/mod_php -* apache2 bcmath bzlib cpdflib curl curlwrappers dba fam flatfile ftp gd gdbm gmp iconv imap inifile jpeg ldap memlimit mhash mime mysql pcntl pcre png posix sasl session shared sharedmem simplexml snmp soap sockets spell sqlite ssl sysvipc tidy tiff tokenizer truetype wddx xml2 xmlrpc xsl zlib
checking file /var/lib/portage/world
checking file /usr/portage/profiles/package.mask
checking file /usr/portage/profiles/arch.list
checking file /usr/portage/profiles/default-linux/x86/2004.3/packages
checking file /usr/portage/profiles/default-linux/x86/virtuals
checking file /usr/portage/profiles/default-linux/x86/use.mask
checking file /usr/portage/profiles/default-linux/x86/packages
checking file /usr/portage/profiles/default-linux/virtuals
checking file /usr/portage/profiles/default-linux/use.mask
checking file /usr/portage/profiles/default-linux/packages
checking file /usr/portage/profiles/default-linux/use.defaults
checking file /usr/portage/profiles/base/virtuals
checking file /usr/portage/profiles/base/packages
checking file /usr/portage/profiles/base/use.defaults
Errors in user configuration:
package.use - 2
Errors in tree configuration:
None
Errors in profile configuration:
None |
Note that both php and mod_php emerge and work just fine. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
kallamej Administrator
Joined: 27 Jun 2003 Posts: 4975 Location: Gothenburg, Sweden
|
Posted: Sat Oct 02, 2004 8:24 am Post subject: |
|
|
ciaranm wrote: | kallamej wrote: | The keyword is strictly. I have foo-1.2.3-r4 and want to keep that version but allow its revisions. To avoid upgrading to higher versions a package.mask of >foo-1.2.3* seemed logical. Instead I have to use >=foo-1.2.4. Your examples are perfectly OK. |
r9999 is your friend. |
I know, but that is a hack. If we can't mask anything but [a,b), I think it is actually better to mask [b,+inf), though. _________________ Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat |
|
Back to top |
|
|
hielvc Advocate
Joined: 19 Apr 2002 Posts: 2805 Location: Oceanside, Ca
|
Posted: Sun Oct 03, 2004 11:11 pm Post subject: |
|
|
No real probs here except those mentioned before
Checking file permissions ... done
checking file /etc/portage/package.mask
checking file /etc/portage/package.unmask
checking file /etc/portage/package.keywords
ERROR: syntax check failed on line 1:
>=sys-apps/portage-2.0.51*
checking file /var/lib/portage/world
checking file /usr/portage/profiles/package.mask
checking file /usr/portage/profiles/arch.list
checking file /usr/portage/profiles/default-linux/x86/2004.2/gcc34/2.6/virtuals
checking file /usr/portage/profiles/default-linux/x86/2004.2/gcc34/2.6/packages
checking file /usr/portage/profiles/default-linux/x86/2004.2/gcc34/packages
checking file /usr/portage/profiles/default-linux/x86/2004.2/packages
checking file /usr/portage/profiles/default-linux/x86/virtuals
checking file /usr/portage/profiles/default-linux/x86/use.mask
checking file /usr/portage/profiles/default-linux/x86/packages
checking file /usr/portage/profiles/default-linux/virtuals
checking file /usr/portage/profiles/default-linux/use.mask
checking file /usr/portage/profiles/default-linux/packages
checking file /usr/portage/profiles/default-linux/use.defaults
checking file /usr/portage/profiles/base/virtuals
checking file /usr/portage/profiles/base/packages
checking file /usr/portage/profiles/base/use.defaults
Errors in user configuration:
package.keywords - 1
Errors in tree configuration:
None
Errors in profile configuration:
None _________________ An A-Z Index of the Linux BASH command line |
|
Back to top |
|
|
Gavrila Apprentice
Joined: 08 Jun 2003 Posts: 275
|
Posted: Wed Oct 06, 2004 9:13 am Post subject: |
|
|
Ok I edited permission as stated in one of the first posts and all was fine. |
|
Back to top |
|
|
catkfr Guru
Joined: 02 Aug 2004 Posts: 300
|
Posted: Fri Oct 08, 2004 1:55 pm Post subject: |
|
|
Apparently, it doesn't like it when you put comments at the end of a line in /etc/portage/package.keywords
Code: | Checking file permissions ... done
checking file /etc/portage/package.mask
checking file /etc/portage/package.unmask
checking file /etc/portage/package.keywords
ERROR: syntax check failed on line 23:
dev-dotnet/mono ~x86 ### dependency of muine
ERROR: syntax check failed on line 24:
dev-libs/icu ~x86 ### dependency of muine
ERROR: syntax check failed on line 25:
x11-libs/gtk-sharp ~x86 ### dependency of muine
checking file /etc/portage/package.use
checking file /var/lib/portage/world
checking file /usr/portage/profiles/package.mask
checking file /usr/portage/profiles/arch.list
checking file /usr/portage/profiles/default-x86-2004.2/virtuals
checking file /usr/portage/profiles/default-x86-2004.2/use.mask
checking file /usr/portage/profiles/default-x86-2004.2/packages
checking file /usr/portage/profiles/default-x86-2004.2/use.defaults
Errors in user configuration:
package.keywords - 3
Errors in tree configuration:
None
Errors in profile configuration:
None |
|
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9555 Location: beyond the rim
|
Posted: Fri Oct 08, 2004 3:33 pm Post subject: |
|
|
Yep, comments have to be on a line of their own. Weird things might happen with end-of-line comments |
|
Back to top |
|
|
|