diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2012-06-29 11:15:16 +0200 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2012-06-29 11:15:16 +0200 |
commit | 95e1f7f04a6cd0145a5fa4e8cc6a698b255d584c (patch) | |
tree | 7e5893269a832394426769ad6e62eb78884481f0 /testing/sysvinit | |
parent | 3d78c697bec82866c6871b610d15fb9d1f82440f (diff) | |
parent | a9811800fb65ca331655a1bbe22e67e7564099f8 (diff) |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts:
extra/claws-mail-extra-plugins/PKGBUILD
extra/gcin/PKGBUILD
extra/qt/PKGBUILD
kde-unstable/kactivities/PKGBUILD
kde-unstable/kdeaccessibility-jovie/PKGBUILD
kde-unstable/kdeaccessibility-kaccessible/PKGBUILD
kde-unstable/kdeaccessibility-kmag/PKGBUILD
kde-unstable/kdeaccessibility-kmousetool/PKGBUILD
kde-unstable/kdeaccessibility-kmouth/PKGBUILD
kde-unstable/kdeadmin/PKGBUILD
kde-unstable/kdeartwork/PKGBUILD
kde-unstable/kdebase-konsole/PKGBUILD
kde-unstable/kdebase-runtime/PKGBUILD
kde-unstable/kdebase-workspace/PKGBUILD
kde-unstable/kdebase/PKGBUILD
kde-unstable/kdebindings-kimono/PKGBUILD
kde-unstable/kdebindings-korundum/PKGBUILD
kde-unstable/kdebindings-kross/PKGBUILD
kde-unstable/kdebindings-perlkde/PKGBUILD
kde-unstable/kdebindings-perlqt/PKGBUILD
kde-unstable/kdebindings-python/PKGBUILD
kde-unstable/kdebindings-qtruby/PKGBUILD
kde-unstable/kdebindings-qyoto/PKGBUILD
kde-unstable/kdebindings-smokegen/PKGBUILD
kde-unstable/kdebindings-smokekde/PKGBUILD
kde-unstable/kdebindings-smokeqt/PKGBUILD
kde-unstable/kdeedu-analitza/PKGBUILD
kde-unstable/kdeedu-blinken/PKGBUILD
kde-unstable/kdeedu-cantor/PKGBUILD
kde-unstable/kdeedu-kalgebra/PKGBUILD
kde-unstable/kdeedu-kalzium/PKGBUILD
kde-unstable/kdeedu-kanagram/PKGBUILD
kde-unstable/kdeedu-kbruch/PKGBUILD
kde-unstable/kdeedu-kgeography/PKGBUILD
kde-unstable/kdeedu-khangman/PKGBUILD
kde-unstable/kdeedu-kig/PKGBUILD
kde-unstable/kdeedu-kiten/PKGBUILD
kde-unstable/kdeedu-klettres/PKGBUILD
kde-unstable/kdeedu-kmplot/PKGBUILD
kde-unstable/kdeedu-kstars/PKGBUILD
kde-unstable/kdeedu-ktouch/PKGBUILD
kde-unstable/kdeedu-kturtle/PKGBUILD
kde-unstable/kdeedu-kwordquiz/PKGBUILD
kde-unstable/kdeedu-marble/PKGBUILD
kde-unstable/kdeedu-pairs/PKGBUILD
kde-unstable/kdeedu-parley/PKGBUILD
kde-unstable/kdeedu-rocs/PKGBUILD
kde-unstable/kdeedu-step/PKGBUILD
kde-unstable/kdegames/PKGBUILD
kde-unstable/kdegraphics-gwenview/PKGBUILD
kde-unstable/kdegraphics-kamera/PKGBUILD
kde-unstable/kdegraphics-kcolorchooser/PKGBUILD
kde-unstable/kdegraphics-kgamma/PKGBUILD
kde-unstable/kdegraphics-kolourpaint/PKGBUILD
kde-unstable/kdegraphics-kruler/PKGBUILD
kde-unstable/kdegraphics-ksaneplugin/PKGBUILD
kde-unstable/kdegraphics-ksnapshot/PKGBUILD
kde-unstable/kdegraphics-mobipocket/PKGBUILD
kde-unstable/kdegraphics-okular/PKGBUILD
kde-unstable/kdegraphics-strigi-analyzer/PKGBUILD
kde-unstable/kdegraphics-svgpart/PKGBUILD
kde-unstable/kdegraphics-thumbnailers/PKGBUILD
kde-unstable/kdemultimedia-audiocd-kio/PKGBUILD
kde-unstable/kdemultimedia-dragonplayer/PKGBUILD
kde-unstable/kdemultimedia-ffmpegthumbs/PKGBUILD
kde-unstable/kdemultimedia-juk/PKGBUILD
kde-unstable/kdemultimedia-kmix/PKGBUILD
kde-unstable/kdemultimedia-kscd/PKGBUILD
kde-unstable/kdemultimedia-mplayerthumbs/PKGBUILD
kde-unstable/kdenetwork/PKGBUILD
kde-unstable/kdepim-runtime/PKGBUILD
kde-unstable/kdepim/PKGBUILD
kde-unstable/kdepimlibs/PKGBUILD
kde-unstable/kdeplasma-addons/PKGBUILD
kde-unstable/kdesdk-kate/PKGBUILD
kde-unstable/kdesdk/PKGBUILD
kde-unstable/kdetoys/PKGBUILD
kde-unstable/kdeutils-filelight/PKGBUILD
kde-unstable/kdeutils-kcalc/PKGBUILD
kde-unstable/kdeutils-kcharselect/PKGBUILD
kde-unstable/kdeutils-kdf/PKGBUILD
kde-unstable/kdeutils-kfloppy/PKGBUILD
kde-unstable/kdeutils-kgpg/PKGBUILD
kde-unstable/kdeutils-kremotecontrol/PKGBUILD
kde-unstable/kdeutils-ktimer/PKGBUILD
kde-unstable/kdeutils-kwallet/PKGBUILD
kde-unstable/kdeutils-superkaramba/PKGBUILD
kde-unstable/kdeutils-sweeper/PKGBUILD
kde-unstable/kdewebdev/PKGBUILD
kde-unstable/libkcddb/PKGBUILD
kde-unstable/libkcompactdisc/PKGBUILD
kde-unstable/libkdcraw/PKGBUILD
kde-unstable/libkdeedu/PKGBUILD
kde-unstable/libkexiv2/PKGBUILD
kde-unstable/libkipi/PKGBUILD
kde-unstable/libksane/PKGBUILD
kde-unstable/nepomuk-core/PKGBUILD
kde-unstable/soprano/PKGBUILD
testing/systemd/PKGBUILD
Diffstat (limited to 'testing/sysvinit')
-rw-r--r-- | testing/sysvinit/0001-simplify-writelog.patch | 126 | ||||
-rw-r--r-- | testing/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch | 80 |
2 files changed, 0 insertions, 206 deletions
diff --git a/testing/sysvinit/0001-simplify-writelog.patch b/testing/sysvinit/0001-simplify-writelog.patch deleted file mode 100644 index cc28f14bc..000000000 --- a/testing/sysvinit/0001-simplify-writelog.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 5577552eb1344ddd661893564b1e628f8edcf13d Mon Sep 17 00:00:00 2001 -From: Florian Pritz <bluewind@xinu.at> -Date: Fri, 15 Jun 2012 16:41:52 +0200 -Subject: [PATCH 1/2] simplify writelog() - -All we do is prepend the date and remove \r. We don't handle color -codes, but the user can just cat the log file in a terminal and it will -interpret the codes correctly. - -Signed-off-by: Florian Pritz <bluewind@xinu.at> ---- - bootlogd.c | 76 +++++++++++++++++------------------------------------------- - 1 file changed, 21 insertions(+), 55 deletions(-) - -diff --git a/bootlogd.c b/bootlogd.c -index 570d382..e36e261 100644 ---- a/bootlogd.c -+++ b/bootlogd.c -@@ -68,11 +68,6 @@ int didnl = 1; - int createlogfile = 0; - int syncalot = 0; - --struct line { -- char buf[256]; -- int pos; --} line; -- - /* - * Console devices as listed on the kernel command line and - * the mapping to actual devices in /dev -@@ -351,63 +346,34 @@ int consolename(char *res, int rlen) - */ - void writelog(FILE *fp, unsigned char *ptr, int len) - { -- time_t t; -- char *s; -- char tmp[8]; -- int olen = len; -- int dosync = 0; -- int tlen; -- -- while (len > 0) { -- tmp[0] = 0; -- if (didnl) { -+ int dosync = 0; -+ int i; -+ static int first_run = 1; -+ -+ for (i = 0; i < len; i++) { -+ int ignore = 0; -+ -+ /* prepend date to every line */ -+ if (*(ptr-1) == '\n' || first_run) { -+ time_t t; -+ char *s; - time(&t); - s = ctime(&t); - fprintf(fp, "%.24s: ", s); -- didnl = 0; -+ dosync = 1; -+ first_run = 0; - } -- switch (*ptr) { -- case 27: /* ESC */ -- strcpy(tmp, "^["); -- break; -- case '\r': -- line.pos = 0; -- break; -- case 8: /* ^H */ -- if (line.pos > 0) line.pos--; -- break; -- case '\n': -- didnl = 1; -- dosync = 1; -- break; -- case '\t': -- line.pos += (line.pos / 8 + 1) * 8; -- if (line.pos >= (int)sizeof(line.buf)) -- line.pos = sizeof(line.buf) - 1; -- break; -- case 32 ... 127: -- case 161 ... 255: -- tmp[0] = *ptr; -- tmp[1] = 0; -- break; -- default: -- sprintf(tmp, "\\%03o", *ptr); -- break; -- } -- ptr++; -- len--; - -- tlen = strlen(tmp); -- if (tlen && (line.pos + tlen < (int)sizeof(line.buf))) { -- memcpy(line.buf + line.pos, tmp, tlen); -- line.pos += tlen; -+ if (*ptr == '\r') { -+ ignore = 1; - } -- if (didnl) { -- fprintf(fp, "%s\n", line.buf); -- memset(&line, 0, sizeof(line)); -+ -+ if (!ignore) { -+ fwrite(ptr, sizeof(char), 1, fp); - } -- } - -+ ptr++; -+ } - if (dosync) { - fflush(fp); - if (syncalot) { -@@ -415,7 +381,7 @@ void writelog(FILE *fp, unsigned char *ptr, int len) - } - } - -- outptr += olen; -+ outptr += len; - if (outptr >= endptr) - outptr = ringbuf; - --- -1.7.10.4 - diff --git a/testing/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch b/testing/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch deleted file mode 100644 index 89b3280df..000000000 --- a/testing/sysvinit/0002-remove-ansi-escape-codes-from-log-file.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 8d0022d9540112a92ce8d88c91c4ac10bad8c9ef Mon Sep 17 00:00:00 2001 -From: Florian Pritz <bluewind@xinu.at> -Date: Sun, 24 Jun 2012 15:49:51 +0200 -Subject: [PATCH 2/2] remove ansi escape codes from log file - -References: https://en.wikipedia.org/wiki/ANSI_escape_code - -Signed-off-by: Florian Pritz <bluewind@xinu.at> ---- - bootlogd.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 43 insertions(+), 2 deletions(-) - -diff --git a/bootlogd.c b/bootlogd.c -index e36e261..88e610d 100644 ---- a/bootlogd.c -+++ b/bootlogd.c -@@ -349,6 +349,7 @@ void writelog(FILE *fp, unsigned char *ptr, int len) - int dosync = 0; - int i; - static int first_run = 1; -+ static int inside_esc = 0; - - for (i = 0; i < len; i++) { - int ignore = 0; -@@ -364,10 +365,50 @@ void writelog(FILE *fp, unsigned char *ptr, int len) - first_run = 0; - } - -- if (*ptr == '\r') { -- ignore = 1; -+ /* remove escape sequences, but do it in a way that allows us to stop -+ * in the middle in case the string was cut off */ -+ if (inside_esc == 1) { -+ /* first '[' is special because if we encounter it again, it should be considered the final byte */ -+ if (*ptr == '[') { -+ /* multi char sequence */ -+ ignore = 1; -+ inside_esc = 2; -+ } else { -+ /* single char sequence */ -+ if (*ptr >= 64 && *ptr <= 95) { -+ ignore = 1; -+ } -+ inside_esc = 0; -+ } -+ } else if (inside_esc == 2) { -+ switch (*ptr) { -+ case '0' ... '9': /* intermediate chars of escape sequence */ -+ case ';': -+ case 32 ... 47: -+ if (inside_esc) { -+ ignore = 1; -+ } -+ break; -+ case 64 ... 126: /* final char of escape sequence */ -+ if (inside_esc) { -+ ignore = 1; -+ inside_esc = 0; -+ } -+ break; -+ } -+ } else { -+ switch (*ptr) { -+ case '\r': -+ ignore = 1; -+ break; -+ case 27: /* ESC */ -+ ignore = 1; -+ inside_esc = 1; -+ break; -+ } - } - -+ - if (!ignore) { - fwrite(ptr, sizeof(char), 1, fp); - } --- -1.7.10.4 - |