aboutsummaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-01-05 22:38:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-01-05 22:38:55 +0000
commitb2bd459c94eae41860a33f3a69a4f4d50b6fa1c7 (patch)
tree3a74332e4115ae3e190ede7e78d84421ba3951e4 /sbin
parent0f3de907f8726a18c3c2984a2b8b93958958fb03 (diff)
downloadcommon-data-b2bd459c94eae41860a33f3a69a4f4d50b6fa1c7.tar
common-data-b2bd459c94eae41860a33f3a69a4f4d50b6fa1c7.tar.gz
common-data-b2bd459c94eae41860a33f3a69a4f4d50b6fa1c7.tar.bz2
common-data-b2bd459c94eae41860a33f3a69a4f4d50b6fa1c7.tar.xz
common-data-b2bd459c94eae41860a33f3a69a4f4d50b6fa1c7.zip
no_comment
Diffstat (limited to 'sbin')
-rwxr-xr-xsbin/kdeDesktopCleanup12
1 files changed, 11 insertions, 1 deletions
diff --git a/sbin/kdeDesktopCleanup b/sbin/kdeDesktopCleanup
index 866c5ec..f00e44b 100755
--- a/sbin/kdeDesktopCleanup
+++ b/sbin/kdeDesktopCleanup
@@ -5,7 +5,7 @@
@dirs = (qw(/etc/skel /root), glob("/home/*"));
@path = split ":", "/sbin:/usr/sbin:/usr/X11R6/bin:/bin:/usr/bin";
-foreach $f (map { glob("$_/Desktop/*.kdelnk") } @dirs) {
+foreach $f (map { grep { /\.kdelnk$/ } all("$_/Desktop") } @dirs) {
open F, $f or next;
L: foreach (<F>) {
$_ = "Exec=linuxconf" if $f =~ /linuxconf/i; # hack
@@ -17,3 +17,13 @@ foreach $f (map { glob("$_/Desktop/*.kdelnk") } @dirs) {
last;
}
}
+
+sub all {
+ my $d = shift;
+ local *F;
+ opendir F, $d or die "all: can't open dir $d: $!\n";
+ my @l = grep { $_ ne '.' && $_ ne '..' } readdir F;
+ closedir F;
+
+ map { "$d/$_" } @l;
+}