summaryrefslogtreecommitdiffstats
path: root/move/collect-directories-to-create.pl
blob: c6e208c57df3ef264463a2874d67551c54343055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

use strict;
use MDK::Common;

#- there are programs/packages which fail when the directory
#- in which they try to write doesn't exist. better collect them
#- at build time so that drakx startup can create them.

my @list = map { if_(m|^\Q$ARGV[0]\E(.*)$|, $1) } `find $ARGV[0]/{etc,var} -type d`;
my @final;
foreach my $e (sort { length($b) <=> length($a) } @list) {
    any { /^\Q$e\E/ } @final and next;
    push @final, $e;
}

print "$_\n" foreach sort @final;