apt aptitude inconsistent search results (regex)

March 26th, 2012 - 12:50 am ET by Ano Nymous | Report spam

apt 0.8.16
aptitude 0.6.4

If I search for a package name (~n) then using '$' should prevent -dbg -doc
-multi.
So I would consider the following results wrong:
$ aptitude search "~ngstreamer(.+)-(ffmpeg|plugins-(ugly|bad))$"
i gstreamer0.10-ffmpeg - FFmpeg plugin for
GStreamer
p gstreamer0.10-ffmpeg-dbg - FFmpeg plugin for GStreamer (debug
symbols
i gstreamer0.10-plugins-bad - GStreamer plugins from the "bad"
set
p gstreamer0.10-plugins-bad-dbg - GStreamer plugins from the "bad" set
(debu
p gstreamer0.10-plugins-bad-doc - GStreamer documentation for plugins
from t
p gstreamer0.10-plugins-bad-multi - GStreamer plugins from the "bad" set
(Mult
p gstreamer0.10-plugins-bad-multi - GStreamer plugins from the "bad" set
(Mult
i gstreamer0.10-plugins-ugly - GStreamer plugins from the "ugly"
set
p gstreamer0.10-plugins-ugly-dbg - GStreamer plugins from the "ugly" set
(deb
p gstreamer0.10-plugins-ugly-doc - GStreamer documentation for plugins
from t

However, using the same regex with apt-cache yields the correct result:
$ apt-cache search "^gstreamer(.+)-(ffmpeg|plugins-(ugly|bad|good))$"
gstreamer0.10-ffmpeg - FFmpeg plugin for GStreamer
gstreamer0.10-plugins-bad - GStreamer plugins from the "bad" set
gstreamer0.10-plugins-ugly - GStreamer plugins from the "ugly" set
gstreamer0.10-plugins-good - GStreamer plugins from the "good" set

The only way I can get aptitude to perform properly is by using the
following regex:
$ aptitude search "~ngstreamer(.+)-(ffmpeg$|plugins-(ugly$|bad$|good$))"

Which I would consider as wrong.
Another example, where aptitude is right and apt-cache is wrong:
$ apt-cache search "^mp\w*r$"
mp3blaster - Full-screen console mp3 and Ogg Vorbis player
mp3roaster - A Perl hack for burning audio CDs out of MP3/OGG/FLAC/WAV files
mplayer2 - next generation movie player for Unix-like systems
mplayer - movie player for Unix-like systems

"mplayer2" should have been excluded.

$ aptitude search "~n^mp\w*r$"
p mp3blaster - Full-screen console mp3 and Ogg
Vorbis pla
p mp3roaster - A Perl hack for burning audio CDs out
of M
i mplayer - movie player for Unix-like systems

For package names, ~n or ?name with aptitude is unnecessary, I used it in
the previous examples for clarification.
I've read man 7 regex and I'm fairly sure those regexes are fine but many
instances give wrong results.
An application that gives expected results is grep, in particular grep -E.
Is this a known issue, or where am I going wrong?


apt 0.8.16<br>aptitude 0.6.4<br><br>If I search for a package name (~n) then using &#39;$&#39; should prevent -dbg -doc -multi.<br>So I would consider the following results wrong:<br><span style="font-family:courier new,monospace">$ aptitude search &quot;~ngstreamer(.+)-(ffmpeg|plugins-(ugly|bad))$&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">i   gstreamer0.10-ffmpeg            - FFmpeg plugin for GStreamer               </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">p   gstreamer0.10-ffmpeg-dbg        - FFmpeg plugin for GStreamer (debug symbols</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">i   gstreamer0.10-plugins-bad       - GStreamer plugins from the &quot;bad&quot; set      </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">p   gstreamer0.10-plugins-bad-dbg   - GStreamer plugins from the &quot;bad&quot; set (debu</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">p   gstreamer0.10-plugins-bad-doc   - GStreamer documentation for plugins from t</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">p   gstreamer0.10-plugins-bad-multi - GStreamer plugins from the &quot;bad&quot; set (Mult</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">p   gstreamer0.10-plugins-bad-multi - GStreamer plugins from the &quot;bad&quot; set (Mult</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">i   gstreamer0.10-plugins-ugly      - GStreamer plugins from the &quot;ugly&quot; set     </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">p   gstreamer0.10-plugins-ugly-dbg  - GStreamer plugins from the &quot;ugly&quot; set (deb</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">p   gstreamer0.10-plugins-ugly-doc  - GStreamer documentation for plugins from t</span><br>
<br>However, using the same regex with apt-cache yields the correct result:<br><span style="font-family:courier new,monospace">$ apt-cache search &quot;^gstreamer(.+)-(ffmpeg|plugins-(ugly|bad|good))$&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">gstreamer0.10-ffmpeg - FFmpeg plugin for GStreamer</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">gstreamer0.10-plugins-bad - GStreamer plugins from the &quot;bad&quot; set</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">gstreamer0.10-plugins-ugly - GStreamer plugins from the &quot;ugly&quot; set</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">gstreamer0.10-plugins-good - GStreamer plugins from the &quot;good&quot; set</span><br>
<br>The only way I can get aptitude to perform properly is by using the following regex:<br><span style="font-family:courier new,monospace">$ aptitude search &quot;~ngstreamer(.+)-(ffmpeg$|plugins-(ugly$|bad$|good$))&quot;</span><br>
<br>Which I would consider as wrong.<br>Another example, where aptitude is right and apt-cache is wrong:<br><span style="font-family:courier new,monospace">$  apt-cache search &quot;^mp\w*r$&quot;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">mp3blaster - Full-screen console mp3 and Ogg Vorbis player</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">mp3roaster - A Perl hack for burning audio CDs out of MP3/OGG/FLAC/WAV files</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">mplayer2 - next generation movie player for Unix-like systems</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">mplayer - movie player for Unix-like systems</span><br>
<br>&quot;mplayer2&quot; should have been excluded.  <br><br><span style="font-family:courier new,monospace">$  aptitude search &quot;~n^mp\w*r$&quot;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">p   mp3blaster                      - Full-screen console mp3 and Ogg Vorbis pla</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">p   mp3roaster                      - A Perl hack for burning audio CDs out of M</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">i   mplayer                         - movie player for Unix-like systems  </span><br>
<br>For package names, ~n or ?name with aptitude is unnecessary, I used it in the previous examples for clarification.<br>I&#39;ve read man 7 regex and I&#39;m fairly sure those regexes are fine but many instances give wrong results.<br>
An application that gives expected results is grep, in particular grep -E.<br>Is this a known issue, or where am I going wrong?<br><br>



To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CA+MSfsKVKz...mPMaNiWBfQ@mail.gmail.com
email Follow the discussionReplies 1 replyReplies Make a reply

Replies

#1 Christofer C. Bell
March 26th, 2012 - 08:00 am ET | Report spam
On Sun, Mar 25, 2012 at 11:40 PM, Ano Nymous wrote:

I've read man 7 regex and I'm fairly sure those regexes are fine but many
instances give wrong results.
An application that gives expected results is grep, in particular grep -E.
Is this a known issue, or where am I going wrong?



The closest bug I could find in aptitude having to do with regex was this one:

http://bugs.debian.org/cgi-bin/bugreport.cgi?

This is a wishlist bug and has nothing to do with what you've found.
I'd guess no bug has been submitted for this issue so you might
consider opening one.

Chris


To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Archive: http://lists.debian.org/CAOEVnYuKnB...rY3ehGtXj=

Similar topics