[gentoo-portage-dev] [PATCH] sane USE_EXPAND + IUSE check

2005-08-16 Thread Brian Harring
Hola-
basically, use_expand'd vars need to be exempted from IUSE checks, as 
long as the USE_EXPAND var is in IUSE.
This does that.
~harring
Index: ebuild.sh
===
RCS file: /var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v
retrieving revision 1.201.2.40
diff -u -r1.201.2.40 ebuild.sh
--- ebuild.sh   9 Aug 2005 11:25:44 -   1.201.2.40
+++ ebuild.sh   17 Aug 2005 00:50:27 -
@@ -15,6 +15,7 @@
if [ -f ${T}/environment ]; then
source ${T}/environment /dev/null
fi
+   USE_EXPAND=$(echo ${USE_EXPAND} | tr A-Z a-z)
 fi
 
 if [ -n $# ]; then
@@ -130,7 +131,19 @@

# Make sure we have this USE flag in IUSE
if ! hasq ${u} ${IUSE} ${E_IUSE}  ! hasq ${u} ${PORTAGE_ARCHLIST} 
selinux; then
-   echo QA Notice: USE Flag '${u}' not in IUSE for 
${CATEGORY}/${PF} 2
+   local x
+   local invalid=1
+   for x in ${USE_EXPAND}; do
+   if [ ${u:0:${#x}} == ${x} ]; then
+   if hasq ${x} ${IUSE} ${E_IUSE}; then
+   unset invalid
+   fi
+   break
+   fi
+   done
+   if [ -n ${invalid} ]; then
+   echo QA Notice: USE Flag '${u}' not in IUSE for 
${CATEGORY}/${PF} 2
+   fi
fi
 
for x in ${USE}; do


pgpVlG8eJOxdX.pgp
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] sane USE_EXPAND + IUSE check

2005-08-16 Thread Jason Stubbs
You hijacked a thread again...

On Wednesday 17 August 2005 09:52, Brian Harring wrote:
 basically, use_expand'd vars need to be exempted from IUSE checks, as
 long as the USE_EXPAND var is in IUSE.

I don't really like the idea of this without a companion patch that provides 
some way to get a list of relevant env vars and their possible settings to 
the user without having to look at the ebuild. The list of possiblities 
could live in use.desc or a similar file, but at minimum the list of vars 
needs to be provided.

Another patch is also required that will allow disabling of the QA check on 
certain vars, preferably defined in a file in the tree similar to 
info_vars. This would be used for vars such as USERLAND which are profile 
defined.

In other words, don't kill the QA check without addressing the issue that 
the QA check is warning about. ;)

-- 
Jason Stubbs


pgpyAsoZCE427.pgp
Description: PGP signature