]> git.proxmox.com Git - pve-zsync.git/commitdiff
fix #1004 adapt regex to new schema
authorWolfgang Link <w.link@proxmox.com>
Thu, 2 Jun 2016 08:28:19 +0000 (10:28 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 2 Jun 2016 08:57:17 +0000 (10:57 +0200)
pve-zsync

index 212ada9e35d7f6e8818343a0e0fdf6159629098e..ff9ee8f3c620936107204c3a810bd5dc2d080ffc 100644 (file)
--- a/pve-zsync
+++ b/pve-zsync
@@ -763,9 +763,17 @@ sub parse_disks {
 
        my $disk = undef;
        my $stor = undef;
-       if($line =~ m/^(?:((?:virtio|ide|scsi|sata|mp)\d+)|rootfs): ([^:]+:)([A-Za-z0-9\-]+),(.*)$/) {
-           $disk = $3;
-           $stor = $2;
+       if($line =~ m/^(?:(?:(?:virtio|ide|scsi|sata|mp)\d+)|rootfs): (.*)$/) {
+           my @parameter = split(/,/,$1);
+
+           foreach my $opt (@parameter) {
+               if ($opt =~ m/^(?:file=|volume=)?([^:]+:)([A-Za-z0-9\-]+)$/){
+                   $disk = $2;
+                   $stor = $1;
+                   last;
+               }
+           }
+
        } else {
            print "Disk: \"$line\" will not include in pve-sync\n" if $get_err || $error;
            next;