Bug 11782 - scrollkeeper-update doesn't check for empty dirs in /usr/share/omf
Summary: scrollkeeper-update doesn't check for empty dirs in /usr/share/omf
Status: NEW
Alias: None
Product: Rarian
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Don Scorgie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 07:22 UTC by Götz Waschk
Modified: 2007-09-24 13:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Götz Waschk 2007-07-31 07:22:19 UTC
If the directory /usr/share/omf contains an empty subdirectory, a file *.omf.document is created:
]$ ls /usr/share/help/
control-center.document        gpl.document
deskbar.document               grecord.document
ekiga.document                 gstreamer-properties.document
epiphany.document              gtk-doc-manual.document
evince.document                lgpl.document
evolution.document             libgnomedb-3.0.document
fdl.document                   mail-notification.document
gcalctool.document             meld.document
gnome-access-guide.document    *.omf.document
gnome-cd.document              rarian.document
gnome-doc-make.document        rhythmbox.document
gnome-doc-xslt.document        streamtuner.document
gnome-pilot.document           system-admin-guide.document
gnome-terminal.document        totem.document
gnome-volume-control.document  user-guide.document
gnucash-guide.document         writing_scrollkeeper_omf_files.document
gnucash-help.document          zenity.document
gok.document
Comment 1 Daniel Macks 2007-09-21 13:10:04 UTC
Looks like a bug in process_dir() (in rarian-sk-update.in). There's a loop over all files in the directory:

	for f in $1/*.omf; do

If there's nothing in the directory, then the glob pattern itself is treated as the loop value list rather than the (empty) list of the glob match. Crazy, no? Not sure the solution...I don't do much bash.
Comment 2 Daniel Macks 2007-09-21 13:25:16 UTC
I guess one could test '-e $f' in the loop to make sure it's a real thing before processing it. Or else check that '$f != "*.omf"'. The bash manpage told me that this behavior is under the control of $nullglob, but I can get that to work (and having something that takes non-standard settings to "work" seems fragile/non-portable anyway).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.