After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670985 - [doc-tool] mishandles --output arguments without trailing slashes
[doc-tool] mishandles --output arguments without trailing slashes
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-02-28 16:17 UTC by Will Thompson
Modified: 2015-03-02 19:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
annotationparser: remove duplication of annotation names (4.73 KB, patch)
2012-02-28 16:17 UTC, Will Thompson
committed Details | Review
annotationparser: correct "maximium" in error messages (3.03 KB, patch)
2012-02-28 16:17 UTC, Will Thompson
committed Details | Review
annotationparser: split validate() into sub-methods (7.34 KB, patch)
2012-02-28 16:17 UTC, Will Thompson
committed Details | Review
configure: correct --enable-doctool documentation (1.02 KB, patch)
2012-02-28 16:17 UTC, Will Thompson
none Details | Review
doctool: improve error when --output isn't a directory (874 bytes, patch)
2012-02-28 16:17 UTC, Will Thompson
rejected Details | Review
doctool: handle --output dirs without trailing slashes (1.43 KB, patch)
2012-02-28 16:21 UTC, Will Thompson
rejected Details | Review
configure: correct --enable-doctool documentation (1.27 KB, patch)
2015-03-02 19:34 UTC, Dieter Verfaillie
none Details | Review

Description Will Thompson 2012-02-28 16:17:05 UTC
I found that g-ir-doc-tool treats '--output /foo/bar' differently to '--output /foo/bar/': the former puts the generated files into /foo. Patch fixing this to follow, preceded by a number of miscellaneous clean-up patches.
Comment 1 Will Thompson 2012-02-28 16:17:38 UTC
Created attachment 208602 [details] [review]
annotationparser: remove duplication of annotation names

Previously, the validation code compared each option name to a constant
(such as OPT_ALLOW_NONE) which expands to the string used in a source
file, and if they matched it would typically pass that same string to
_validate_option(). But the annotation name was written out longhand
each time, which seemed strange to me.
Comment 2 Will Thompson 2012-02-28 16:17:40 UTC
Created attachment 208603 [details] [review]
annotationparser: correct "maximium" in error messages

"Maximium" is not an English word. Even if corrected to "maximum" (which
is), "at maximum" is not conventional usage: "at most" is more
idiomatic.
Comment 3 Will Thompson 2012-02-28 16:17:43 UTC
Created attachment 208604 [details] [review]
annotationparser: split validate() into sub-methods

Most cases in validate() were already simply calls to _validate_option()
with particular arguments; this extracts the code from the remaining
options to their own methods, making the dispatch table more legible.
Comment 4 Will Thompson 2012-02-28 16:17:46 UTC
Created attachment 208605 [details] [review]
configure: correct --enable-doctool documentation

The executable is named 'g-ir-doc-tool', not 'g-ir-doctool'.
Comment 5 Will Thompson 2012-02-28 16:17:49 UTC
Created attachment 208606 [details] [review]
doctool: improve error when --output isn't a directory
Comment 6 Will Thompson 2012-02-28 16:21:27 UTC
Created attachment 208608 [details] [review]
doctool: handle --output dirs without trailing slashes

Previously, passing --output /foo/bar/ to g-ir-doc-tool would place the
generated documentation in /foo/bar, as expected, but passing --output
/foo/bar would place the generated documentation in /foo. This is
because os.path.dirname() essentially just splits on the last '/' in the
string and returns everything before it. It does not actually hit the
filesystem.

Meanwhile, os.path.join() correctly deals with trailing slashes:
os.path.join('/foo/', 'bar') and os.path.join('/foo', 'bar') are
equivalent.
Comment 7 Johan (not receiving bugmail) Dahlin 2012-03-31 17:42:16 UTC
Review of attachment 208602 [details] [review]:

Good catch.
Comment 8 Johan (not receiving bugmail) Dahlin 2012-03-31 17:42:19 UTC
Review of attachment 208602 [details] [review]:

Good catch.
Comment 9 Johan (not receiving bugmail) Dahlin 2012-03-31 17:42:20 UTC
Review of attachment 208602 [details] [review]:

Good catch.
Comment 10 Johan (not receiving bugmail) Dahlin 2012-03-31 17:42:20 UTC
Review of attachment 208602 [details] [review]:

Good catch.
Comment 11 Johan (not receiving bugmail) Dahlin 2012-03-31 17:43:08 UTC
Review of attachment 208603 [details] [review]:

Great.
Comment 12 Johan (not receiving bugmail) Dahlin 2012-03-31 17:43:44 UTC
Review of attachment 208604 [details] [review]:

Looks great.
Comment 13 Johan (not receiving bugmail) Dahlin 2012-03-31 17:43:52 UTC
Review of attachment 208605 [details] [review]:

Sure
Comment 14 Johan (not receiving bugmail) Dahlin 2012-03-31 17:44:08 UTC
Review of attachment 208606 [details] [review]:

Yup
Comment 15 Johan (not receiving bugmail) Dahlin 2012-03-31 17:44:25 UTC
Review of attachment 208608 [details] [review]:

Okay.
Comment 16 Johan (not receiving bugmail) Dahlin 2012-04-09 15:06:26 UTC
Attachment 208602 [details] pushed as 5030e41 - annotationparser: remove duplication of annotation names
Attachment 208603 [details] pushed as 4c38ca6 - annotationparser: correct "maximium" in error messages
Attachment 208604 [details] pushed as c8cfa7c - annotationparser: split validate() into sub-methods

The rest needs to be rebased/updated for the latest annotationparser
changes.
Comment 17 André Klapper 2015-02-07 17:18:34 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 18 Dieter Verfaillie 2015-03-02 19:34:28 UTC
Created attachment 298343 [details] [review]
configure: correct --enable-doctool documentation

rebased onto current master...
Comment 19 Dieter Verfaillie 2015-03-02 19:36:24 UTC
Review of attachment 208606 [details] [review]:

Rejected in it's current form as it no longer applies to current code.
These days --output can be either a file or a directory depending on the value of the --write-sections-file parameter.
Comment 20 Dieter Verfaillie 2015-03-02 19:40:11 UTC
Review of attachment 208608 [details] [review]:

Rejected because already fixed in current code as:
        output_file_name = os.path.join(os.path.abspath(output),
                                        page_id + '.page')
Comment 21 Dieter Verfaillie 2015-03-02 19:52:42 UTC
(In reply to Dieter Verfaillie from comment #18)
> Created attachment 298343 [details] [review] [review]
> configure: correct --enable-doctool documentation
> 
> rebased onto current master...

Pushed this as 105852e