mirror of
https://github.com/webmin/webmin.git
synced 2025-07-23 00:30:33 +00:00
Add --exclude flag
This commit is contained in:
@ -5,9 +5,11 @@
|
||||
|
||||
@ARGV >= 2 || die "usage: create-module.pl [--dir name] <file.wbm> <module>[/version] ..";
|
||||
|
||||
my $pwd;
|
||||
chop($pwd = `pwd`);
|
||||
|
||||
# Parse command-line options
|
||||
my @exclude;
|
||||
while(@ARGV) {
|
||||
if ($ARGV[0] eq "--dir") {
|
||||
shift(@ARGV);
|
||||
@ -17,17 +19,21 @@ while(@ARGV) {
|
||||
shift(@ARGV);
|
||||
$createsig = 1;
|
||||
}
|
||||
elsif ($ARGV[0] eq "--exclude") {
|
||||
shift(@ARGV);
|
||||
push(@exclude, shift(@ARGV));
|
||||
}
|
||||
else {
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
$file = shift(@ARGV);
|
||||
my $file = shift(@ARGV);
|
||||
if ($file !~ /^\//) {
|
||||
$file = "$pwd/$file";
|
||||
}
|
||||
unlink($file);
|
||||
foreach $m (@ARGV) {
|
||||
foreach my $m (@ARGV) {
|
||||
# Parse module and forced version
|
||||
$m =~ s/\/$//;
|
||||
if ($m =~ /^(.*)\/(.*)$/) {
|
||||
@ -46,6 +52,9 @@ foreach $m (@ARGV) {
|
||||
$copydir = "/tmp/create-module/$subdir";
|
||||
system("rm -rf $copydir");
|
||||
system("cp -r -L $mod $copydir 2>/dev/null || cp -R -L $mod $copydir");
|
||||
foreach my $e (@exclude) {
|
||||
system("find $copydir -name ".quotemeta($e)." | xargs rm -rf");
|
||||
}
|
||||
|
||||
# Find type from .info file
|
||||
undef(%minfo);
|
||||
|
Reference in New Issue
Block a user