diff --git a/binaries/data/xmbcleanup.bat b/binaries/data/xmbcleanup.bat index 0f4412f1e8..d04476ef2a 100644 --- a/binaries/data/xmbcleanup.bat +++ b/binaries/data/xmbcleanup.bat @@ -1,4 +1,4 @@ @echo off -cd ..\..\build\xmbcleanup -set PATH=..\bin -xmbcleanup.exe \ No newline at end of file +cd ..\system +set PATH=. +xmbcleanup.exe %* \ No newline at end of file diff --git a/build/xmbcleanup/xmbcleanup.exe b/build/xmbcleanup/xmbcleanup.exe deleted file mode 100644 index 3fb5d8b558..0000000000 Binary files a/build/xmbcleanup/xmbcleanup.exe and /dev/null differ diff --git a/build/xmbcleanup/xmbcleanup.pl b/build/xmbcleanup/xmbcleanup.pl index c974b42eca..d58ba00161 100644 --- a/build/xmbcleanup/xmbcleanup.pl +++ b/build/xmbcleanup/xmbcleanup.pl @@ -3,6 +3,8 @@ use warnings; use File::Find; +my $remove_all = (grep /removeall/, @ARGV); + ++$|; # Relative to build/bin or build/xmbcleanup @@ -34,9 +36,16 @@ for (@xmlfiles) { # Find all such files my @xmbfiles = glob $f; + next unless @xmbfiles; + + # Remove them all, if asked to do so + if ($remove_all) { + print "DELETING @xmbfiles\n"; + unlink @xmbfiles; + $count += @xmbfiles; # If there are two or more, delete all but the newest - if (@xmbfiles > 1) { + } elsif (@xmbfiles > 1) { @xmbfiles = sort @xmbfiles; # files are "etc_xmb", with TIMESTAMP # hex-encoded, so sorting will put the oldest files first. # Remove the newest @@ -49,4 +58,4 @@ for (@xmlfiles) { } print "\n\nCompleted - $count ".($count==1?'file':'files')." deleted. Press enter to exit."; -<> \ No newline at end of file +; \ No newline at end of file