I agree, but all wajig does is call "apt-cache search" and "apt-cache
search --names-only". Is there an "apt-cache" command that would only
search packages names and their short descriptions?
We can do this
ourselves of course, I would rather we wrap existing tools. Also, if
we add this feature, do we kill the older one of searching through the
long description, or do we keep providing it with, for example, "-vv"?
How would one implement such a search?
It would be easier if "less"
and "most" provided "pager" as a virtual package. Also, note that
"more" is not a separate package, but part of util-linux.
Sounds like a good idea. How would you prefer the interface? "wajig
search --tag"?
On Mon, May 13, 2013 at 12:53 AM, Reuben Thomas <r...@sc3d.org> wrote:I don't like it (too many results).
> An alternative would simply be to make searching the package descriptions
> the default, as it is for apt-cache search.
>> How would one implement such a search?Yeah, that would require changing default to "apt-cache search" (i.e.
>
>
> This is easy for the "search" function: less and most mention "pager" in
> their short description.
current "wajig search --verbose") by default.
I'm wary of introducing yet-another subcommand. Why don't you want us
just add another command line switch to "search" subcommand? Or do you
mean "wajig search --debtags"?
>> 1. If the pattern contains colons (or some more sensitive test), it does aI don't understand this. Do you have an example?
> debtags search.
> --names-only specify an apt-cache --names-only search> --cache specify an apt-cache searchI am actually very tempted to chuck these 2 away. Will anyone miss them?
apt-cache search accepts multiple TERMs, so me wonders if we should
continue supporting that. If so, what would the grep arguments be (my
regex skillz aren't impressive).
A better way of doing this is to use a list comprehension, first
because it's more readable, and 2nd because it returns a list, which
you can re-iterate through, as we'll need to in the ''.joins() below.
> if args.verbose:
> - command = "apt-cache search " + " ".join(args.patterns)
> + command = "apt-cache search " + " ".join(pats)
> else:
> command = "apt-cache search {} | /bin/grep --ignore-case '{}'"
> - command = command.format(" ".join(args.patterns),
> - "\|".join(args.patterns))
> + command = command.format(" ".join(pats),
> + "\|".join(pats))
Also, can you attach patch files next time (Gmail doesn't
format these things nicely).
On Fri, May 17, 2013 at 2:03 AM, Reuben Thomas <r...@sc3d.org> wrote:Not on Python 3 surely?
> On 17 May 2013 00:41, Tshepang Lekhonkhobe <tshe...@gmail.com> wrote:
>>
>>
>> A better way of doing this is to use a list comprehension, first
>> because it's more readable, and 2nd because it returns a list, which
>> you can re-iterate through, as we'll need to in the ''.joins() below.
>>
>> > if args.verbose:
>> > - command = "apt-cache search " + " ".join(args.patterns)
>> > + command = "apt-cache search " + " ".join(pats)
>> > else:
>> > command = "apt-cache search {} | /bin/grep --ignore-case '{}'"
>> > - command = command.format(" ".join(args.patterns),
>> > - "\|".join(args.patterns))
>> > + command = command.format(" ".join(pats),
>> > + "\|".join(pats))
>>
>
> Note, map also returns a list, which explains why my code works.
>> Also, can you attach patch files next time (Gmail doesn'tWhat requests?
>> format these things nicely).
>
>
> Sure, sorry. I get conflicting requests!
On Fri, May 17, 2013 at 7:00 PM, Reuben Thomas <r...@sc3d.org> wrote:
> On 17 May 2013 17:17, Tshepang Lekhonkhobe <tshe...@gmail.com> wrote:
>> > Note, map also returns a list, which explains why my code works.
>>
>> Not on Python 3 surely?
>
>
> No indeed. But it seems to work. Have you tested it?
I get the grep error I mentioned before, due to the 2nd join()
producing an empty string. I don't know how you got it to work.
On Sat, May 18, 2013 at 12:42 AM, Reuben Thomas <r...@sc3d.org> wrote:Forgive me. It was my fault. I had another change that caused the grep
> On 17 May 2013 23:34, Tshepang Lekhonkhobe <tshe...@gmail.com> wrote:
>>
>> I get the grep error I mentioned before, due to the 2nd join()
>> producing an empty string. I don't know how you got it to work.
>
>
> It turns out I didn't: "wajig search pager" returns exactly the same result
> as "apt-cache search pager" with my patch applied. I still don't know why I
> get no error, though.
error. Silly.
Anyways, what is the output of your "wajig search pager --simulate"?
It's just historical. You wanna fix the mess?
On Sat, May 18, 2013 at 1:21 AM, Reuben Thomas <r...@sc3d.org> wrote:Do you notice the bug? That should be "/bin/grep --ignore-case 'pager'.
> On 18 May 2013 00:14, Tshepang Lekhonkhobe <tshe...@gmail.com> wrote:
>>
>> On Sat, May 18, 2013 at 12:42 AM, Reuben Thomas <r...@sc3d.org> wrote:
>> > On 17 May 2013 23:34, Tshepang Lekhonkhobe <tshe...@gmail.com> wrote:
>> >>
>> >> I get the grep error I mentioned before, due to the 2nd join()
>> >> producing an empty string. I don't know how you got it to work.
>> >
>> >
>> > It turns out I didn't: "wajig search pager" returns exactly the same
>> > result
>> > as "apt-cache search pager" with my patch applied. I still don't know
>> > why I
>> > get no error, though.
>>
>> Forgive me. It was my fault. I had another change that caused the grep
>> error. Silly.
>>
>> Anyways, what is the output of your "wajig search pager --simulate"?
>
>
> apt-cache search pager | /bin/grep --ignore-case ''
>> It's just historical. You wanna fix the mess?Why wait? There wouldn't be any conflict, or would there?
>
>
> Sure, commit the patch for search and I'll then do another patch for this.
Ok. It will be -v, and the current -v be -vv. Will do so soonest.
I wonder what else should be in the next release too. I'm thinking of
cleaning up the packaging, and upload wajig to PyPI (FWIW).
OK, here's a patch that a) regularizes the use of grep (always egrep), and removes all absolute paths from binary invocations.
Apparently, in code, you only want to use absolute paths when invoking
binaries. It has something to do with security.
Also, the manpage sez egrep is deprecated, in favor of grep -E.
I am not so conversant with security topics (Graham can explain
further for he's the one who alerted me to the issue), but how I
understand it is that someone can place an evil executable in your
PATH, and providing an absolute path avoids that risk.
ldconfig
,
start-stop-daemon
, install-info
, and
update-rc.d
can be found via the PATH environment
variable."--
You received this message because you are subscribed to the Google Groups "wajig" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wajig+un...@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at http://groups.google.com/group/wajig?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
I think the issue is that if grep or ls get replaced in your PATH by a malicious executable - a common use case was when users had "." in their path and they cd into random folders that might have a trojan "grep" that then replaces the grep in wajig if absolute paths are not used.
I went to look into CPython repo and it appears even there[example],
full paths aren't used, so will have to agree with Graham here.
--
You received this message because you are subscribed to the Google Groups "wajig" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wajig+un...@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at http://groups.google.com/group/wajig?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.