ALT Linux kernel packages development
 help / color / mirror / Atom feed
From: Anton Farygin <rider@altlinux.com>
To: ALT Linux kernel packages development <devel-kernel@altlinux.ru>
Subject: Re: [d-kernel] Re: Fwd: [Bug 3318] New: При установке любого ядра не прописывается соотвествующая секция в меню grub
Date: Wed, 26 Nov 2003 14:50:35 +0300
Message-ID: <3FC4938B.1060609@altlinux.com> (raw)
In-Reply-To: <20031125191915.GR2377@julia.office.altlinux.ru>

Alexey Tourbin wrote:
> On Tue, Nov 25, 2003 at 05:36:09PM +0300, Alexey Tourbin wrote:
> 
>>--- /usr/share/loader/grub-	2003-03-19 17:41:06 +0300
>>+++ /usr/share/loader/grub	2003-11-25 17:34:24 +0300
>>@@ -154,6 +154,7 @@ sub get_boot_partitions {
>>     local *F;
>>     open F, '/etc/fstab'; 
>>     while (<F>) {
>>+	next if /^#/;
>>  	my @s = split ' ';
>> 	$part = $s[0] if $s[1] =~ m|/$| and not $part;
>> 	if ($s[1] =~ m|/boot$|) {
>>
>>Вообще, там есть что по части перла зафиксить.
>>Или на shell'е переписать.
> 
> 
> В mdk юмористы (сравниваю с новой версией):
> 
> @@ -154,7 +187,7 @@ sub get_boot_partitions {
>      local *F;
>      open F, '/etc/fstab';
>      while (<F>) {
> -       next if /^#/;
> +       s/#.*//;
>         my @s = split ' ';
>         $part = $s[0] if $s[1] =~ m|/$| and not $part;
>         if ($s[1] =~ m|/boot$|) {
> 
> hackish

Мда... мне кажется, что я даже знаю - зачем это они сделали ... ;-)

Иначе им будет тяжело выводить об ошибке парсинга в какой-то 
определенной строке fstab.

Т.е. - я бы это реализовал например так (C++)

ifstream fd("/etc/fstab");
char line[512];
unsigned int linenumber = 0;

while(fd.getline(line, sizeof(line), '\n'))
{
    ++linenumber;
    if(line[0] == "#")
	continue;
     parse(line,linenumber);
}




  reply	other threads:[~2003-11-26 11:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-25 14:09 [d-kernel] " Alexey Tourbin
2003-11-25 14:16 ` Sergey Vlasov
2003-11-25 14:25   ` [d-kernel] " Alexey Tourbin
2003-11-25 14:36     ` Alexey Tourbin
2003-11-25 14:54       ` Anton Farygin
2003-11-25 18:51         ` Michael Shigorin
2003-11-26 11:44           ` Anton Farygin
2003-11-25 19:19       ` Alexey Tourbin
2003-11-26 11:50         ` Anton Farygin [this message]
2003-11-26 12:12           ` Alexey Tourbin
2003-11-26 12:27             ` Anton Farygin
2003-11-26 12:34               ` [devel] " Sergey Vlasov
2003-11-26 13:03                 ` Anton Farygin

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=3FC4938B.1060609@altlinux.com \
    --to=rider@altlinux.com \
    --cc=devel-kernel@altlinux.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 kernel packages development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/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-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
		devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
	public-inbox-index devel-kernel

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


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