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 661705 - OMF files not installed at the right place: yelp doesn't see them
OMF files not installed at the right place: yelp doesn't see them
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Documentation
2.4.x
Other Linux
: Normal normal
: ---
Assigned To: Yawar Amin
Tom Bullock
Depends on:
Blocks:
 
 
Reported: 2011-10-13 19:27 UTC by Sébastien Villemot
Modified: 2018-06-29 23:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to build system (1.81 KB, patch)
2011-10-13 19:28 UTC, Sébastien Villemot
committed Details | Review

Description Sébastien Villemot 2011-10-13 19:27:43 UTC
This is Debian bug http://bugs.debian.org/464587

The build system of the GnuCash documentation install OMF files under /usr/share/omf/gnucash-docs. As a consequence, the GNOME help browser (yelp version 2.30.1) won't display GnuCash documentation in the Help index.

Yelp expects the OMF files for gnucash-guide to be under /usr/share/omf/gnucash-guide, and OMF files for gnucash-help to be under /usr/share/omf/gnucash-help.

Please find attached a patch to omf.make which fixed the problem.
Comment 1 Sébastien Villemot 2011-10-13 19:28:46 UTC
Created attachment 198965 [details] [review]
Patch to build system
Comment 2 Cristian Marchi 2011-10-19 13:02:10 UTC
I've applied your patch to my local copy of the docs repo. All builds fine (gnucash-guide and gnucash-help installed on /usr/share/omf/ folder) but I'm not able to see the docs listed in yelp. I'm using ubuntu 11.04 and the others omf files of applications listed in /usr/share/omf/ are picked by yelp.

Looking at a omf files and comparing it with others working on the omf folder I didn't notice any difference.

Any idea what's missing?
Comment 3 Cristian Marchi 2011-10-19 19:36:42 UTC
Further investigation on the problem I have reported in the post above, gives me the opportunity to discover that on my system the GnuCash help and guide where not displayed in the yelp list because there is only a gnucash folder in the /usr/share/gnome/help path.
If I copy this folder (containing the two help and guide xml file, and figures) two time and if I rename the two copies as gnucash-guide and gnucash-help, the files gets picked up by yelp.
I don't know how to fix this...have you any idea?
Comment 4 Sébastien Villemot 2011-10-19 20:47:05 UTC
I'm a bit surprised that my patch does not work for you, but basically the patch does what you did manually: it install the OMF files under /usr/share/omf/gnucash-guide and /usr/share/omf/gnucash-help (instead of everything under /usr/share/omf/gnucash-docs as is currently done).

So the way to fix this issue is pretty simple (the install rules in the build system have to be modified), and I let you find the right way to fix it if my patch does not work for some reason (though it works on my system).

Thanks,
Comment 5 Sébastien Villemot 2011-10-19 20:48:49 UTC
Sorry I misunderstood your comment: actually my patch does not put *everything* under /usr/share/omf/gnucash-{guide,help}. It only puts the OMF files there.

I don't know why on your system this is not enough.
Comment 6 Cristian Marchi 2011-10-20 08:46:53 UTC
After correcting a small typo, the patch is on the repo! thanks for providing it!

> I don't know why on your system this is not enough.

I also don't know. It seems that yelp doesn't want two omf files linking the same folder under /usr/share/gnome/help/

I'm facing another error: when running "sudo make uninstall" I get the following message

......
for file in gnucash-help-C.omf; do \
  omfdir="/usr/share/omf/`echo $file | sed 's/-[^-]*\.omf$//'`"; \
	if test "x" == "xtrue"; then \
	scrollkeeper-uninstall -p "/usr/var/scrollkeeper" "$omfdir/$file"; \
	fi; \
	rm -f "$omfdir/$file"; \
  rmdir "$omfdir"; \
  done;
rmdir: failed to remove `/usr/share/omf/gnucash-help': Directory not empty
make[2]: *** [uninstall-local-omf] Error 1
make[2]: Leaving directory `/home/cristian/unstable/GNUCASH/gnucash-docs/help/C'
make[1]: *** [uninstall-recursive] Error 1
make[1]: Leaving directory `/home/cristian/unstable/GNUCASH/gnucash-docs/help'
make: *** [uninstall-recursive] Error 1

It seems that the omf files didn't get removed before removing the folder.
Comment 7 Sébastien Villemot 2011-10-20 08:59:06 UTC
Thanks for your help.

Actually I did not test the "uninstall" part of my patch, since for uninstallation I use the Debian packaging system and not the make rules.

I provided the "uninstall" part in the patch mainly for consistency with the "install" part. I’m sorry if it does not work; hope it helps nevertheless.
Comment 8 Geert Janssens 2011-11-07 15:25:19 UTC
Comment on attachment 198965 [details] [review]
Patch to build system

Committed in r21467 by Cristian.
Comment 9 Geert Janssens 2011-11-07 15:34:47 UTC
(In reply to comment #6)
> I'm facing another error: when running "sudo make uninstall" I get the
> following message
> 
> ......
> for file in gnucash-help-C.omf; do \
>   omfdir="/usr/share/omf/`echo $file | sed 's/-[^-]*\.omf$//'`"; \
>     if test "x" == "xtrue"; then \
>     scrollkeeper-uninstall -p "/usr/var/scrollkeeper" "$omfdir/$file"; \
>     fi; \
>     rm -f "$omfdir/$file"; \
>   rmdir "$omfdir"; \
>   done;
> rmdir: failed to remove `/usr/share/omf/gnucash-help': Directory not empty
> make[2]: *** [uninstall-local-omf] Error 1
> make[2]: Leaving directory
> `/home/cristian/unstable/GNUCASH/gnucash-docs/help/C'
> make[1]: *** [uninstall-recursive] Error 1
> make[1]: Leaving directory `/home/cristian/unstable/GNUCASH/gnucash-docs/help'
> make: *** [uninstall-recursive] Error 1
> 
> It seems that the omf files didn't get removed before removing the folder.

This is because of how make works.

The install and uninstall parts are called for each language we support. Each call only installs/uninstalls the omf file for that language.

So if you have installed for example gnucash-guide for English and German, and then try to uninstall all, the uninstall part will first be run for the gnucash-guide-C.omf file only. It will start by removing the file and then attempt to remove the gnucash-guide directory with rmdir. At this point this directory is not empty (it still contains gnucash-guide-DE.omf). Hence rmdir will fail.

I have slightly altered the uninstall part in r21531 such that rmdir will ignore errors due to the directory not being empty. This should ensure the uninstall part runs for all languages and only remove the directory when the last language file is removed.

Some notes:
- a side-effect of my fix is that the directory doesn't get removed at all if it should contain a file not managed by install/uninstall (for example if someone or some tool manually added a file in there).
- I haven't actually run the make install and uninstall parts on my system, because I don't like to interfere with my package manager managed install. But the principle should work.
Comment 10 Geert Janssens 2011-11-07 15:37:19 UTC
(In reply to comment #3)
> Further investigation on the problem I have reported in the post above, gives
> me the opportunity to discover that on my system the GnuCash help and guide
> where not displayed in the yelp list because there is only a gnucash folder in
> the /usr/share/gnome/help path.
> If I copy this folder (containing the two help and guide xml file, and figures)
> two time and if I rename the two copies as gnucash-guide and gnucash-help, the
> files gets picked up by yelp.
> I don't know how to fix this...have you any idea?

Can you attach the omf files that got installed ?
Comment 11 Sébastien Villemot 2011-11-07 15:51:03 UTC
Complement of information:

The fix that I suggested corrects the problem for Yelp 2.30.

But with a recent upgrade to Yelp 3.2, the problem has reappeared for me (therefore I reopened the Debian bug that I had initially closed). I may be experiencing the same problem than Cristian.
Comment 12 Sébastien Villemot 2012-01-14 21:43:28 UTC
I found a workaround which works for Yelp 3.2:

 cd /usr/share/gnome/help
 ln -s gnucash gnucash-guide
 ln -s gnucash gnucash-help

Looks like the latest Yelp wants that the directory name under /usr/share/gnome/help be the same than the name of the XML file.

I implemented this workaround in the Debian package, until a better solution is found upstream.
Comment 13 Geert Janssens 2012-09-06 09:59:22 UTC
Thanks for reporting this. I have now changed the build scripts so they will install the documentation as <docname>/<lang>/<docname>.xml, for example
gnucash-guide/C/gnucash-guide.xml
gnucash-help/de_DE/gnucash-help.xml
and so on. The fix is in r22374.

I intend to release a new gnucash-docs package soon for distro's to package. If the bug still appears after this fix, feel free to reopen the report.
Comment 14 greg 2014-04-14 16:17:15 UTC
I'm still seeing this bug on Ubuntu 12.4 LTS using GnuCash 2.6.3

gnucash --version
GnuCash 2.6.3
This copy was built from rev 4e4a032+ on 2014-04-08.

sudo su -
cd /usr/share/gnome/help
ln -s gnucash gnucash-help
ln -s gnucash gnucash-guide
exit

yelp ghelp:gnucash-help #OK
yelp ghelp:gnucash-guide #OK
Comment 15 Geert Janssens 2014-04-15 19:01:19 UTC
(In reply to comment #14)
> I'm still seeing this bug on Ubuntu 12.4 LTS using GnuCash 2.6.3
> 
> gnucash --version
> GnuCash 2.6.3
> This copy was built from rev 4e4a032+ on 2014-04-08.
> 
> sudo su -
> cd /usr/share/gnome/help
> ln -s gnucash gnucash-help
> ln -s gnucash gnucash-guide
> exit
> 
> yelp ghelp:gnucash-help #OK
> yelp ghelp:gnucash-guide #OK

What version of the gnucash-docs package do you have installed ?
Comment 16 John Ralls 2017-09-24 22:43:40 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 17 John Ralls 2018-06-29 23:01:57 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=661705. Please update any external references or bookmarks.