]> git.proxmox.com Git - pve-container.git/commitdiff
setup/debian: avoid extra newlines
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 16 Oct 2015 06:31:59 +0000 (08:31 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Oct 2015 07:42:34 +0000 (09:42 +0200)
At the beginning of a file or between sections, if there
have been two newlines already we don't need to add another.

src/PVE/LXC/Setup/Debian.pm
src/test/test-debian-002/etc/network/interfaces.exp

index 752d670613c5a59641429c0b33e1d38e0404d3bf..07dccfcf459e4063c8af417a80dc4ca654e984b9 100644 (file)
@@ -240,7 +240,7 @@ sub setup_network {
        
     }
 
-    my $need_separator = 1;
+    my $need_separator = length($interfaces) && ($interfaces !~ /\n\n$/);
     foreach my $ifname (sort keys %$networks) {
        my $net = $networks->{$ifname};
        
index d8f9f5c879a8e6fbdfb5607b5edf63a84f2107ff..9d9dbcca0848c9c9187816b85583121defefaaf7 100644 (file)
@@ -1,4 +1,3 @@
-
 auto eth0
 iface eth0 inet static
        address 1.2.3.4