ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexander Bokovoy <ab@avilink.net>
To: devel@linux.iplabs.ru
Subject: [devel] Re: пересборка пакетов
Date: Sun, 10 Dec 2000 13:36:09 +0200
Message-ID: <20001210133609.A1217@avilink.net> (raw)
In-Reply-To: <3A32FD32.6944CEA@logic.ru>; from aen@logic.ru on Sun, Dec 10, 2000 at 06:49:06AM +0300

[-- Attachment #1: Type: text/plain, Size: 2540 bytes --]

On Sun, Dec 10, 2000 at 06:49:06AM +0300, aen wrote:
> "Dmitry V. Levin" wrote:
> > 
> 
> > 
> > Простого --rebuild я пока что не делаю.
> 
> Я, кстати, -- тоже.
Аналогично.

Теперь о другом. Выношу небольшой патч на обсуждение общественности:
В initscripts по наследству от RH досталось цветовое выделение результата
запуска службы, при этом предлагается использовать /etc/sysconfig/init
для настройки операций сдвига курсора и изменения цвета. Все хорошо, но
хотелось бы автоматическую подстройку этой маркировки под текущий терминал,
то есть, выводить сообщение о результате (ОК, FAILED) с правого края.
Текущая конфигурация зашивает это намертво. Вот патч, который автоматически
подстраивается под настройки терминала:

--- /etc/rc.d/init.d/functions.orig     Fri Oct  6 16:40:03 2000
+++ /etc/rc.d/init.d/functions  Sun Dec 10 13:08:50 2000
@@ -13,7 +13,13 @@
 export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"

 # Get a sane screen width
-[ -z "$COLUMNS" ] && COLUMNS=80
+if [ -z "$COLUMNS" ]; then
+    if [ -x /usr/bin/tput ]; then
+       COLUMNS=`/usr/bin/tput cols`
+    else
+       COLUMNS=80
+    fi
+fi

 # Read in our configuration
 if [ -z "$BOOTUP" ]; then
@@ -23,7 +29,7 @@
     # This all seem confusing? Look in /etc/sysconfig/init,
     # or in /usr/doc/initscripts-*/sysconfig.txt
     BOOTUP=color
-    RES_COL=60
+    RES_COL=$(($COLUMNS - 10))
     MOVE_TO_COL="echo -en \\033[${RES_COL}G"
     SETCOLOR_SUCCESS="echo -en \\033[1;32m"
     SETCOLOR_FAILURE="echo -en \\033[1;31m"
--- /etc/sysconfig/init.orig    Sun Dec 10 13:31:43 2000
+++ /etc/sysconfig/init Sun Dec 10 13:08:36 2000
@@ -3,7 +3,7 @@
 # anything else => new style bootup without ANSI colors or positioning
 BOOTUP=color
 # column to start "[  OK  ]" label in
-RES_COL=60
+RES_COL=$(($COLUMNS - 10))
 # terminal sequence to move to that column. You could change this
 # to something like "tput hpa ${RES_COL}" if your terminal supports it
 MOVE_TO_COL="echo -en \\033[${RES_COL}G"


tput -- из пакета ncurses, сразу после монтирования /usr весь вывод
будет подкорректирован на ширину терминала. Я еще подправил -20 на -10,
так как это лучше выглядит. Комментарии?
-- 
Sincerely yours, Alexander Bokovoy 
  The Midgard Project   | www.midgard-project.org |    Aurora R&D team 
Minsk Linux Users Group |    www.minsk-lug.net    |  www.aurora-linux.com  
   IPLabs Linux Team    |     linux.iplabs.ru     | Architecte Open Source
-- A plucked goose doesn't lay golden eggs.

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

  reply	other threads:[~2000-12-10 11:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-09 18:13 [devel] " Peter Novodvorsky
2000-12-09 23:21 ` [devel] " aen
2000-12-09 19:52   ` [devel] " Peter Novodvorsky
2000-12-09 20:49     ` [devel] " Alexander Bokovoy
2000-12-09 20:50       ` [devel] " Peter Novodvorsky
2000-12-09 21:22         ` Alexander Bokovoy
2000-12-09 21:50           ` [devel] " Peter Novodvorsky
2000-12-10  3:44             ` aen
2000-12-09 22:22         ` Mikhail Zabaluev
2000-12-09 22:58           ` [devel] " Peter Novodvorsky
2000-12-09 23:16     ` [devel] " Dmitry V. Levin
2000-12-10  3:49       ` aen
2000-12-10 11:36         ` Alexander Bokovoy [this message]
2000-12-10 15:38           ` [devel] Re: [devel] " Dmitry V. Levin
2000-12-10 20:03             ` [devel] Re: [devel] " Alexander Bokovoy
2000-12-10 23:26               ` [devel] initscripts Dmitry V. Levin
2000-12-10 23:36                 ` Alexander Bokovoy
2000-12-11  0:26                   ` Dmitry V. Levin
2000-12-11  7:47                     ` Alexander Bokovoy
2000-12-11 16:31                       ` Dmitry V. Levin
2000-12-11 17:31                         ` Dmitry V. Levin
2000-12-11 19:33                           ` Alexander Bokovoy
2000-12-11 19:32                         ` Alexander Bokovoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20001210133609.A1217@avilink.net \
    --to=ab@avilink.net \
    --cc=devel@linux.iplabs.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git