[pve-devel] [PATCH V2 pve-zsync] fix #1004 adapt regex to new schema

Dietmar Maurer dietmar at proxmox.com
Thu Jun 2 10:57:04 CEST 2016


applied with the following fix:

-               if ($opt =~ m/(?:file=|volume=)?([^:]+:)([A-Za-z0-9\-]+)/){
+               if ($opt =~ m/^(?:file=|volume=)?([^:]+:)([A-Za-z0-9\-]+)$/){


> On June 2, 2016 at 10:28 AM Wolfgang Link <w.link at proxmox.com> wrote:
> 
> 
> ---
>  pve-zsync | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/pve-zsync b/pve-zsync
> index 212ada9..cc566b4 100644
> --- 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;
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 




More information about the pve-devel mailing list