You are not logged in.

#26 2004-08-26 21:46:13

tehdely
Member
Registered: 2004-02-20
Posts: 148
Website

Re: Make pacman chomp

jsutnoni wrote:

what was i doing wrong? id like to know so it dont happen again.

it could be one of many things.

if you had the patch line in your PKGBUILD, but were manually patching as well (after running makepkg -o), then it would try to patch the same file twice and thus detect a possibly reversed/duplicate patch, etc.


[Arch GNUstep Repository] [ PKGBUILDS ]
[code][gnustep]
Server = ftp://blkwidow.lerp.com/pub/mirror/arch/gnustep[/code]

Offline

#27 2004-08-27 02:03:45

jbNet
Member
From: Klamath Falls, OR, USA
Registered: 2004-08-12
Posts: 34

Re: Make pacman chomp

grabbed the patch from the mirror, and works great... I bet it was some sort of copy/paste whitespace thing.

Thanks, this is very neat smile

(include it!!!)

Offline

#28 2004-08-27 05:59:05

sarah31
Member
From: Middle of Canada
Registered: 2002-08-20
Posts: 2,975
Website

Re: Make pacman chomp

jsutnoni wrote:

what was i doing wrong? id like to know so it dont happen again.

possibly you rpatch had some white spaces in ther ethat were causing issues.

also I forgot to tell you to add the name of the patch to the source=() array. this has cause hunk failures for me before.

checking for whitespaces or the addition of characters is usually a good idea. you may need to check using a few editors.


AKA uknowme

I am not your friend

Offline

#29 2004-08-29 22:08:14

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: Make pacman chomp

Cutting and pasting to/from the forums usually converts the tabs to spaces.  I had this happen to a patch I posted once.  I don't think there's much you can do about it except download the file.

Offline

#30 2004-09-13 14:41:55

BigBadPenguin
Member
From: Toronto, Canada
Registered: 2004-03-03
Posts: 51

Re: Make pacman chomp

big_smile  Great work tehdely!

Offline

#31 2004-09-19 02:18:53

Noir
Member
From: Monterrey, Mexico
Registered: 2004-09-09
Posts: 28

Re: Make pacman chomp

Now it would be cool if it had color too! HINT HINT


wink

Offline

#32 2004-09-19 04:27:50

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: Make pacman chomp

Noir wrote:

Now it would be cool if it had color too! HINT HINT


wink

DONE!  8)

I'm not sure this is the proper way to do it, but I simply escaped the desired colors. Pacman is now yellow, while I left the dots white.

Enjoy!

diff -Naur orig/pacman-2.8.4/src/pacsync.c pacman-2.8.4/src/pacsync.c
--- orig/pacman-2.8.4/src/pacsync.c     2004-07-16 20:16:35.000000000 -0500
+++ pacman-2.8.4/src/pacsync.c  2004-08-25 03:40:13.000000000 -0500
@@ -57,6 +57,11 @@
 extern PMList *pmc_syncs;
 extern int maxcols;
 
+/* hot hot pacman action */
+struct mouth {
+       unsigned open:1;
+};
+
 int sync_synctree()
 {
        char ldir[PATH_MAX] = "";
@@ -393,6 +398,9 @@
        struct timeval t1;
        float timediff;
 
+       static struct mouth mouth;
+       static unsigned int lastcur = 0;
+
        gettimeofday(&t1, NULL);
        if(xfered+offset == fsz) {
                t = t0;
@@ -424,13 +432,17 @@
        printf(" %s [", sync_fnm);
        cur = (int)((maxcols-64)*pct/100);
        for(i = 0; i < maxcols-64; i++) {
-               (i < cur) ? printf("#") : printf(" ");
+               (i < cur) ? printf("-") : (i == cur) ? ((lastcur == cur) ?
+                       (mouth.open ? printf("33[1;33mC33[0;15m") : printf("33[1;33mc33[0;15m")) :
+                       (++mouth.open ? printf("33[1;33mC33[0;15m") : printf("33[1;33mc33[0;15m"))) :
+                       printf("*");
        }
        if(rate > 1000) {
                printf("] %3d%%  %6dK  %6.0fK/s  %02d:%02d:%02dr", pct, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s);
        } else {
                printf("] %3d%%  %6dK  %6.1fK/s  %02d:%02d:%02dr", pct, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s);
        }
+       lastcur = cur;
        fflush(stdout);
        return(1);
 }

Also available at: http://neotuli.dyndns.org/arch/colorchomp.diff

PS: Patch works agains 2.9


The suggestion box only accepts patches.

Offline

#33 2004-09-19 05:02:36

tehdely
Member
Registered: 2004-02-20
Posts: 148
Website

Re: Make pacman chomp

I love you neotuli  wink


[Arch GNUstep Repository] [ PKGBUILDS ]
[code][gnustep]
Server = ftp://blkwidow.lerp.com/pub/mirror/arch/gnustep[/code]

Offline

#34 2004-09-20 00:05:26

LavaPunk
Member
Registered: 2004-03-05
Posts: 129

Re: Make pacman chomp

What can I change in that patch to make my dots white?  My console font is red (by choice)  and I'd like to keep the rest of my font red, just the dots white and pacman yellow... I'm sure it's possibly....

Offline

#35 2004-09-20 00:24:28

Noir
Member
From: Monterrey, Mexico
Registered: 2004-09-09
Posts: 28

Re: Make pacman chomp

LavaPunk wrote:

What can I change in that patch to make my dots white?  My console font is red (by choice)  and I'd like to keep the rest of my font red, just the dots white and pacman yellow... I'm sure it's possibly....


Check this webpage

http://www.linuxgazette.com/issue65/padala.html


I'm too lazy to do it myself, but in that webpage  they explain pretty well how the color escape codes work. i.e. yellow is 33

Offline

#36 2004-09-20 00:31:23

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: Make pacman chomp

Errr...as I mentioned in my first patch, it was a quick, more than likely incorrect, job. Turns out I was right.  :?  Thanks for asking Lavapunk, you got me to fix the whole damn thing in the process  big_smile  .
Consider the first patch I gave obsolete, and use this one.

Changes:
-Correctly returns to previous terminal color
-Doesn't stupidly assume that everyone has a white terminal
-Explicitly specifies white for the dots

diff -Naur orig/pacman-2.8.4/src/pacsync.c pacman-2.8.4/src/pacsync.c
--- orig/pacman-2.8.4/src/pacsync.c     2004-07-16 20:16:35.000000000 -0500
+++ pacman-2.8.4/src/pacsync.c  2004-08-25 03:40:13.000000000 -0500
@@ -57,6 +57,11 @@
 extern PMList *pmc_syncs;
 extern int maxcols;
 
+/* hot hot pacman action */
+struct mouth {
+       unsigned open:1;
+};
+
 int sync_synctree()
 {
        char ldir[PATH_MAX] = "";
@@ -393,6 +398,9 @@
        struct timeval t1;
        float timediff;
 
+       static struct mouth mouth;
+       static unsigned int lastcur = 0;
+
        gettimeofday(&t1, NULL);
        if(xfered+offset == fsz) {
                t = t0;
@@ -424,13 +432,17 @@
        printf(" %s [", sync_fnm);
        cur = (int)((maxcols-64)*pct/100);
        for(i = 0; i < maxcols-64; i++) {
-               (i < cur) ? printf("#") : printf(" ");
+               (i < cur) ? printf("-") : (i == cur) ? ((lastcur == cur) ?
+                       (mouth.open ? printf("33[1;33mC33[m") : printf("33[1;33mc33[m")) :
+                       (++mouth.open ? printf("33[1;33mC33[m") : printf("33[1;33mc33[m"))) :
+                       printf("33[0;37m*33[m");
        }
        if(rate > 1000) {
                printf("] %3d%%  %6dK  %6.0fK/s  %02d:%02d:%02dr", pct, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s);
        } else {
                printf("] %3d%%  %6dK  %6.1fK/s  %02d:%02d:%02dr", pct, ((xfered+offset) / 1024), rate, eta_h, eta_m, eta_s);
        }
+       lastcur = cur;
        fflush(stdout);
        return(1);
 }

Still available at http://neotuli.dyndns.org/arch/colorchomp.diff

Enjoy! lol

EDIT: I'd just like to add a known problem disclaimer-ish thing. If for some reason someone runs pacman on a terminal that does not support these perticular escape sequences (which I would not really expect...but you never know), I would expect the output to be VERY ugly.


The suggestion box only accepts patches.

Offline

#37 2004-09-20 01:21:13

LavaPunk
Member
Registered: 2004-03-05
Posts: 129

Re: Make pacman chomp

Thanks a ton.  It's dead sexy! smile

Offline

#38 2004-09-20 13:57:48

Egil.B
Member
From: Universitas Osloensis
Registered: 2004-02-14
Posts: 116

Re: Make pacman chomp

No we'll just have to wait untill Judd includes it.  8)

Offline

#39 2004-09-20 15:01:21

dp
Member
From: Aarau, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: Make pacman chomp

great work neotuli!

did you sent Judd your patch?


The impossible missions are the only ones which succeed.

Offline

#40 2004-09-20 16:48:46

Dreameen
Member
From: Poland
Registered: 2004-09-06
Posts: 252

Re: Make pacman chomp

Hmmmm...this patch doesn't work with the latest pacman. Where can i download the old version of pacman???

Offline

#41 2004-09-20 20:07:44

Noir
Member
From: Monterrey, Mexico
Registered: 2004-09-09
Posts: 28

Re: Make pacman chomp

Dreameen wrote:

Hmmmm...this patch doesn't work with the latest pacman. Where can i download the old version of pacman???

The patch does work with the latest version of pacman (I installed it yesterday). You only have to modify the upperpart of the .diff file. I mean:

change this

diff -Naur orig/pacman-2.8.4/src/pacsync.c pacman-2.8.4/src/pacsync.c 
--- orig/pacman-2.8.4/src/pacsync.c     2004-07-16 20:16:35.000000000 -0500 
+++ pacman-2.8.4/src/pacsync.c  2004-08-25 03:40:13.000000000 -0500 

to this:


diff -Naur orig/pacman-2.9/src/pacsync.c pacman-2.9/src/pacsync.c 
--- orig/pacman-2.9/src/pacsync.c     2004-07-16 20:16:35.000000000 -0500 
+++ pacman-2.9/src/pacsync.c  2004-08-25 03:40:13.000000000 -0500 

.

save the file run makepkg -o apply the patch , then makepkg -e, and afterwards pacman --upgrade pacman-2.9.tar.gz

Offline

#42 2004-09-20 22:07:41

Dreameen
Member
From: Poland
Registered: 2004-09-06
Posts: 252

Re: Make pacman chomp

It looks like the file is patched and all, but still I can't see the magic after pacman -U [newly created package].

Offline

#43 2004-09-20 23:22:52

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: Make pacman chomp

Noir wrote:
Dreameen wrote:

Hmmmm...this patch doesn't work with the latest pacman. Where can i download the old version of pacman???

The patch does work with the latest version of pacman (I installed it yesterday). You only have to modify the upperpart of the .diff file. I mean:

change this

diff -Naur orig/pacman-2.8.4/src/pacsync.c pacman-2.8.4/src/pacsync.c 
--- orig/pacman-2.8.4/src/pacsync.c     2004-07-16 20:16:35.000000000 -0500 
+++ pacman-2.8.4/src/pacsync.c  2004-08-25 03:40:13.000000000 -0500 

to this:


diff -Naur orig/pacman-2.9/src/pacsync.c pacman-2.9/src/pacsync.c 
--- orig/pacman-2.9/src/pacsync.c     2004-07-16 20:16:35.000000000 -0500 
+++ pacman-2.9/src/pacsync.c  2004-08-25 03:40:13.000000000 -0500 

.

save the file run makepkg -o apply the patch , then makepkg -e, and afterwards pacman --upgrade pacman-2.9.tar.gz

You shouldn't have to do any of this... patch using

cd (pacman source directory)
patch -p1 < (location of colorchomp.diff)

This will cause patch to strip off the first part of the file location, thus eliminating any need to change it manually.

Dreameen: are you using a color console?

DP: Submitting it right now.


The suggestion box only accepts patches.

Offline

#44 2004-09-21 12:10:38

Dreameen
Member
From: Poland
Registered: 2004-09-06
Posts: 252

Re: Make pacman chomp

I've tried patching the sources every possible way and the patch applies fine but it makes no difference for my pacman, maybe it has to do with some language setting or font encoding in my consoles, dunno.

Yes, I'm using a color console. I've tried running pacman in aterm, rxvt, text console, and the only thing i see is a growing arrow(guess my pacman is a true archer wink

Offline

#45 2004-09-24 05:22:42

lytez
Member
Registered: 2003-11-28
Posts: 16
Website

Re: Make pacman chomp

I really think this should be added as a 'secret' command line option, similar to debians `apt-get moo`.


.: lytez :.

Offline

#46 2004-09-24 05:35:11

GT
Member
Registered: 2004-09-24
Posts: 13

Re: Make pacman chomp

Just patched it and it works great with pacman-2.9, aterm, and zsh.  big_smile

Offline

#47 2004-09-26 00:16:44

tehdely
Member
Registered: 2004-02-20
Posts: 148
Website

Re: Make pacman chomp

Updated diff for 2.9.2:

hyar


[Arch GNUstep Repository] [ PKGBUILDS ]
[code][gnustep]
Server = ftp://blkwidow.lerp.com/pub/mirror/arch/gnustep[/code]

Offline

#48 2004-09-26 02:30:03

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: Make pacman chomp

Great! Toss it over to Judd as a replacement for the one I sent earlier, maybe 2.9.3 will be chomping smile


The suggestion box only accepts patches.

Offline

#49 2004-09-26 23:33:16

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: Make pacman chomp

Dreameen wrote:

I've tried patching the sources every possible way and the patch applies fine but it makes no difference for my pacman, maybe it has to do with some language setting or font encoding in my consoles, dunno.

Yes, I'm using a color console. I've tried running pacman in aterm, rxvt, text console, and the only thing i see is a growing arrow(guess my pacman is a true archer wink

I just thought of what the problem is, are you using wget? If so, disable it in /etc/pacman.conf.


The suggestion box only accepts patches.

Offline

#50 2004-10-02 10:05:07

Dreameen
Member
From: Poland
Registered: 2004-09-06
Posts: 252

Re: Make pacman chomp

Yep. This is probably the problem. I'll disable wget, patch newest pacman and see if it works. Thanks.

Offline

Board footer

Powered by FluxBB