Skip to content

Commit

Permalink
bin/mconfig: pull more changes from rmanfredi/dist#14
Browse files Browse the repository at this point in the history
In particular, this allows the -X option to be named in the .package file
(which would have saved some confusion for Tux).

This also reduces the amount of divergence from upstream dist, which goes
a small way to addressing #43.
  • Loading branch information
arc committed Apr 19, 2018
1 parent 823598b commit 2a192f8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/mconfig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ chop($date = `date`);
&usage unless getopts("dhkmoOstvwGMVL:X:");

my %excluded_symbol;
read_exclusions($opt_X) if defined $opt_X;
read_exclusions($opt_X);
$MC = $opt_L if $opt_L; # May override public library path
$MC = &tilda_expand($MC); # ~name expansion
chop($WD = `pwd`); # Working directory
Expand Down Expand Up @@ -142,7 +142,7 @@ sub init_except {
# Print out metaconfig's usage and exits
sub usage {
print STDERR <<'EOH';
Usage: metaconfig [-dhkmostvwGMV] [-L dir]
Usage: metaconfig [-dhkmostvwGMV] [-L dir] [-X file]
-d : debug mode.
-h : print this help message and exits.
-k : keep temporary directory.
Expand All @@ -156,7 +156,7 @@ Usage: metaconfig [-dhkmostvwGMV] [-L dir]
-L : specify main units repository.
-M : activate production of confmagic.h.
-V : print version number and exits.
-X FILE : read symbol exclusions from FILE
-X : read symbol exclusions from file (overriding .package)
EOH
exit 1;
}
Expand Down Expand Up @@ -815,6 +815,10 @@ sub q {

sub read_exclusions {
my ($filename) = @_;
if (!defined $filename) {
$filename = $exclusions_file; # default to name from .package
return if !defined $filename || $filename eq '';
}
print "Reading exclusions from $filename...\n" unless $opt_s;
open(EXCLUSIONS, "< $filename\0") || die "Can't read $filename: $!\n";
local $_;
Expand Down
15 changes: 15 additions & 0 deletions bin/packinit
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,19 @@ EOM
$shext = &myread('Additional file extensions to identify SH files?', $dflt);
$shext = '' if $shext eq 'none';

$dflt = 'none';
print <<'EOM';

If your package sources contains symbols that metaconfig will mistake for the
names of symbols defined by its units, you can list them in an exclusions file.
(See the documentation of "metaconfig -X".) What file would you like metaconfig
to consult for those symbols? Say "none" if you don't need to exclude any
symbols.

EOM
$exclusions_file = &myread('File to consult for excluded symbols?', $dflt);
$exclusions_file = '' if $exclusions_file eq 'none';

$dflt = $copyright eq ' ' ? 'n' : 'y';
print <<'EOM';

Expand Down Expand Up @@ -406,6 +419,8 @@ changercs=$changercs
: File lookup extensions
cext='$cext'
shext='$shext'
: File to consult for symbol exclusions
exclusions_file='$exclusions_file'
: Mailing list variables
list_users='$list_users'
list_name='$list_name'
Expand Down

0 comments on commit 2a192f8

Please sign in to comment.