--- Begin Message ---
Subject: sysv-rc-conf: easier configuration of representation
Package: sysv-rc-conf
Version: 0.99-6
Severity: normal
Tags: patch
*** Please type your report below this line ***
Hello,
representation of sysv-rc-conf cuts of the names of the init-scripts for
visualisation on 80x50, i think.
The variables in the script are
LABEL_WIDTH => 10 # View in the config-screen
LIST_SN_LENGTH => 12 # View in the '--list'-mode
and additionally some direct values in the script.
patch1 replaces the "hardcoded" values with the LABEL_WIDTH.
patch2 does one step more, it replaces the values and LIST_SN_LENGTH with
LABEL_WIDTH,
so there is just one variable.
I cannot make LABEL_WIDTH a commandline-Parameter or modify the script to parse
a config-file,
e.g. /etc/default/sysv-rc-conf.
A more comfortable way would be to calculate the LABEL_WIDTH resp. to COLUMNS
and the filename-length of the (current) init.d/-scripts,
but that is work for someone who knows perl?
Greetings
christian
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.30-2-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages sysv-rc-conf depends on:
ii libcurses-ui-perl 0.9607-1 curses-based OO user interface fra
ii sysv-rc 2.87dsf-8 System-V-like runlevel change mech
sysv-rc-conf recommends no packages.
sysv-rc-conf suggests no packages.
-- no debconf information
___________________________________________________________
Preisknaller: WEB.DE DSL Flatrate für nur 16,99 Euro/mtl.!
http://produkte.web.de/go/02/
--- sysv-rc-conf_old 2007-01-26 15:56:28.000000000 +0100
+++ sysv-rc-conf_new1 2009-12-03 06:25:36.000000000 +0100
@@ -31,8 +31,8 @@
BOTTOM_WIN_HEIGHT => 4,
DEFAULT_K_PRI => 80,
DEFAULT_S_PRI => 20,
- LABEL_WIDTH => 10,
- LIST_SN_LENGTH => 12,
+ LABEL_WIDTH => 22,
+ LIST_SN_LENGTH => 22,
LIST_SN_PAD => 1,
MAX_ROWS => 8,
TOP_LABEL_HEIGHT => 2,
@@ -791,7 +791,7 @@
{
my ($screen, $sn, $row) = @_;
- for (my $i = 0, my $right_n = 12; $i <= $#show_rls; $i++, $right_n += 8) {
+ for (my $i = 0, my $right_n = LABEL_WIDTH; $i <= $#show_rls; $i++, $right_n += 8) {
my $on_or_off = 0;
my $initial_state = 0;
# We only want to show S\d\d services as selected.
@@ -830,7 +830,7 @@
{
my ($screen, $sn, $row) = @_;
- for (my $i = 0, my $right_n = 11; $i <= $#show_rls; $i++, $right_n += 8) {
+ for (my $i = 0, my $right_n = LABEL_WIDTH; $i <= $#show_rls; $i++, $right_n += 8) {
my $text = exists $runlevels{$sn}{$show_rls[$i]}
? $runlevels{$sn}{$show_rls[$i]}
: '';
@@ -867,10 +867,11 @@
my @label_rls = @show_rls;
- my $text = 'service ' . shift @label_rls;
+ my $firstlabel = "service";
+ my $text = $firstlabel . " " x (LABEL_WIDTH + 1 - length($firstlabel)) . shift @label_rls;
foreach (@label_rls) { $text .= " $_" };
$text .= "\n";
- $text .= "-" x 76;
+ $text .= "-" x (LABEL_WIDTH + (length($opts{show}) * 8));
$window->add(
undef, 'Label',
--- sysv-rc-conf_old 2007-01-26 15:56:28.000000000 +0100
+++ sysv-rc-conf_new2 2009-12-03 06:25:28.000000000 +0100
@@ -31,8 +31,7 @@
BOTTOM_WIN_HEIGHT => 4,
DEFAULT_K_PRI => 80,
DEFAULT_S_PRI => 20,
- LABEL_WIDTH => 10,
- LIST_SN_LENGTH => 12,
+ LABEL_WIDTH => 22,
LIST_SN_PAD => 1,
MAX_ROWS => 8,
TOP_LABEL_HEIGHT => 2,
@@ -214,8 +213,8 @@
# There was an argument to --list
my $opt_sn = $opts{chkcfg_list};
foreach my $sn (sort keys %runlevels) {
- my $output = substr $sn, 0, LIST_SN_LENGTH;
- $output .= " " until length $output >= LIST_SN_LENGTH + LIST_SN_PAD;
+ my $output = substr $sn, 0, LABEL_WIDTH;
+ $output .= " " until length $output >= LABEL_WIDTH + LIST_SN_PAD;
foreach my $rl (sort keys %{$runlevels{$sn}}) {
$output .= "$rl:";
@@ -791,7 +790,7 @@
{
my ($screen, $sn, $row) = @_;
- for (my $i = 0, my $right_n = 12; $i <= $#show_rls; $i++, $right_n += 8) {
+ for (my $i = 0, my $right_n = LABEL_WIDTH; $i <= $#show_rls; $i++, $right_n += 8) {
my $on_or_off = 0;
my $initial_state = 0;
# We only want to show S\d\d services as selected.
@@ -830,7 +829,7 @@
{
my ($screen, $sn, $row) = @_;
- for (my $i = 0, my $right_n = 11; $i <= $#show_rls; $i++, $right_n += 8) {
+ for (my $i = 0, my $right_n = LABEL_WIDTH; $i <= $#show_rls; $i++, $right_n += 8) {
my $text = exists $runlevels{$sn}{$show_rls[$i]}
? $runlevels{$sn}{$show_rls[$i]}
: '';
@@ -867,10 +866,11 @@
my @label_rls = @show_rls;
- my $text = 'service ' . shift @label_rls;
+ my $firstlabel = "service";
+ my $text = $firstlabel . " " x (LABEL_WIDTH + 1 - length($firstlabel)) . shift @label_rls;
foreach (@label_rls) { $text .= " $_" };
$text .= "\n";
- $text .= "-" x 76;
+ $text .= "-" x (LABEL_WIDTH + (length($opts{show}) * 8));
$window->add(
undef, 'Label',
--- End Message ---