Commit 799922c1 authored by Dan Winship's avatar Dan Winship

libnm-util: generate-plugin-docs.pl-related fixes

generate-plugin-docs.pl was assuming that it was being run out of
srcdir, and so failed in srcdir!=builddir builds (such as "make
distcheck"). Fix that.

Also, update .gitignore
parent 968f7958
......@@ -149,8 +149,10 @@ valgrind-*.log
/libnm-glib/tests/test-nm-client
/libnm-glib/tests/test-remote-settings-client
/libnm-util/nm-version.h
/libnm-util/nm-ifcfg-rh-docs.xml
/libnm-util/nm-keyfile-docs.xml
/libnm-util/nm-setting-docs.xml
/libnm-util/nm-version.h
/libnm-util/test-crypto
/libnm-util/tests/test-crypto
/libnm-util/tests/test-settings-defaults
......@@ -200,6 +202,8 @@ valgrind-*.log
/man/*.[185]
/man/nm-settings.xml
/man/nm-settings-ifcfg-rh.xml
/man/nm-settings-keyfile.xml
/po/*.gmo
/po/.intltool-merge-cache
......
......@@ -198,9 +198,9 @@ nm-setting-docs.xml: generate-setting-docs.py NetworkManager-1.0.gir NetworkMana
--output $@
nm-keyfile-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources)
$(srcdir)/generate-plugin-docs.pl keyfile $@
$(srcdir)/generate-plugin-docs.pl keyfile $(srcdir) $@
nm-ifcfg-rh-docs.xml: generate-plugin-docs.pl $(libnm_util_la_csources)
$(srcdir)/generate-plugin-docs.pl ifcfg-rh $@
$(srcdir)/generate-plugin-docs.pl ifcfg-rh $(srcdir) $@
endif
......
......@@ -54,14 +54,14 @@ my @source_files;
my @data;
my $fo;
(scalar @ARGV == 2) or die "Usage: $0 <plugin> <output-xml-file>\n";
(scalar @ARGV == 3) or die "Usage: $0 <plugin> <srcdir> <output-xml-file>\n";
($ARGV[0] eq "keyfile" || $ARGV[0] eq "ifcfg-rh") or die "Allowed <plugin> values: keyfile, ifcfg-rh\n";
my ($plugin, $output) = @ARGV;
my ($plugin, $srcdir, $output) = @ARGV;
my $start_tag = "---$plugin---\\s*\$";
my $end_tag = '---end---';
# get source files to scan for documentation comments (nm-setting-<something>.c)
my $file = 'Makefile.am';
my $file = "$srcdir/Makefile.am";
open my $fh, '<', $file or die "Can't open $file: $!";
while (my $line = <$fh>) {
chomp $line;
......@@ -78,7 +78,7 @@ write_header();
# write generated documenation for each setting
foreach my $c_file (@source_files) {
my $path = "$c_file";
my $path = "$srcdir/$c_file";
my $setting_name = get_setting_name($path);
write_item("<setting name=\"$setting_name\">");
scan_doc_comments($path, $start_tag, $end_tag);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment