#!/usr/bin/perl -T

$ENV{XAUTHORITY} or $ENV{XAUTHORITY} = "$ENV{HOME}/.Xauthority";
$ENV{PATH} = '/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin';
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};

$urpmi = 'urpmi';
if (-f $urpmi && $ENV{DEBUG_URPMI}) { $urpmi = './urpmi' }

@ARGV = map { /(.*)/ ; $1 } @ARGV;

exec $urpmi, "-X", @ARGV
    or die "Can't exec $urpmi: $!\n";