You are not logged in.
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.
Offline
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
(include it!!!)
Offline
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
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
Great work tehdely!
Offline
Now it would be cool if it had color too! HINT HINT
![]()
Offline
Now it would be cool if it had color too! HINT HINT
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
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
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
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
.
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!
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
Thanks a ton. It's dead sexy! ![]()
Offline
No we'll just have to wait untill Judd includes it. 8)
Offline
great work neotuli!
did you sent Judd your patch?
The impossible missions are the only ones which succeed.
Offline
Hmmmm...this patch doesn't work with the latest pacman. Where can i download the old version of pacman???
Offline
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
It looks like the file is patched and all, but still I can't see the magic after pacman -U [newly created package].
Offline
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 -0500to 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
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 ![]()
Offline
I really think this should be added as a 'secret' command line option, similar to debians `apt-get moo`.
.: lytez :.
Offline
Just patched it and it works great with pacman-2.9, aterm, and zsh. ![]()
Offline
Great! Toss it over to Judd as a replacement for the one I sent earlier, maybe 2.9.3 will be chomping ![]()
The suggestion box only accepts patches.
Offline
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
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
Yep. This is probably the problem. I'll disable wget, patch newest pacman and see if it works. Thanks.
Offline