[Blends-commit] [SCM] blends-dev branch, master, updated. 10e78f1a1efddf3347e60f80acfaa210496ba0b4

Mike Gabriel mike.gabriel at das-netzwerkteam.de
Sat Aug 5 02:41:18 UTC 2017


The following commit has been merged in the master branch:
commit 5c82754bedfa48d449315c63a43946fba6cfcb52
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Aug 4 22:32:50 2017 -0400

    load_task: Improve header and package name scanning.
    
      - Additionally support header fields without following package
        name(s), e.g.:
    
          Depends:<LF>
           <pkg-1>,
           <pkg-2>,<pkg-3>,
    
      - Strip off komma after last package (thus, the last package name(s)
        line now can end with trailing komma, which gives nicer diffs in VCS
        when modifying package combinations in task files).
    
      - Drop white-spaces between package names near komma and pipe symbol.

diff --git a/devtools/blend-gen-control b/devtools/blend-gen-control
index c8c0bff..c319f3b 100755
--- a/devtools/blend-gen-control
+++ b/devtools/blend-gen-control
@@ -566,15 +566,35 @@ sub load_task {
         my $header;
         for $header (qw(Depends Recommends Suggests)) {
 	    last if !defined $_;
+
+            my $pkgs = '';
+
+            # first package comes after header ('<header>: <package>')
             if (m/^$header:\s+(.+)$/ && $1 !~ /^\s*$/) {
-		my $pkgs = $1;
-		$pkgs =~ s/\s*\\//;
+                $pkgs .= $1;
+
+                # reliable whitespace and backslash cleanup
+                $pkgs =~ $_ =~ s/^\s+([^\s]+)\s*(|\\\s*)$/$1/;
+            }
+
+            # or no package in the header line ('<header>':<LF>)
+            if (($pkgs) || (m/^$header:\s*$/)) {
 		while (<TASKFILE>) {
 		    last if (m/^\S+/ || m/^\s*$/);
-		    chop $_;
-		    $_ =~ s/\s*\\//;
+
+                    # remove blanks near kommas and pipe symbols
+                    $_ =~ s/\s*,\s*/,/g;
+                    $_ =~ s/\s*\|\s*/|/g;
+
+                    # reliable whitespace and backslash cleanup around
+                    # package name
+                    $_ =~ s/^\s+([^\s]+)\s*(|\\\s*)$/$1/;
 		    $pkgs .= $_;
 		}
+
+                # strip trailing komma after last package
+                $pkgs =~ s/\s*,$//;
+
                 $taskinfo{$curpkg}{$header} = ()
                     if (! exists $taskinfo{$curpkg}{$header});
                 my ($pkglist, $missinglist) = process_pkglist($pkgs);

-- 
Git repository for blends code



More information about the Blends-commit mailing list