diff --git a/mnemosyne.pl b/mnemosyne.pl index a9db258..f490db8 100644 --- a/mnemosyne.pl +++ b/mnemosyne.pl @@ -379,8 +379,11 @@ sub pkgsel_parse { print "\techo '$address ) { $action; }'\n"; return 1; } + sub render_awkgen { open(my $OUTPUT,'>',$_[0]); + my $root="CFGTEMP_$_[1]"; + select $OUTPUT; # initially change packages $4 and $5 to be able to correctly match repo based. @@ -389,17 +392,28 @@ sub render_awkgen { print "echo '\tpkg=\$5 ;'\n"; print "echo '\t\$5 = \$4 \"/\" \$5 ;'\n"; print "echo '\t\$4 = \"placeholder\" ;'\n"; + print "echo '}'\n"; - # if awkgen is sourced with DISABLE_ALL as argument - # we disable everything before starting - print "if [ \"\$1\" == DISABLE_ALL ]; then\n"; - print "\techo '\t\$1=\"O\" ;'\n"; - print "fi\n"; + render_awkgen_folder($::FOLDER{$root}); + # ... restore $4 and $5, and print the resulting line + print "echo '\n{'\n"; + print "echo '\t\$4=repo ;'\n"; + print "echo '\t\$5=pkg ;'\n"; + print "echo '\tprint ;'\n"; print "echo '}'\n"; - for (values %::MODULE) { - my $module=$_; + select STDOUT; + close($OUTPUT); + } + +sub render_awkgen_folder { + my ($folder) = @_; + for (@{$folder->{children}}) { + if (/^CFGTEMP/) { + render_awkgen_folder($::FOLDER{$_}); + } else { + my $module=$::MODULE{$_}; if ($module->{kind} == CHOICE) { my %options; @@ -451,16 +465,7 @@ sub render_awkgen { print "fi\n"; } } - - # ... restore $4 and $5, and print the resulting line - print "echo '\n{'\n"; - print "echo '\t\$4=repo ;'\n"; - print "echo '\t\$5=pkg ;'\n"; - print "echo '\tprint ;'\n"; - print "echo '}'\n"; - - select STDOUT; - close($OUTPUT); + } } sub render_rules_module { diff --git a/pkgsel.in b/pkgsel.in index efea7ae..148c252 100644 --- a/pkgsel.in +++ b/pkgsel.in @@ -14,7 +14,7 @@ # --- T2-COPYRIGHT-NOTE-END --- if [ -s $cfgtmpdir/mnemosyne.awkgen.in ]; then - . $cfgtmpdir/mnemosyne.awkgen.in DISABLE_ALL \ + . $cfgtmpdir/mnemosyne.awkgen.in \ > $cfgtmpdir/mnemosyne.pkgsel.awk pkgfilter awk -f $cfgtmpdir/mnemosyne.pkgsel.awk fi diff --git a/pkgsel/00-mnemosyne.all b/pkgsel/00-mnemosyne.all new file mode 100644 index 0000000..c2349fa --- /dev/null +++ b/pkgsel/00-mnemosyne.all @@ -0,0 +1 @@ +O *