You are not logged in.

#26 2005-07-30 11:28:28

citral
Member
Registered: 2005-05-07
Posts: 87

Re: pacman with colored -Ss

I wikified this thing.


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#27 2006-03-28 14:40:40

Benol
Member
From: Warsaw, Poland
Registered: 2006-03-20
Posts: 28

Re: pacman with colored -Ss

That's exactly what the output should look like. So did anyone put a request on bug tracker? And it is not "trivial" - it makes pacman -Ss almost unusable for me - I have to use the website search engine...

Offline

#28 2006-03-28 17:55:07

Sander
Member
Registered: 2006-02-26
Posts: 138

Re: pacman with colored -Ss

If this goes into pacman, maybe the colours should be configurable? Else we'll get endless battles of the type 'blue vs green' wink


You like cheese? You like peas? You'll love cheezy peas!

Offline

#29 2006-03-28 19:04:27

Benol
Member
From: Warsaw, Poland
Registered: 2006-03-20
Posts: 28

Re: pacman with colored -Ss

We can have the config in pacman.conf. I think I'll submit a request, so that the uh-oh PACMAN 3 include some kind of colored output...

Offline

#30 2006-03-28 21:34:50

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

If pacman -Ss output is unsearchable, you're either using it wrong, or you need new fonts.... I really don't get how it is unusable.. that's kinda dumb.

Sure, colors are fine and dandy, but comeon "unusable" is a stretch.  I'd assume you also have problems reading man pages in less then?

Offline

#31 2006-03-28 21:50:53

Elias
Member
From: Lyon (Fr)
Registered: 2006-01-19
Posts: 35
Website

Re: pacman with colored -Ss

IMHO colors are really important for outputs such as emerge where there are a lot of informations (name, homepage, last version available, last version installed & description) but in the case of pacman there isn't a lot much informations (just two lines vs 5-6) so colors might be not that usefull...

Offline

#32 2006-03-30 00:05:29

raskolnikov
Member
From: France
Registered: 2006-01-08
Posts: 100

Re: pacman with colored -Ss

That's a pretty good script for filtering -Ss output, but wouldn't it be better like this ?

#!/bin/sh
echo -e "$(pacman -Ss $@ | sed 
     -e 's,^testing/.*,\033[1;31m&\033[0;0m,g' 
     -e 's,^current/.*,\033[1;32m&\033[0;0m,g' 
     -e 's,^extra/.*,\033[1;35m&\033[0;0m,g' 
     -e 's,^community/.*,\033[1;33m&\033[0;0m,g' 
     -e 's,^[a-z]*/.*,\033[1;34m&\033[0;0m,g')"

I saw some descriptions colored because they have a / in their text, like the one of gtick (the first two lines were colored with "other repo" color). Tried this version with a pacs -Ss gtk, and works fine tongue


Excessive showering, grooming, and toothbrushing is not only vain, it wastes valuable coding time.

Offline

#33 2006-03-30 19:09:20

Benol
Member
From: Warsaw, Poland
Registered: 2006-03-20
Posts: 28

Re: pacman with colored -Ss

This way or another, this should be included in pacman.

Offline

#34 2006-03-31 19:11:04

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

Benol, you still have yet to respond to me, or give me any sort of technical reasons.  Sure, colored output is nice and pretty, but what would cramming ascii colors into the codebase accomplish that the script above does not?

Offline

#35 2006-03-31 19:56:51

Benol
Member
From: Warsaw, Poland
Registered: 2006-03-20
Posts: 28

Re: pacman with colored -Ss

I am not the only one who finds this feature usefull, so why not include it in the application? Sure - I can make my own script, I can even write my own package manager, but if pacman is so good, why not improve it as much as we can? Usability should be took under consideration when developing any program.

Offline

#36 2006-03-31 21:17:14

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

Benol wrote:

Sure - I can make my own script

But you don't have to.  It's right there.  Copy/Paste and you're done.  You will have you colored pacman output in about 10 seconds.

I'm not asking you why colors are important or anything.  I'm asking what is wrong with the above script?

Offline

#37 2006-04-02 07:36:44

test1000
Member
Registered: 2005-04-03
Posts: 834

Re: pacman with colored -Ss

one has to locate this thread, then one has to know where to paste the script, then one has to know how to set permissions correctly and spend a minute or two contemplating whether or not it needs to be the same permissions as pacman. Then one _could_ have typed
   pac test
because one haven't slept and don't remember that pac -Ss test would be the correct syntax for searching a package, then one would be presented with 'error: only one operation may be used at a time' when one _do_ type pac -Ss test and consecutively end up very confused because it doesn't work and you don't understand why.

oh yeah, and it seems it takes longer to wait for the scripts colored output than it takes without it, and this could probably be alleviated by Good Code/Fast Code instead of this bash script.


     Now, If one were to use grep it would take longer to type and you have to had used manhours to understand the program from before to know how to grep it correctly; which evident in this thread; not everyone masters at a whim.

So what is wrong with the above script? It would almost be a better question to ask what's NOT wrong with the script; atleast from a usability standpoint, but then again; maybe were all nerds which have no life and treat UNIX-manpages like christians treat their bible and should all follow Linus like sheep follow their herd while we repeat our mantra: linux, our way, life and the truth; all hail Linus the great Liberator and Saviour of our kin.

i think i lost the thread here somewhere, but hopefully you'll get something out of it smile


KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein

Offline

#38 2006-04-02 08:19:53

Benol
Member
From: Warsaw, Poland
Registered: 2006-03-20
Posts: 28

Re: pacman with colored -Ss

The only bad thing about this script is, that it is not already implemented in pacman. I don't like remembering one app to install things, another to build them from source and yet another to search for them (and maybe another to clean up the *.pacsave files).

Plus, it is not a two-year-long-work feature, only a small thing.

Gentoo has colored output in "emerge" and hardcore geeks don't complain about it. They don't ask why not put it in external script...

Offline

#39 2006-04-02 09:28:25

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: pacman with colored -Ss

I think we should have colored output for pacman.

Why?

When was the last time you used a screen that didn't support color?  For me, it would have been my father's original Macintosh before we bought the ][ci.  I think it is a reasonable request to have a more readable output from pacman by default.

Offline

#40 2006-04-02 11:53:35

citral
Member
Registered: 2005-05-07
Posts: 87

Re: pacman with colored -Ss

I already have shown in my first post that it takes minimal effort to have colored output in pacman.

Except for the eliteness-factor of having uncolored output, I have not heard a compelling reason to cripple pacman by default with unreadable output.

But if you really cannot be convinced then at least dump the script from the wiki in /etc/profile or the .bashrc skeleton...


One of the main causes of the fall of the Roman Empire was that, lacking zero,
they had no way to indicate successful termination of their C programs.

Offline

#41 2006-04-03 16:23:52

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

test1000 wrote:

one has to locate this thread, then one has to know where to paste the script, then one has to know how to set permissions correctly and spend a minute or two contemplating whether or not it needs to be the same permissions as pacman. Then one _could_ have typed
   pac test
because one haven't slept and don't remember that pac -Ss test would be the correct syntax for searching a package, then one would be presented with 'error: only one operation may be used at a time' when one _do_ type pac -Ss test and consecutively end up very confused because it doesn't work and you don't understand why.

No, no - I'm not saying that this script needs to stay here - I'm saying, if it were part of the pacman package, say as "pacsearch" or something, then it becomes a non-issue.

test1000 wrote:

oh yeah, and it seems it takes longer to wait for the scripts colored output than it takes without it, and this could probably be alleviated by Good Code/Fast Code instead of this bash script.[/code]
Wrong.  Try writing filtering code for this in C - you will quickly approach a few hundred lines, including regular expression handling, pipe() reading/writing, and all that fun stuff.

This code takes a long time because it's buffered through the 'echo' command.  i.e. you do not get output until the search completes.  As far as I know there is no way around this because sed does not properly handle terminal escape codes.

Benol wrote:

The only bad thing about this script is, that it is not already implemented in pacman. I don't like remembering one app to install things, another to build them from source and yet another to search for them (and maybe another to clean up the *.pacsave files).

Why is this bad?  You seriously need to read "The Art of Unix Programming" - here's the section I speak of: http://www.faqs.org/docs/artu/ch01s06.html
And if you don't like remembering different apps, you might be better off with one of the pacman GUI front ends.  Using the command line requires you to remember numerous commands to do different tasks.  That's a fact.

Benol wrote:

Plus, it is not a two-year-long-work feature, only a small thing.

Says who?  I'm not saying it's *not* a small feature, but how do you know.  Unless you are able to provide a patch, there is no way you can know how much work it will actually take.

Benol wrote:

Gentoo has colored output in "emerge" and hardcore geeks don't complain about it. They don't ask why not put it in external script...

Well, for the record, gentoo users are not "hardcore geeks" in general.  They know how to emerge, they know what compile output looks like, but if there's an error they have no idea what to do. [NOTE: This does not refer to all gentoo users.  This refers to the typical gentoo user.]

You are misunderstanding something here.  You are a user.  You did not make pacman, nor emerge.  To you, you have no idea *how* something is implemented, only that it is implemented.  If this is put in a wrapper script, that was made in about 5 seconds, and crammed into the pacman package, but not the codebase - you would never know the difference.  You're calling for potentially hours worth or work "just because".  To an end user, the actual implementation is transparent... which is why I ask for a *technical* reason this should be included in the code base.  If you cannot give a *technical* reason, then you cannot provide input on the language of choice and/or methodology of the actual implementation.

codemac wrote:

I think we should have colored output for pacman.

I agree.  As much as it may not seem like it.  I just do not feel that it belongs in the pacman codebase - see above link, "Rule of Separation".

codemac wrote:

When was the last time you used a screen that didn't support color?  For me, it would have been my father's original Macintosh before we bought the ][ci.  I think it is a reasonable request to have a more readable output from pacman by default.

I have a vt420, which is orange and black.  No color, only underline and bold attributes (oh, and blink!).

Again, I am not saying the request for color is unreasonable.  It's this claim that "OMG IT NEEDS TO BE IN THE CODE" that is unreasonable.  See all the above arguments for details, I'm out of typing breath.

Offline

#42 2006-04-03 18:01:38

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: pacman with colored -Ss

Step back from the issue, Phrakture, we both know its not likely to be implemented and there's no point in arguing it anymore. The script could be put into aur for those people that really need it. For those that think its a pain to use multiple commands, it shouldn't be hard to write a wrapper that pipes some commands through pacman and some through a script like this all in one command.

Dusty

Offline

#43 2006-04-03 18:17:20

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

Dusty wrote:

Step back from the issue, Phrakture, we both know its not likely to be implemented and there's no point in arguing it anymore.

If anything it won't be implemented in the 2.X series.

Offline

#44 2006-04-03 20:36:16

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: pacman with colored -Ss

Ok, phrakture, with that monster of a post, I now agree with you.  I do know the art of unix programming, my dad made me read it before I came to school.  Depending on how the colors are implemented, it could be hours or minutes. You are definitely right in saying this hack in no way represents the amount of time it would take to put in the pacman codebase.  It just proves how much unix pwns * because one can add colored output to anything they want, whether or not it's in the codebase.

That being said, I'll look at it this weekend, maybe do a patch.  I should get more familiar with the pacman code if I ever want to do more for Arch.   8)

Offline

#45 2006-04-03 20:51:21

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

Well the thing is, if you want to portably do color output, you should do it via curses - curses is standard, and will allow you to handle mono terminals and things as well

Offline

#46 2006-04-03 22:25:52

codemac
Member
From: Cliche Tech Place
Registered: 2005-05-13
Posts: 794
Website

Re: pacman with colored -Ss

Yes yes, but remember our IRC convo?  I'm rewriting curses!

I kid, I kid.

Offline

#47 2006-04-04 00:12:09

sh__
Member
Registered: 2005-07-19
Posts: 272

Re: pacman with colored -Ss

It's relatively simple to colorize the output as in the above sed scripts. I snatched the colors from raskolnikov's post and made a crude patch against pacman 2.9.8. It turns on colorized output in pacman if /etc/pacman.conf contains the variable ColorOutput. Grab the patch from pastebin: http://arch.pastebin.com/638930

Offline

#48 2006-04-04 03:03:04

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: pacman with colored -Ss

sh__ wrote:

It's relatively simple to colorize the output as in the above sed scripts. I snatched the colors from raskolnikov's post and made a crude patch against pacman 2.9.8. It turns on colorized output in pacman if /etc/pacman.conf contains the variable ColorOutput. Grab the patch from pastebin: http://arch.pastebin.com/638930

Bah, do it in curses.  I want underline/bold attributes for mono terminals.

Offline

#49 2006-04-04 14:57:12

Benol
Member
From: Warsaw, Poland
Registered: 2006-03-20
Posts: 28

Re: pacman with colored -Ss

I don't consider myself "only a user". I read the pacman source (althought I must do it one more time to understand more wink ). I am aware, that colored output can be implemented in different ways. I don't have time right now to play with this patch, but if it works, that's exactly what I wanted. It's enought for the majority of users - of course other implementations (like curses) could be nice as well, but it requiers more work.

So could such a functionality (with --no-color option and appropriate entry in pacman.conf) be included in pacman 3?

And as for command line and remembering the commands - I know quite a few, but still would like all the pacman functionality in one pacman program with appropriate options (which can be reminded by the --help screen when needed).

Offline

#50 2006-04-05 06:56:27

sud_crow
Member
From: Argentina
Registered: 2003-06-30
Posts: 546
Website

Re: pacman with colored -Ss

I think its great to have color for the descriptions, if you search for something that's named all over the packages, then you can omit reading the name and go for the description (based on color its much faster, although your brain could do it without it, using the [tab] difference between one and other.) that makes using pacman simpler, which i think is a good thing.

I dont know how hard is to program this into pacman, even dont know the ways to do it, but i dont understand why such resistance to this 'feature'...

As we are on the theme, i updated several packages today (gnome, kde and others), i would like to ... not 'complain', but to make a point as we are talking about pacman usability.

I think (and i have said it before) that the pacman -Syu output is horrible for big updates. Its a huge quantity of letters and numbers where you cant distinguish current packages from extra ones, sometimes they aren't even ordered alphabetically  so you cant search for a particular name neither. You wont see this if you do daily updates. But im sure more than one out there does.

I don't get the order, maybe its currents on top, extras on bottom, but i don't think so, they are all mixed up to my eyes, i think it should be something easier to understand, even something like when the packages are already downloading and there is a title saying "retrieving from current" or "retrieving from extra", you could use that same model, and make two paragraphs with currents and extra packages alphabetically ordered.

For ex. where is the KISS philosophy here:

$ pacman -Ss "something" | grep "/" | grep "something"

That's not simple to me, of course you cant have it simple for everybody, but lets be real, that's not simple! if i want to view the packages related with 'something', why then should i run a grep searching again for it? isn't that the purpose of using -Ss?
Im using this as an example, i use grep all the time.

As someone said above, this are just trivial stuff, and even meaningless if you like, but they are nice, and they are simple. Well, simple for some (or maybe not), as I don't have a clue on how to make those mods to pacman, but, I'm just making a point, if its heard, good, if not... I'll live. The thing is, all this ideas are to improve pacman, and they should at least be considered and apreciated, and even more, not to be confused with orders or forced requests...


Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux

Offline

Board footer

Powered by FluxBB