Bug 500611

Summary: exclude has some strange behavior
Product: Red Hat Enterprise Linux 5 Reporter: Levente Farkas <lfarkas>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-13 10:47:48 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Levente Farkas 2009-05-13 08:54:50 EDT
while try to debug why mock not working for some packages i discover this bug. on rhel-5.3 just try this two:
--------------------------------
# yum --exclude="[0-9A-Za-fh-z]*.i?86 g[0-9A-Za-km-z]*.i?86 gl[0-9A-Za-hj-z]*.i?86 gli[0-9A-Zac-z]*.i?86 glib[0-9A-Za-bd-z]*.i?86" resolvedep /usr/include/gnu/stubs-32.h
Loaded plugins: priorities
Excluding Packages in global exclude list
Finished
1 packages excluded due to repository priority protections
Importing additional filelist information
No Package Found for /usr/include/gnu/stubs-32.h
# yum --exclude="g[0-9A-Za-km-z]*.i?86 gl[0-9A-Za-hj-z]*.i?86 gli[0-9A-Zac-z]*.i?86 glib[0-9A-Za-bd-z]*.i?86" resolvedep /usr/include/gnu/stubs-32.h
Loaded plugins: priorities
Excluding Packages in global exclude list
Finished
3 packages excluded due to repository priority protections
Importing additional filelist information
0:glibc-devel-2.5-34.i386
--------------------------------
so it seems the there is some problem with:
[0-9A-Za-fh-z]*.i?86 
even it's not fit (imho) to glibc-devel but may be for 0:glibc-devel
it can be just mock exclude pattern bug...
Comment 1 seth vidal 2009-05-13 09:06:13 EDT
so here are the excludes you have:
g[0-9A-Za-km-z]*.i?86 - this does not match glibc-devel
gl[0-9A-Za-hj-z]*.i?86 - this does not match glibc-devel
gli[0-9A-Zac-z]*.i?86 - this does not match glibc-devel
glib[0-9A-Za-bd-z]*.i?86 -  this does not match glibc-devel

but in the first command:
[0-9A-Za-fh-z]*.i?86 - this does match 0:glibc-devel-2.5-34.i386
import fnmatch
s = 'glibc-devel-2.5-34.i386'
fnmatch.fnmatch(s,'[0-9A-Za-fh-z]*.i?86')
False
t = '0:glibc-devel-2.5-34.i386'
fnmatch.fnmatch(t, '[0-9A-Za-fh-z]*.i?86')
True

What is the bug here?
Comment 2 Levente Farkas 2009-05-13 09:15:47 EDT
ok it's turn out a yum bug:-( may be have to report upstream...
the worst thing that you match pattern to _both_
glibc-devel-2.5-34.i386
0:glibc-devel-2.5-34.i386
which is a nithtmare:-(
in this case it can't be write a good pattern:-(
Comment 3 Levente Farkas 2009-05-13 09:19:04 EDT
the bug is there it's match _both_
glibc-devel-2.5-34.i386
0:glibc-devel-2.5-34.i386
or can you give me a good exclude pattern to be used in x86-64 mock config?
or at lease can i use ^ and $ in pattern?
and if epoch is 0 the it's always appended?
ok i open a bug report for mock too since it's exclude patter is wrong.
Comment 4 James Antill 2009-05-13 10:47:48 EDT
 This is how all pattern matching is done in yum ... Eg. try:

yum list '0*'

...there are a couple of ways around your problem:

1. Don't have 0 there (AFAIK no packages actually begin with a 0).

2. See https://bugzilla.redhat.com/show_bug.cgi?id=429723#c9

3. Have a custom build repo. which just has the glibc.i?86 and no other multilib. stuff.

4. Do something like includepkgs = glibc.i?86 *.x86_64
Comment 5 seth vidal 2009-05-13 10:59:56 EDT
There's nothing in rhel5 which starts with 0 but there is something in fedora that does:

0xFFFF.i586                               0.3.9-3.fc11                   rawhide