Ticket #8926: 0001-Increment-line-number-for-feeds.conf-on-all-lines.patch

File 0001-Increment-line-number-for-feeds.conf-on-all-lines.patch, 1.0 KB (added by kevinoid, 5 years ago)

Patch to increment the line number on all lines

  • scripts/feeds

    From 4ff389232b095f96c9142073286a67b3fd73c235 Mon Sep 17 00:00:00 2001
    From: Kevin Locke <klocke@digitalenginesoftware.com>
    Date: Tue, 8 Feb 2011 12:32:05 -0700
    Subject: [PATCH 1/2] Increment line number for feeds.conf on all lines
    
    To be useful to users, the line number reported during an error should
    match the line number in their editor.  Rather than only incrementing
    the line number on non-blank, non-comment lines, increment it for all
    lines.
    
    Signed-off-by: Kevin Locke <klocke@digitalenginesoftware.com>
    ---
     scripts/feeds |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/scripts/feeds b/scripts/feeds
    index 9f773df..da326a0 100755
    a b sub parse_config() { 
    3939                open FEEDS, "feeds.conf.default" or 
    4040                die "Unable to open feeds configuration"; 
    4141        while (<FEEDS>) { 
     42                $line++; 
    4243                chomp; 
    4344                s/#.+$//; 
    4445                next unless /\S/; 
    4546                my @line = split /\s+/, $_, 3; 
    4647                my @src; 
    47                 $line++; 
    4848 
    4949                my $valid = 1; 
    5050                $line[0] =~ /^src-\w+$/ or $valid = 0;