#!/usr/bin/perl # # Copyright 2016 Francois Gouget # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA use strict; use warnings; my $isdrive; for my $i (0..$#ARGV) { $ARGV[$i] =~ s/,format=raw// if ($isdrive and $ARGV[$i] =~ /if=none,/); $isdrive = ($ARGV[$i] eq "-drive"); } print "exec '$0' '", join("' '", @ARGV), "'\n"; exec { "$0.orig" } $0, @ARGV or die "could not exec $ARGV[0]\n";