pax_global_header00006660000000000000000000000064131040602420014502gustar00rootroot0000000000000052 comment=ddafc2fe072149357b467aa5f14497dee3981015 xdg-utils-1.1.2/000077500000000000000000000000001310406024200134235ustar00rootroot00000000000000xdg-utils-1.1.2/.dir-locals.el000066400000000000000000000000631310406024200160530ustar00rootroot00000000000000(("ChangeLog" . ((nil . ((mode . fundamental)))))) xdg-utils-1.1.2/.gitignore000066400000000000000000000000611310406024200154100ustar00rootroot00000000000000Makefile autom4te.cache config.log config.status xdg-utils-1.1.2/ChangeLog000066400000000000000000000612501310406024200152010ustar00rootroot00000000000000=== xdg-utils 1.1.2 (unreleased) === 2017-02-28 Rex Dieter * xdg-open: Add "chromium" to fallback browsers (BR99366) * xdg-mime: fails on encountering a list for x-scheme-handler (BR44163) * xdg-screensaver: Restore previous X11 screensaver timeout (BR#98509) 2016-12-12 Rex Dieter * Add gio tool support (BR99063) 2016-11-23 Rex Dieter * xdg-open/xdg-email: add flatpack support (BR98824) 2016-08-25 Simon Lees * Add support for LXQt * Add enlightenment to xdg-email, xdg-settings 2016-06-10 Rex Dieter * xdg-open: prefer open_generic_xdg_x_scheme_handler over open_envvar (BR96472) 2016-05-20 Rex Dieter * xdg-mime: ensure check_mimeapps_list returns only primary item (BR44163) 2016-05-05 Rex Dieter * xdg-mime: xdg-mime does not write the file it reads in a query (BR95051) 2016-04-15 Rex Dieter * xdg-mime: properly handle varied ktraderclient5 output (BR94946) 2016-02-16 Rex Dieter * xdg-screensaver: support cinnamon-screensaver (BR92966) 2015-12-19 Rex Dieter * xdg-open: improve fallbacks, add open_generic (almost) everywhere (BR93442) 2015-11-03 Per Olofsson * Check for $WAYLAND_DISPLAY as well as $DISPLAY. Move display checking to a common has_display() function. Thanks to Pasi Sjöholm for reporting. === xdg-utils 1.1.1 === 2015-10-05 Per Olofsson * xdg-screensaver: Run 'xset -dpms' and then 'xset +dpms' to reset the DPMS timer. Thanks to Stephen Thomas for the idea. (Debian bug #745340) * xdg-open: Fix regression in generic mode (wrong variable name) which prevented files from being opened using the desktop file/mimeapps.list mechanism. * xdg-open: Add proper quoting so that files with spaces in their names can be opened in generic mode and LXDE. (Debian bug #801048) === xdg-utils 1.1.0 === 2015-10-04 Per Olofsson * Add references to specifications to the manuals. (Debian bug #800826) * xdg-email: Remove obsolete references to http://portland.freedesktop.org/wiki/EmailConfig from the manual. 2015-10-03 Per Olofsson * xdg-email: Rewrite open_kde() * xdg-open: Only strip queries (?) and fragments (#) from file URLs before decoding them, not from (decoded) paths. Otherwise we can't open files with hash or question marks in their names. (Debian bug #800355) 2015-09-27 Per Olofsson * xdg-settings: Detect generic DE instead of failing. (Debian bug #787791) * xdg-settings: Add a proper generic mode. 2015-09-26 Per Olofsson * xdg-mime: Check ~/.config/mimeapps.list instead of ~/.config/applications/mimeapps.list when looking for default application. * xdg-open: Fall back to generic mode if gvfs-open and gnome-open are missing. Don't try to use gnome-open if running under GNOME 3 or Cinnamon. (Debian bug #685304) * xdg-open, xdg-email: Add iceweasel to the list of fallback browsers. (Debian bug #788047) 2015-09-25 Per Olofsson * xdg-utils-common: Add support for $XDG_CURRENT_DESKTOP value X-Generic. When set, xdg-utils will pretend that it is running under a generic DE which can be useful for debugging purposes. 2015-09-23 Per Olofsson * xdg-open: Percent-decode file:// URLs in open_lxde and add testcase. (BR89654) 2015-09-22 Per Olofsson * Add a fully automated (non-interactive) test suite (under development). Run it using "make autotest". * xdg-screensaver: Use the DBus API from a Perl script to inhibit gnome-screensaver. This is necessary since the SimulateUserActivity call is not implemented. Calling Inhibit using dbus-send does not work either since gnome-screensaver watches the pid of the calling process and dbus-send exits immediately. Distributions are advised to make xdg-utils depend on the Perl modules Net::DBus and X11::Protocol. Thanks to Ben Hutchings for writing the Perl script. * xdg-email: Add support for the $MAILER environment variable. * xdg-open: Add support for running without X. * xdg-open: Try www-browser first of the non-X browsers. (www-browser is a symlink to the preferred non-X browser in Debian.) * xdg-icon-resource: Don't try to install anything into empty $icon_dir's. 2015-09-20 Per Olofsson * xdg-open: Try $BROWSER first in generic mode if it is set by the user. 2015-09-18 Rex Dieter * xdg-email: Recipients passed to Thunderbird are incorrectly quoted (BR91996) 2015-09-16 Rex Dieter * xdg-screensaver support for xautolock (BR89655) * xdg-icon-resource: does not support filenames with spaces (BR91758) * xdg-open: Add support for multi-word $BROWSER commands (BR91989) * xdg-open shell script contains bash code (BR86028) * xdg-email: bashism: relies on bash's echo in run_thunderbird() (BR91990) * xdg-email: Icedove support (BR91997) * xdg-email: generic mode does nothing (BR92008) 2015-07-15 Rex Dieter * better for other (non-gnome) GVfs-based desktops, from Yaakov Selkowitz 2015-07-01 Rex Dieter * xdg-email: generic check for assigned mailto (BR79929) 2015-04-13 Rex Dieter * xdg-mime: search mimeinfo.cache in $xdg_user_dir too (BR31629) 2015-04-06 Rex Dieter * xdg-open: does not exit if it does not recognize the mimetype (BR89902) 2015-04-04 Rex Dieter * xdg-desktop-menu: does not support filenames with spaces (BR66605) 2015-03-23 Rex Dieter * xdg-open: fix regression where & gets replaced with \\& in URLs 2015-03-02 Rex Dieter * xdg-email: thunderbird launch in xdg-email in gnome3 fails (BR61475) 2015-02-24 Lionel Orry * xdg-mime: do not report multiple desktop files (BR60329) 2015-02-20 Rex Dieter * xdg-open: safer xdg-open (BR89130), inspired by patch from Vincent Bernat 2015-01-19 Rex Dieter * xdg-open: better fix for command injection vulnerability (BR66670) * xdg-open is extremely slow because get_key executes grep unnecessarily (BR88524) 2015-01-15 Reuben Thomas * xdg-mime: dereference symlinks when using mimetype or file (BR39923) * xdg-screensaver: Change screensaver_freedesktop's interpretation of GetActive (BR29859) 2015-01-05 Rex Dieter * xdg-open: command injection vulnerability (BR66670) 2015-01-04 Rex Dieter * xdg-screensaver should control X11's screensaver in xfce as fallback (BR80089) 2014-10-09 Rex Dieter * xdg-screensaver plasma5 support 2014-09-22 Rex Dieter * Initial support for Plasma5 (largely thanks to Karol Herbst) 2014-09-19 Rex Dieter * XFCE .desktop file created for browser selection is broken (BR56092) * Unnecessary filtering file:// for pcmanfm (BR63153) * fails if user sets a custom IFS environment variable (BR81386) 2014-09-17 Rex Dieter * xdg-utils-common is broken, xdg-open uses bashism (BR83979) 2014-08-25 Rex Dieter * xdg-email: do not encode - character 2014-04-26 Rex Dieter * xdg-open fails to open web browser urls with a query string (BR45857) 2014-02-07 Rex Dieter * Improvement of detecting KDE session (BR63157) 2013-10-24 Rex Dieter * xdg-desktop-menu: improperly check for vendor prefix on Estonian locale (BR70742) 2013-09-16 Rex Dieter * xdg-desktop-menu: Unquoted file name (BR69399) 2013-07-13 Igor Murzov * xdg-open: detect Enlightenment and make use of it (BR66944) 2012-10-08 Rex Dieter * xdg-mime does not search mimeinfo.cache (BR31629) 2012-09-16 Rex Dieter * recognize XDG_CURRENT_DESKTOP/DESKTOP_SESSION=MATE (BR54941) * xdg-su: use gnomesu for mate (BR54941) 2012-08-20 Rex Dieter * xdg-su: stop checking xsu (thanks to Jiri Slaby) * xdg-su: use gnomesu for xfce if available (thanks to Jiri Slaby) 2012-08-09 Rex Dieter * xdg-open fails to open a url in a "generic" environment (BR45859) * xdg-screensaver syntax error if DISPLAY isn't set (BR41144) * do not check for /etc/debian_version before using xdg-open (BR46814) * Setting $BROWSER=xdg-open can cause infinite loop (BR44047) 2012-03-10 Rex Dieter * allow DESKTOP_SESSION='Xfce Session' to match xfce 2012-03-02 Rex Dieter * "unknown DE" improvements (BR45295) * xdg-terminal incompatible with TERM=screen and TERM=rxvt-unicode (BR44357) * xdg-terminal doesn't handle TERM values like TERM=linux (BR44358) * add lubuntu support (BR44775) * xdg-open replaces "&" with "%U" in URLs (BR46002) 2011-12-09 Rex Dieter * initial DE=mate support (mostly just xdg-open so far) 2011-12-07 Rex Dieter * xdg-screensaver: gnome-screensaver detection broken (BR43575) * xdg-open: fix spurious 'x-www-browser: command not found' (RH755553) 2011-09-30 Rex Dieter * xdg-open: use x-scheme-handler/ instead of uri/ (BR35700) 2011-09-28 Rex Dieter * Documentation spelling fixes (BR41193). Thanks to Ville Skyttä * Fix external links in docs, use for them (BR41194). Thanks to Ville Skyttä * Avoid some unnecessary stat calls (BR41195). Thanks to Ville Skyttä * xdg-open: improve debugging output (BR40959) * xdg-open: look up default applications by URI scheme (BR35700) * xdg-settings: support registering default scheme handler (merge from chromium folks) 2011-08-29 Rex Dieter * xdg-open cant open some valid urls if URL doesnt match existing filename (BR34915). Thanks to Leho Kraav. 2011-08-27 Rex Dieter * xdg-terminal fails to open terminal on generic desktop (BR40418) 2011-08-12 Rex Dieter * xdg-email fails with unicode strings if using gawk (BR13139) * xdg-email: Thunderbird 5 needs unescaped addresses (BR40041) 2011-08-11 Rex Dieter * xdg-terminal : remove remaining '==' bash'isms (BR38959) 2011-07-19 Rex Dieter * xdg-utils-common.in: support $XDG_CURRENT_DESKTOP 2011-07-13 Rex Dieter * xdg-mime : use 'file --mime-type' instead of 'file -i' (BR39166) 2011-05-10 Rex Dieter * xdg-mime : handle home dirs with spaces, mimeapps.list not existing. Thanks to Mike Mammarella. 2011-05-05 Rex Dieter * xdg-utils-common.in : add missing ;; 2011-05-04 Rex Dieter * xdg-utils-common.in : move a couple of utility functions here (from xdg-settings), needed for xdg-email * xdg-utils-common.in : binary_to_desktop_file, handle vendor dirs 2011-04-20 Rex Dieter * xdg-desktop-icon does not work when user desktop dir has spaces (BR36417) 2011-04-14 Rex Dieter * xdg-open does not detect xfce (BR25941) * xdg-open's list of fallback browsers excludes seamonkey (BR33699) * text BROWSER=+elinks * xdg-open is sensitive to default grep options (BR34164) * xdg-{open,email} should try x-www-browser (BR33095) * xdg-email outputs errors with localized KDE4 (BR32924) * xdg-email runs kmailservice with incorrect locale (BR33106) * spurious capture of which in KMIMETYPEFINDER (BR31444) 2011-04-12 Rex Dieter * suppress 'which gnome-default-applications-properties' output. Thanks to Mike Mammarella. 2011-04-08 Rex Dieter * xdg-mime: add mimeapps.list support. Thanks to Chris Coulson. 2011-03-31 Rex Dieter * Don't overwrite a /usr/share/applications/defaults.list symlink (BR35794) * Use D-Bus API for GNOME screensaver (BR29860) * Initial support for DE=Darwin, Default for $BROWSER under Mac OS (BR35500) 2011-03-28 Rex Dieter * xdg-open cannot detect xfce 4.8 correctly (BR33321) * xdg-mime's info_generic doesn't normalize symlinks (BR33097) * mimetype support for xdg-mime (generic) (BR33094) * open_generic_xdg_mime is broken when a .desktop file Exec has arguments (BR30453) 2011-02-01 Rex Dieter * add support for GNOME 3.x 2011-01-09 Fathi Boudra * xdg-email: call kfmclient_fix_exit_code() under KDE 3 only. Thanks to Luc Menut. (BR32924) * xdg-utils-common: set C.UTF-8 locale to make sure the version parsing is done as expected. Under some locales the KDE version string doesn't start with "KDE". * xdg-terminal: Fix failure because the which std output is wrongly redirected to /dev/null in terminal_kde(). Thanks to Luc Menut. (BR32927) === xdg-utils 1.1.0-rc1 === 2010-12-31 Fathi Boudra * xdg-mime: correct install text to use type/subtype. Thanks to Christopher Yeleighton. (BR31441) * xdg-open: declare file variable as local. (BR32487) * xdg-open: decode file:// urls. Thanks to Henning Garus. * xdg-screensaver: support X server blanking. Thanks to Ben Hutchings. 2010-11-18 Rex Dieter * xdg-utils-common: fixup kfmclient_fix_exit_code() for newer kde-config output * xdg-mime: fix typo in manpage * xdg-email: Thunderbird is not detected with localized (BR31740) 2010-10-28 Rex Dieter * add lxde support (BR26058) 2010-09-25 Fathi Boudra * xdg-settings: Only run KDE browser fallback when necessary. Otherwise, in some circumstances, read_kde_browser incorrectly prints the result twice. Thanks to David Benjamin. 2010-09-24 Fathi Boudra * xdg-email: Fix e-mail attachements support with Thunderbird3 (BR13435) 2010-09-24 Fathi Boudra * xdg-mime: update the required section "[Added Associations]" Thanks to Mike Mammarella: 2010-09-24 Fathi Boudra * xdg-email: Fix missing backslash in awk script so that it works with mawk. 2010-09-24 Fathi Boudra * xdg-desktop-icon: set the execute bit to desktop file. Thanks to Damjan Jovanovic. (BR28394) 2010-07-09 Rex Dieter * xdg-screensaver: consider gnome-screensaver a separate DE (BR20027) 2010-07-09 Rex Dieter * xdg-mime : use 'gnomevfs-info --slow-mime' (BR 13939) 2010-07-09 Rex Dieter * xdg-desktop-icon : use localized desktop folder name (BR19011) 2010-07-09 Rex Dieter * xdg-open : use mimeopen -L (follow symlinks) 2010-07-09 Rex Dieter * xdg-open.1 : add FILES, SEE ALSO sections 2010-05-16 Rex Dieter * xdg-open: Spaces in filename (BR27959) 2010-04-22 Fathi Boudra * xdg-email and xdg-open: perform BROWSER check in any case. Thanks to Andrea Florio. (BR27551) 2010-04-22 Fathi Boudra * xdg-email: try console mode browsers and update the browser list. 2010-02-28 Fathi Boudra * xdg-utils-common: fix the comment of exit_failure_file_permission_write function. (BR12821) 2010-02-28 Fathi Boudra * xdg-open: fix regression in open_generic as xdg-mime doesn't handle URLs (mimeopen and run-mailcap as well). Move xdg-mime call into a new function (open_generic_xdg_mime). Check input file before trying to open them with non-browsers. 2010-02-28 Fathi Boudra * xdg-open: fix failure if $BROWSER has arguments. (BR14374) Thanks to Johannes Wegener. 2010-02-28 Fathi Boudra * xdg-open: try console mode browsers and update the browser list. Thanks to Ville Skyttä and Pablo Castellano. (BR14361) 2010-02-24 Fathi Boudra * xdg-screensaver: use dbus-send instead of qdbus for freedesktop screensaver. 2010-02-23 Fathi Boudra * xdg-mime: improve MIME string check when using gnomevfs-info. (BR12818) 2010-02-23 Fathi Boudra * xdg-mime: report error on failure. 2010-02-21 Fathi Boudra * xdg-open: in open_generic, use xdg-mime to lookup mime type and association before the alternatives methods (mimeopen and run-mailcap). (BR23280) 2010-02-20 Fathi Boudra * Add gvfs-copy and gvfs-info support. (BR15828) 2010-01-27 Rex Dieter * xdg-settings: Add %s to the command in the Gnome url handlers (BR26284) 2010-01-18 Rex Dieter * xdg-screensaver resume activates the screensaver on KDE4 (BR26085) 2009-10-16 Rex Dieter * prefer gvfs-open over gnome-open * DE=gnome, if org.gnome.SessionManager exists on dbus 2009-10-12 Fathi Boudra * Fix xdg-email --attach failure with Evolution. (BR23007) Thanks to Dwayne Bailey 2009-10-12 Fathi Boudra * Add an extra check in xdg-open and call kfmclient openURL as a fallback on KDE 4. Thanks to Nicolas Lécureil 2009-10-12 Fathi Boudra * Add email attachments support to Thunderbird from xdg-email. (BR13435) Thanks to Lei Zhang 2009-10-12 Fathi Boudra * Fix xdg-open to handle URL with '#' symbol. (BR23319, BR24375) 2009-10-12 Fathi Boudra * Remove bash requirement to xdg-open and xdg-email. (BR20015) 2009-10-12 Fathi Boudra * Update xdg-settings - Thanks to Mike Mammarella: This fixes some issues where user-generated icons would be detected as the official .desktop file for a binary, rather than the actual version. (It resolves forward and compares binaries rather than resolving backward to a .desktop file from a binary) 2009-09-28 Rex Dieter * Use kde-open, if available (ie, KDE 4) 2009-09-13 Rex Dieter * detect_de: suppress xprop stderr. 2009-08-25 Rex Dieter * fix build for missing manpages (eg. xdg-settings) 2009-08-25 Fathi Boudra * Fix hardcoded KDE home directory. Use kde(4)-config to get path. 2009-08-25 Fathi Boudra * Apply patch from Mike Mammarella to fix 2 issues: - skip invisible desktop files when looking up the default web browser in GNOME. (http://codereview.chromium.org/159738) - check for localized settings by hand in xdg-settings if kreadconfig fails. (http://codereview.chromium.org/160376) 2009-08-10 Fathi Boudra * Replace kfmclient by kioclient usage under KDE 4. Thanks to Nicolas Lécureil 2009-08-03 Fathi Boudra * Remove fixup_mandriva_categories() function. It is not needed anymore since a year. Thanks to Nicolas Lécureil 2009-07-29 Fathi Boudra * Merge xdg-settings utility: a script to get various settings from the desktop environment. Thanks to Dan Kegel and Google Inc. 2009-07-29 Fathi Boudra * Fix hardcoded path in make_default_kde() in xdg-mime unde KDE 3. Add initial KDE 4 support to the function. 2009-07-28 Fathi Boudra * Use kbuildsycoca4 under KDE 4 and kbuildsycoca under KDE 3. 2009-07-28 Fathi Boudra * Use kmimetypefinder under KDE 4 and kfile under KDE 3. 2009-07-28 Fathi Boudra * Add KDE 4 support to xdg-mime. kdetradertest was replaced by ktraderclient under KDE 4. (BR22975) 2009-07-27 Fathi Boudra * Remove -u option from su. It doesn't have it. 2009-07-27 Fathi Boudra * Add KDE 4 support to xdg-email (BR17268) 2009-07-26 Fathi Boudra * Sleep for 50s instead of 59s to avoid to froze the seesion (BR19414) 2009-07-26 Fathi Boudra * Fix a race condition in xdg-screensaver (BR19382) 2009-07-26 Fathi Boudra * Fix basename usage when filename contains spaces (BR18567) 2009-07-26 Fathi Boudra * Fix bashisms used in xdg-mime and xdg-screensaver (BR15827) 2008-08-11 Rex Dieter * initial support for KDE 4 * Add dbus commands to xdg-screensaver for KDE 4 (BR17537) 2008-01-24 Kevin Krammer * Fixing security issue in xdg-email and xdg-open at replacing parameter in $BROWSER 2007-06-27 Waldo Bastian * Fix xdg-mime query filetype on XFCE (BR11383) === xdg-utils 1.0.2 ==== === xdg-utils 1.0.1 ==== 2006-11-03 Waldo Bastian * Fixed spurious output on stdout by xdg-desktop-menu * Cleaned up shell syntax for xdg-screensaver and xdg-icon-resource (fixes Ubuntu 6.10) 2006-10-29 Kevin Krammer * Fixed non-ascii mailto URI handling of xdg-emial on non-UTF8 locales under KDE === xdg-utils 1.0 ==== 2006-05-10 Bryce Harrington * Created xdg-screensaver 2006-04-24 Kevin Krammer * Applied patch provided by Benedikt Meurer to improve the compatability of the Makefile * Added --title option to xdg-file-dialog * Applied another path by Benedikt to let xdg-file-dialog use zenity on GNOME and XFCE * Added a documentation extraction AWK script created by Benedikt which replaces the sed code and adds extraction of examples additionally to the usage info. * Added printing of examples to the --help command. 2006-04-14 Kevin Krammer * Added documentation for --version to all xml files * Added script for file selection task, e.g. using the native file dialog to get a file or directory name 2006-04-11 Kevin Krammer * Applied exit functions to the other scripts * Added a function to check for common commands like --help or --version and always perform the same reaction 2006-04-10 Kevin Krammer * Added common exit functions to improve return value consistency. Currently only used in xdg-mime to gather feedback 2006-04-08 Kevin Krammer * In case of $BROWSER being not avialable or empty, try a fixed list of well known browsers instead 2006-04-06 Kevin Krammer * Fixed "detection" of generic case in xdg-mime, xdg-open and xdg-su as discovered by Hagai Kariti * Fixed tailoring of file and gnomevf-info output by using "sed" to remove a leading whitespace instead of "cut" 2006-04-05 Kevin Krammer * Applied patch by Benedikt Meurer which adds detection for XFCE, XFCE paths for xdg-open and xdg-email and which fixes the script for non-bash shells. 2006-03-31 Waldo Bastian * Generate usage instructions from the same XML that is used for manpages * Included licence text in scripts * Added xdg-desktop script * Added documentation (DocBook, HTML, manpages) * Have Makefile generate manpages * Included fix for xdg-su provided by Jeremy White * Added "release" target to Makefile for generating releases * Added support for .directory and .menu files to xdg-menu 2006-03-21 Kevin Krammer * Imported the current state into freedesktop.org CVS for easier shared development xdg-utils-1.1.2/LICENSE000066400000000000000000000020771310406024200144360ustar00rootroot00000000000000# # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. xdg-utils-1.1.2/Makefile.in000066400000000000000000000016111310406024200154670ustar00rootroot00000000000000SUBDIRS = scripts tests autotests all: $(SUBDIRS) install: $(SUBDIRS:%=%/__install__) uninstall: $(SUBDIRS:%=%/__uninstall__) test: dummy cd tests && $(MAKE) test autotest: cd autotests && $(MAKE) test clean: $(SUBDIRS:%=%/__clean__) distclean: clean $(SUBDIRS:%=%/__distclean__) rm -f config.* Makefile rm -rf autom4te.cache release: $(SUBDIRS:%=%/__release__) rm -f *~ help: @echo "Usage: make [install|uninstall|release]" .PHONY: all install uninstall clean distclean dummy autotest dummy: $(SUBDIRS): dummy @cd $@ && $(MAKE) $(SUBDIRS:%=%/__uninstall__): dummy cd `dirname $@` && $(MAKE) uninstall $(SUBDIRS:%=%/__install__): dummy cd `dirname $@` && $(MAKE) install $(SUBDIRS:%=%/__clean__): dummy cd `dirname $@` && $(MAKE) clean $(SUBDIRS:%=%/__release__): dummy cd `dirname $@` && $(MAKE) release $(SUBDIRS:%=%/__distclean__): dummy cd `dirname $@` && $(MAKE) distclean xdg-utils-1.1.2/README000066400000000000000000000074301310406024200143070ustar00rootroot00000000000000xdg-utils --------- The xdg-utils package is a set of simple scripts that provide basic desktop integration functions for any Free Desktop, such as Linux. They are intended to provide a set of defacto standards. This means that: * Third party software developers can rely on these xdg-utils for all of their simple integration needs. * Developers of desktop environments can make sure that their environments are well supported If a desktop developer wants to be certain that their environment functions with all third party software, then can simply make sure that these utilities work properly in their environment. This will hopefully mean that 'third tier' window managers such as XFCE and Blackbox can reach full parity with Gnome and KDE in terms of third party ISV support. * Distribution vendors can provide custom versions of these utilities If a distribution vendor wishes to have unusual systems, they can provide custom scripts, and the third party software should still continue to work. OVERVIEW: --------- The following tools are included in xdg-utils 1.0: xdg-desktop-menu Install desktop menu items xdg-desktop-icon Install icons to the desktop xdg-icon-resource Install icon resources xdg-mime Query information about file type handling and install descriptions for new file types xdg-open Open a file or URL in the user's preferred application xdg-email Send mail using the user's preferred e-mail composer xdg-screensaver Control the screensaver BUILD: ------ Building is not required, all tools are located in the scripts/ subdirectory and are ready to be used. You can optionally choose to install the scripts to a target directory. To do this, you could issue the following commands: ./configure [--prefix=] make install that would cause the scripts to be installed to /bin USE: ---- Although we expect that these scripts will generally come as part of the operating system, we recommend that you package the scripts that your application needs along with your product as a fallback. For this purpose please obtain the original version of the xdg-utils from http://portland.freedesktop.org. The xdg-utils scripts that are distributed by operating systems vendors may have been tuned for their particular operating system and may not work on the same broad variety of operating systems as the original version. We recommend that you place these scripts in a directory, and then add that directory to the end of the PATH. So, let's say that you're writing your post installation script, and you want to create a menu on any xdg-util compliant environment. Let's further assume that you've just installed to $INSTALL_DIR, and that your menu desktop file is in $INSTALL_DIR/desktop/icon.desktop. Finally, let's say that you've included the xdg-utils package in your installation in $INSTALL_DIR/xdg-utils. Then a simple post install script could look like this: export PATH=$PATH:$INSTALL_DIR/xdg-utils xdg-desktop-menu install $INSTALL_DIR/mycompany-myapp.desktop And now your product has a menu on any XDG compliant desktop! Note that we strongly recommend using this method - that is, putting your copy of the xdg-utils at the end of the path, and then invoking them without a specific path name. That will allow your users and their system providers to use custom versions of the xdg-utils to adjust for system specific differences. If you wish to absolutely force the issue and only use the versions you shipped, you could instead hard code the path to the version you bundle with your application. We strongly recommend against this, as it will make your product obsolete more quickly than is necessary. xdg-utils-1.1.2/RELEASE_NOTES000066400000000000000000000061011310406024200153740ustar00rootroot00000000000000Release notes for xdg-utils 1.1.0 ================================= This release includes: * better support for GNOME3, KDE4, Plasma5, LXDE, MATE, XFCE * initial support for generic methods (non toolkit-specific, experimental) * xdg-settings utility, a script to get various settings from the desktop environment Release notes for xdg-utils 1.0.2 ================================= This release fixes: * SVG icons are not supported but documentation still mentioned SVG * xdg-email can now be used without any e-mail address * Don't use mktemp without arguments, it breaks on systems with certain older versions of mktemp (xdg-desktop-menu, xdg-screensaver) Release notes for xdg-utils 1.0.1 ================================= This release fixes: * Several shell syntax issues causing failures on Ubuntu 6.10 * Spurious output on stdout when running xdg-desktop-menu * Non-ascii mailto URI handling of xdg-emial on non-UTF8 locales under KDE Release notes for xdg-utils 1.0 =============================== xdg-utils 1.0 has been tested under the Gnome and KDE desktop environments on Debian, Fedora, Kubuntu, Mandriva, Redhat RHEL4, SUSE, Ubuntu and Xandros based Linux systems. These release notes reflect test findings. Despite extensive testing it should be pointed out that xdg-utils is provided AS IS without warranty of any kind. See the LICENSE file for details. * general: - When installing applications or file types for the current user only (user mode) it may be necessary to restart the session in order for the panel and filemanager to show the correct icons. This problem typically occurs when the installation process required new (hidden) directories to be created under the user's home directory. * xdg-mime: - xdg-mime query filetype may fail under Gnome on certain Debian systems that do not have gnomevfs-info installed by default. * xdg-desktop-menu: - On Redhat RHEL 4 systems running Gnome, new submenus will not appear until the session is restarted. For testing purposes the command "killall gnome-panel" can be used instead of restarting the session. It is not recommended to use this as part of installation scripts though. - KDE based desktops may require several seconds to update the application menu after installing new items. The user may need to close the applications menu first before new items will show up. - On SUSE systems, desktop entries that list any of the standard menu Categories are often being placed in a "More Programs" submenu which makes them somewhat hard to find. * xdg-screensaver: - Screensaver locking does not work on KDE under SUSE 10.0 * xdg-email: - Please refer to http://portland.freedesktop.org/wiki/EmailConfig for additional information on setting up the default E-mail client. - With current versions of Mozilla Thunderbird it is not possible to specify attachments. In order to send an attachment, the user will need to attach the file manually. - Older versions of KMail do not support multiple To or CC recipients. xdg-utils-1.1.2/TODO000066400000000000000000000013331310406024200141130ustar00rootroot00000000000000xdg-icon-resource * Add pre-XDG Base Dir gnome-support * Add "query theme" * Add "query lookup" xdg-email * revisit decision to disable &attach= in mailto URLs xdg-screensaver * Return error when WindowID doesn't exist General * Support XDG_DATA_INSTALL * Support XDG_INSTALL_HOOK * Use "FILE" as argument everywhere instead of "file" * Add xdg-autostart xdg-su: * The summary is incorrect, it suggests that it can only run things as root which is incorrect according to the main body of the document. * The -c option is listed in the synopsis, but not in options. * It would be useful if it was possible to distinguish between a failure because of a bad password or some other failure. * use sudo style syntax, drop -c option xdg-utils-1.1.2/autotests/000077500000000000000000000000001310406024200154565ustar00rootroot00000000000000xdg-utils-1.1.2/autotests/.gitignore000066400000000000000000000000231310406024200174410ustar00rootroot00000000000000/lab /failed-tests xdg-utils-1.1.2/autotests/Makefile.in000066400000000000000000000007201310406024200175220ustar00rootroot00000000000000T := $(sort $(wildcard t-*.sh)) all: test: $(T) @if [ -e failed-tests ]; then \ echo; \ echo TEST FAILURES:; \ echo; \ cat failed-tests; \ echo; \ exit 1; \ fi autotest: test remove-failed-tests: rm -f failed-tests $(T): remove-failed-tests @sh $@ clean: remove-failed-tests rm -fr lab distclean: clean rm -f Makefile install: uninstall: release: .PHONY: test autotest remove-failed-tests all install uninstall release \ distclean $(T) xdg-utils-1.1.2/autotests/mock-kreadconfig5000077500000000000000000000012711310406024200206750ustar00rootroot00000000000000#!/bin/sh set -e abort() { echo "mock-kreadconfig5: $*" >&2 exit 1 } group= key= while [ -n "$1" ]; do case "$1" in --file) [ "$2" = emaildefaults ] || abort "expected: --file emaildefaults, got: --file $2" ;; --group) group="$2" ;; --key) key="$2" ;; *) abort "unknown argument: $1" ;; esac shift 2 done if [ "$group" = Defaults ] && [ "$key" = Profile ]; then echo DefProf elif [ "$group" = PROFILE_DefProf ] && [ "$key" = EmailClient ]; then echo "thunderbird %u" else abort "unknown group $group with key $key" fi xdg-utils-1.1.2/autotests/t-xdg-email.sh000077500000000000000000000017421310406024200201310ustar00rootroot00000000000000#!/bin/sh COMMAND_TESTED=xdg-email . ./test-lib.sh test_that_it uses kmailservice to launch the default e-mail client in KDE3 mock kreadconfig mock kmailservice run kde3 xdg-email test@example.org assert_run kmailservice mailto:test@example.org test_that_it uses kde-open to launch the default e-mail client in KDE4 mock kreadconfig mock kde-open mock kmailservice mock_output kde4-config kmailservice run kde4 xdg-email test@example.org assert_run kde-open mailto:test@example.org test_that_it uses kde-open5 to launch the default e-mail client in KDE5 mock kreadconfig mock kde-open5 mock kmailservice mock kmailservice5 run kde5 xdg-email test@example.org assert_run kde-open5 mailto:test@example.org test_that_it uses run_thunderbird if default e-mail client is Thunderbird \ in KDE5 cp mock-kreadconfig5 $BINDIR/kreadconfig5 mock thunderbird mock kmailservice mock kmailservice5 run kde5 xdg-email test@example.org assert_run thunderbird -compose to=\'test@example.org,\' xdg-utils-1.1.2/autotests/t-xdg-icon-resource.sh000077500000000000000000000004721310406024200216160ustar00rootroot00000000000000#!/bin/sh COMMAND_TESTED=xdg-icon-resource . ./test-lib.sh test_that_it installs a png icon system-wide touch $LABDIR/icon.png run generic xdg-icon-resource install --mode system --size 256 \ $LABDIR/icon.png myvendor-myapp assert_file_exists $XDG_DATA_DIR_LOCAL/icons/hicolor/256x256/apps/myvendor-myapp.png xdg-utils-1.1.2/autotests/t-xdg-mime-query-default.sh000077500000000000000000000004171310406024200225540ustar00rootroot00000000000000#!/bin/sh COMMAND_TESTED="xdg-mime query default" . ./test-lib.sh test_that_it reads \$XDG_CONFIG_HOME/mimeapps.list mock_default_app x-scheme-handler/http mosaic handler=$(run generic xdg-mime query default x-scheme-handler/http) assert_equal mosaic.desktop "$handler" xdg-utils-1.1.2/autotests/t-xdg-open.sh000077500000000000000000000107761310406024200200120ustar00rootroot00000000000000#!/bin/sh COMMAND_TESTED=xdg-open . ./test-lib.sh test_open_url() { local de=$1 shift local cmd=$1 mock $cmd run $de xdg-open http://www.freedesktop.org/ assert_run "$@" http://www.freedesktop.org/ unmock $cmd } mock_xdg_mime() { local file="$1" mimetype="$2" handler="$3" mock xdg-mime ' if [ $# = 3 ] && [ "$1" = query ] && [ "$2" = filetype ] && \ [ "$3" = '\'"$file"\'' ]; then echo '$mimetype' elif [ $# = 3 ] && [ "$1" = query ] && [ "$2" = default ] && \ [ "$3" = '$mimetype' ]; then echo '$handler'.desktop else echo "unexpected mock invokation: xdg-mime $*" >&2 exit 1 fi ' } test_generic_open_file() { local filename="$1" echo foo > "$LABDIR/$1" mock_xdg_mime "$LABDIR/$1" text/plain textedit mock_desktop_file textedit %f mock textedit run generic xdg-open "$LABDIR/$1" assert_run textedit "$LABDIR/$1" } test_that_it opens a URL with "gio open" in recent GNOME 3, and Cinnamon mock "gio open" test_open_url gnome3 "gio open" test_open_url cinnamon "gio open" test_that_it opens a URL with gvfs-open if "gio open" is missing in GNOME 3, \ GNOME 2, and Cinnamon mock_missing "gio open" mock gvfs-open test_open_url gnome3 gvfs-open test_open_url gnome2 gvfs-open test_open_url cinnamon gvfs-open test_that_it opens a URL with gnome-open if "gio open" and gvfs-open are \ missing in GNOME 2 mock_missing "gio open" mock_missing gvfs-open test_open_url gnome2 gnome-open test_that_it opens a URL with the generic method if "gio open" and gvfs-open \ are missing in GNOME 3, and Cinnamon mock_missing "gio open" mock_missing gvfs-open mock gnome-open mock_desktop_file mosaic %u mock_default_app x-scheme-handler/http mosaic test_open_url gnome3 mosaic test_open_url cinnamon mosaic test_that_it opens a URL with the generic method if "gio open", gvfs-open and \ gnome-open are missing in GNOME 2 mock_missing "gio open" mock_missing gvfs-open mock_missing gnome-open mock_desktop_file mosaic %u mock_default_app x-scheme-handler/http mosaic test_open_url gnome2 mosaic test_that_it opens a URL with kfmclient in KDE 3 test_open_url kde3 kfmclient exec test_that_it opens a URL with kde-open in KDE 4 test_open_url kde4 kde-open test_that_it opens a URL with kde-open5 in KDE 5 test_open_url kde5 kde-open5 test_that_it opens a URL with gvfs-open in MATE test_open_url mate gvfs-open test_that_it opens a URL with mate-open if "gio open" and gvfs-open are \ missing in MATE mock_missing "gio open" mock_missing gvfs-open test_open_url mate mate-open test_that_it opens a URL with exo-open in XFCE test_open_url xfce exo-open test_that_it opens a URL with enlightenment_open in Enlightenment test_open_url enlightenment enlightenment_open test_that_it opens a file path with pcmanfm in LXDE mock pcmanfm touch $LABDIR/file.txt run lxde xdg-open $LABDIR/file.txt assert_run pcmanfm $(pwd)/$LABDIR/file.txt test_that_it percent-decodes a file:// URL and opens it with pcmanfm in LXDE mock pcmanfm touch $LABDIR/file.txt run lxde xdg-open file://$(pwd)/$LABDIR/file%2etxt assert_run pcmanfm $(pwd)/$LABDIR/file.txt test_that_it opens files with spaces in their name in LXDE echo foo > "$LABDIR/test file.txt" mock pcmanfm run lxde xdg-open "$LABDIR/test file.txt" assert_run pcmanfm "$(pwd)/$LABDIR/test file.txt" test_that_it looks up x-scheme-handler/\* in LXDE mock_desktop_file mosaic %u mock_default_app x-scheme-handler/http mosaic test_open_url lxde mosaic test_that_it looks up x-scheme-handler/\* in generic mode mock_desktop_file mosaic %u mock_default_app x-scheme-handler/http mosaic test_open_url generic mosaic test_that_it always uses \$BROWSER if set in generic mode BROWSER=cyberdog mock_desktop_file mosaic %u mock_default_app x-scheme-handler/http mosaic mock mosaic test_open_url generic cyberdog test_that_it works with multi-word \$BROWSER commands BROWSER="cyberdog --url %s" test_open_url generic cyberdog --url test_that_it is not vulnerable to command injection in URLs when using \ \$BROWSER in generic mode mock cyberdog BROWSER="cyberdog --url %s" run generic xdg-open 'http://www.freedesktop.org/; echo BUSTED' assert_run cyberdog --url 'http://www.freedesktop.org/; echo BUSTED' test_that_it opens files in generic mode test_generic_open_file test.txt test_that_it opens files with \# characters in their name in generic mode test_generic_open_file 'test#file.txt' test_that_it opens files with spaces in their name in generic mode test_generic_open_file 'test file.txt' xdg-utils-1.1.2/autotests/t-xdg-screensaver.sh000077500000000000000000000005111310406024200213530ustar00rootroot00000000000000#!/bin/sh COMMAND_TESTED=xdg-screensaver . ./test-lib.sh test_that_it calls xset -dpms, xset +dpms and xset dpms force when \ performing reset mock xset 'if [ "$1" = -q ]; then echo " DPMS is Enabled"; fi' run generic xdg-screensaver reset assert_run xset -dpms assert_run xset +dpms assert_run xset dpms force on xdg-utils-1.1.2/autotests/t-xdg-settings.sh000077500000000000000000000022461310406024200207020ustar00rootroot00000000000000#!/bin/sh COMMAND_TESTED=xdg-settings . ./test-lib.sh test_that_it determines default browser using GConf in GNOME 2 mock_output gconftool-2 "mosaic %s" mock_desktop_file mosaic %u assert_equal mosaic.desktop \ "$(run gnome2 xdg-settings get default-web-browser)" assert_run gconftool-2 --get /desktop/gnome/applications/browser/exec for de in gnome3 cinnamon lxde mate generic; do test_that_it determines default browser from \ \$XDG_CONFIG_HOME/mimeapps.list in $de mock_default_app x-scheme-handler/http mosaic assert_equal mosaic.desktop \ "$(run $de xdg-settings get default-web-browser)" test_that_it determines default URL handler from \ \$XDG_CONFIG_HOME/mimeapps.list in $de mock_default_app x-scheme-handler/magnet footorrent assert_equal \ footorrent.desktop \ "$(run $de xdg-settings get default-url-scheme-handler magnet)" done test_that_it uses \$BROWSER in generic mode mock mosaic BROWSER=mosaic mock_desktop_file mosaic mock_default_app x-scheme-handler/http cyberdog assert_equal mosaic.desktop \ "$(run generic xdg-settings get default-web-browser)" xdg-utils-1.1.2/autotests/test-lib.sh000066400000000000000000000107551310406024200175450ustar00rootroot00000000000000set -e TEST_NAME=$0 LABDIR=lab LABHOME=lab/home BINDIR=$LABDIR/bin COMMANDS_RUN=$LABDIR/commands-run FAILED_TESTS=failed-tests CURRENT_TEST_CASE= XDG_DATA_HOME=$LABHOME/.local/share XDG_DATA_DIR=$LABDIR/share XDG_DATA_DIR_LOCAL=$LABDIR/share-local XDG_DATA_DIRS=$XDG_DATA_DIR_LOCAL:$XDG_DATA_DIR XDG_CONFIG_HOME=$LABHOME/.config XDG_CONFIG_DIRS=$LABDIR/etc-xdg fatal() { echo "FATAL: $*" >&2 exit 1 } reset_lab_() { [ -f test-lib.sh ] || fatal "You must run tests from the autotests directory!" [ -e $LABDIR ] && rm -r $LABDIR BROWSER= mkdir -p \ $BINDIR \ $LABHOME \ $XDG_DATA_HOME/applications $XDG_DATA_DIR/applications \ $XDG_DATA_DIR_LOCAL/applications \ $XDG_DATA_HOME/icons/hicolor $XDG_DATA_DIR/icons/hicolor \ $XDG_DATA_DIR_LOCAL/icons/hicolor \ $XDG_CONFIG_HOME \ $XDG_CONFIG_DIRS \ mock x-www-browser touch $COMMANDS_RUN } test_that_it() { CURRENT_TEST_CASE="$*" echo " - $CURRENT_TEST_CASE" reset_lab_ } set_de_() { unmock gnome-default-applications-properties unmock kde-config KDE_SESSION_VERSION= case "$1" in cinnamon) XDG_CURRENT_DESKTOP=Cinnamon ;; enlightenment) XDG_CURRENT_DESKTOP=ENLIGHTENMENT ;; gnome2) XDG_CURRENT_DESKTOP=GNOME mock gnome-default-applications-properties ;; gnome3) XDG_CURRENT_DESKTOP=GNOME ;; kde3) XDG_CURRENT_DESKTOP=KDE mock_output kde-config "KDE: 3.5.5" ;; kde4) XDG_CURRENT_DESKTOP=KDE KDE_SESSION_VERSION=4 ;; kde5) XDG_CURRENT_DESKTOP=KDE KDE_SESSION_VERSION=5 ;; lxde) XDG_CURRENT_DESKTOP=LXDE ;; mate) XDG_CURRENT_DESKTOP=MATE ;; xfce) XDG_CURRENT_DESKTOP=XFCE ;; generic) XDG_CURRENT_DESKTOP=X-Generic ;; *) fatal "unknown desktop environment: $1" ;; esac } mock() { local command="$1" script="$2" local executable="$BINDIR/$command" cat >"$executable" <> $(pwd)/$COMMANDS_RUN $script EOF chmod +x "$executable" } mock_missing() { local command="$1" mock "$command" "exit 127" } mock_output() { local command="$1" output="$2" mock "$command" "echo '$output'" } unmock() { if [ -e "$BINDIR/$1" ]; then rm "$BINDIR/$1" fi } is_mocked() { if [ -e "$BINDIR/$1" ]; then return 0 else return 1 fi } mock_desktop_file() { cat > "$XDG_DATA_DIR/applications/$1.desktop" < $mimeapps fi echo "$mimetype=$app.desktop" >> $mimeapps } assertion_failed() { echo "ASSERTION FAILED: $*" >&2 echo "$TEST_NAME: Assertion failed when testing that $COMMAND_TESTED" \ "$CURRENT_TEST_CASE: $*" >> $FAILED_TESTS } assert_run() { if grep -Fxq "$*" $COMMANDS_RUN; then return 0 else assertion_failed "expected command to be run: $*" fi } assert_equal() { if [ "$1" = "$2" ]; then return 0 else assertion_failed "expected: '$1' got: '$2'" fi } assert_file_exists() { if [ -e "$1" ]; then return 0 else assertion_failed "expected file to exist: $1" fi } run() { local de="$1" shift local cmd="$1" shift : > $COMMANDS_RUN set_de_ $de local trace= if [ "$TRACE" = 1 ]; then trace="sh -x" fi if [ "$TRACE" = 1 ] || [ "$TRACE_RUN" = 1 ]; then echo "RUN [$de] $cmd $*" >&2 fi env -i \ PATH="$BINDIR:../scripts:$PATH" \ SHELL="$SHELL" \ USERNAME="$USERNAME" \ HOME="$LABHOME" \ LOGNAME="$LOGNAME" \ TERM="$TERM" \ XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP" \ XDG_UTILS_DEBUG_LEVEL="$XDG_UTILS_DEBUG_LEVEL" \ KDE_SESSION_VERSION="$KDE_SESSION_VERSION" \ XDG_DATA_DIRS=$XDG_DATA_DIRS \ XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS \ DISPLAY=x \ BROWSER="$BROWSER" \ $trace ../scripts/$cmd "$@" } echo "* Testing that $COMMAND_TESTED" xdg-utils-1.1.2/configure000077500000000000000000002615561310406024200153510ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for xdg-utils 1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: portland@lists.freedesktop.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xdg-utils' PACKAGE_TARNAME='xdg-utils' PACKAGE_VERSION='1' PACKAGE_STRING='xdg-utils 1' PACKAGE_BUGREPORT='portland@lists.freedesktop.org' PACKAGE_URL='' ac_subst_vars='LTLIBOBJS LIBOBJS XMLTO INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM SET_MAKE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures xdg-utils 1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xdg-utils] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xdg-utils 1:";; esac cat <<\_ACEOF Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xdg-utils configure 1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by xdg-utils $as_me 1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "xmlto", so it can be a program name with args. set dummy xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLTO in [\\/]* | ?:[\\/]*) ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XMLTO" && ac_cv_path_XMLTO="/usr/bin/xmlto" ;; esac fi XMLTO=$ac_cv_path_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ac_config_files="$ac_config_files Makefile scripts/Makefile tests/Makefile autotests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by xdg-utils $as_me 1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xdg-utils config.status 1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "autotests/Makefile") CONFIG_FILES="$CONFIG_FILES autotests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xdg-utils-1.1.2/configure.ac000066400000000000000000000003771310406024200157200ustar00rootroot00000000000000AC_PREREQ(2.50) AC_INIT(xdg-utils, 1, portland@lists.freedesktop.org) AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PATH_PROG(XMLTO, xmlto, /usr/bin/xmlto) AC_CONFIG_FILES([ Makefile scripts/Makefile tests/Makefile autotests/Makefile ]) AC_OUTPUT xdg-utils-1.1.2/install-sh000066400000000000000000000127361310406024200154350ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 xdg-utils-1.1.2/scripts/000077500000000000000000000000001310406024200151125ustar00rootroot00000000000000xdg-utils-1.1.2/scripts/.gitignore000066400000000000000000000001751310406024200171050ustar00rootroot00000000000000Makefile README xdg-desktop-icon xdg-desktop-menu xdg-email xdg-icon-resource xdg-mime xdg-open xdg-screensaver xdg-settings xdg-utils-1.1.2/scripts/HACKING000066400000000000000000000011571310406024200161050ustar00rootroot00000000000000Note that the actual scripts are generated from xdg-*.in, xdg-utils-common.in and desc/xdg-*.xml which contains the command line descriptions. These are the files that you want to edit. To add a new script, you must also provide a desc/xdg-*.xml file. DO NOT MAKE CHANGES TO THE GENERATED SCRIPTS THEMSELVES! Use 'make scripts-clean' to delete all generated files and use 'make scripts' to re-generate them. The manual files in man/ and html/ are also generated from the desc/xdg-*.xml files. Use 'make scripts html man' to update all generated files Use 'make release' to remove everything but the generated files. xdg-utils-1.1.2/scripts/Makefile.in000066400000000000000000000055201310406024200171610ustar00rootroot00000000000000MKDIR = mkdir -p RMDIR = rmdir INSTALL = @INSTALL@ $(INSTALL_FLAGS) INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS) INSTALL_LIBRARY = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS) INSTALL_SCRIPT = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS) INSTALL_DATA = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS) XMLTO = @XMLTO@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ SCRIPTS = \ xdg-desktop-menu \ xdg-desktop-icon \ xdg-mime \ xdg-icon-resource \ xdg-open \ xdg-email \ xdg-screensaver \ xdg-settings # xdg-su # xdg-copy \ # xdg-file-dialog # xdg-terminal MANPAGES= $(SCRIPTS:%=man/%.1) WEBPAGES= $(SCRIPTS:%=html/%.html) XMLFILES= $(SCRIPTS:%=desc/%.xml) all: html man scripts html: html/index.html $(WEBPAGES) scripts: README $(SCRIPTS) man: $(MANPAGES) release: scripts html man rm -f *~ #rm -rf desc/ xsl/ rm -f xdg-file-dialog xdg-su xdg-copy xdg-terminal distclean: clean rm -f Makefile man/xdg-*.1 html/xdg-*.html clean: scripts-clean scripts-clean: rm -f $(SCRIPTS) README README: $(SCRIPTS) echo > $@ @for x in $(SCRIPTS) ; do \ sh ./$$x --help | grep -B 100 Synopsis | sed -e '$$d' >> $@ ; \ done install: $(MKDIR) $(DESTDIR)$(bindir) for x in $(SCRIPTS) ; do \ $(INSTALL_SCRIPT) $$x $(DESTDIR)$(bindir) ; \ done $(MKDIR) $(DESTDIR)$(mandir) $(MKDIR) $(DESTDIR)$(mandir)/man1 for x in $(MANPAGES) ; do \ if [ -f $$x ]; then \ $(INSTALL_DATA) $$x $(DESTDIR)$(mandir)/man1 ; \ fi ; \ done uninstall: for x in $(MANPAGES) ; do \ rm -f $(DESTDIR)$(mandir)/man1/`basename $$x` ; \ done -$(RMDIR) $(DESTDIR)$(mandir)/man1 -$(RMDIR) $(DESTDIR)$(mandir) for x in $(SCRIPTS) ; do \ rm -f $(DESTDIR)$(bindir)/$$x ; \ done -$(RMDIR) $(DESTDIR)$(bindir) %: %.in %.txt awk -f generate-help-script.awk $@.in | sed -e 's/@NAME@/'$@'/g' > $@ chmod a+x $@ xdg-desktop-menu: xdg-desktop-menu.in xdg-utils-common.in xdg-desktop-icon: xdg-desktop-icon.in xdg-utils-common.in xdg-email: xdg-email.in xdg-utils-common.in xdg-mime: xdg-mime.in xdg-utils-common.in xdg-open: xdg-open.in xdg-utils-common.in xdg-screensaver: xdg-screensaver.in xdg-utils-common.in xdg-settings: xdg-settings.in xdg-utils-common.in xdg-icon-resource: xdg-icon-resource.in xdg-utils-common.in xdg-su: xdg-su.in xdg-utils-common.in xdg-copy: xdg-copy.in xdg-utils-common.in xdg-file-dialog: xdg-file-dialog.in xdg-utils-common.in xdg-terminal: xdg-terminal.in xdg-utils-common.in man/%.1: desc/%.xml (cd man;$(XMLTO) man ../$<) html/index.html: $(XMLFILES) (cat html/index.html.pre; \ xsltproc xsl/refentry2htmlindex.xsl $(XMLFILES); \ cat html/index.html.post ) > html/index.html html/%.html: desc/%.xml (cd html;$(XMLTO) html-nochunks ../$<) %.txt: desc/%.xml $(XMLTO) txt $< xdg-utils-1.1.2/scripts/desc/000077500000000000000000000000001310406024200160305ustar00rootroot00000000000000xdg-utils-1.1.2/scripts/desc/xdg-copy.xml000066400000000000000000000101761310406024200203110ustar00rootroot00000000000000 xdg-copy Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
This is release 0.5 of the xdg-copy Manual.
xdg-copy 1 xdg-copy command line tool for copying files between desktop URIs xdg-copy xdg-copy Description xdg-copy copies source to destination and provides visual feedback to the user during the operation. Both source and destination can either be a file or URL. Supported URL types are file, ftp, http and https. Additional URL types may be supported depending on the desktop environment. xdg-copy is for use inside a desktop session only. It is not recommended to use xdg-copy as root. Options Show command synopsis. Show this manual page. Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. Examples xdg-copy "http://portland.freedesktop.org/png/freedesktop-logo.png" . xdg-copy "/tmp/foobar.png" "/home/user/foobar-copy.png"
xdg-utils-1.1.2/scripts/desc/xdg-desktop-icon.xml000066400000000000000000000246621310406024200217430ustar00rootroot00000000000000 xdg-desktop-icon Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
xdg-utils 1.0
xdg-desktop-icon 1 xdg-desktop-icon command line tool for (un)installing icons to the desktop xdg-desktop-icon install FILE xdg-desktop-icon uninstall FILE xdg-desktop-icon Description The xdg-desktop-icon program can be used to install an application launcher or other file on the desktop of the current user. An application launcher is represented by a *.desktop file. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below. Commands install Installs FILE to the desktop of the current user. FILE can be a *.desktop file or any other type of file. uninstall Removes FILE from the desktop of the current user. Options Normally, xdg-desktop-icon checks to ensure that a *.desktop file to be installed has a vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. Show command synopsis. Show this manual page. Show the xdg-utils version information. Desktop Files An application launcher can be added to the desktop by installing a *.desktop file. A *.desktop file consists of a [Desktop Entry] header followed by several Key=Value lines. A *.desktop file can provide a name and description for an application in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language. The following keys are often used: Type=Application This is a mandatory field that indicates that the *.desktop file describes an application launcher. Name=Application Name The name of the application. For example Mozilla GenericName=Generic Name A generic description of the application. For example Web Browser Comment=Comment Optional field to specify a tooltip for the application. For example Visit websites on the Internet Icon=Icon File The icon to use for the application. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the application icon can be provided in several different sizes as well as in several differently themed styles. Exec=Command Line The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F. For a complete overview of the *.desktop file format please visit Environment Variables xdg-desktop-icon honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-desktop-icon do more verbose reporting on stderr. Setting a higher value increases the verbosity. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. No permission to read one of the files passed on the command line. See Also xdg-icon-resource 1 Examples The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add a launcher for for on the desktop. The company will use "shinythings" as its vendor id. In order to add the application to the desktop there needs to be a .desktop file for the application: shinythings-webmirror.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=shinythings-webmirror Name=WebMirror Name[nl]=WebSpiegel Now the xdg-desktop-icon tool can be used to add the webmirror.desktop file to the desktop: xdg-desktop-icon install ./shinythings-webmirror.desktop To add a README file to the desktop as well, the following command can be used: xdg-desktop-icon install ./shinythings-README
xdg-utils-1.1.2/scripts/desc/xdg-desktop-menu.xml000066400000000000000000000533141310406024200217530ustar00rootroot00000000000000 xdg-desktop-menu Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
xdg-utils 1.0
xdg-desktop-menu 1 xdg-desktop-menu command line tool for (un)installing desktop menu items xdg-desktop-menu install directory-file(s) desktop-file(s) xdg-desktop-menu uninstall directory-file(s) desktop-file(s) xdg-desktop-menu forceupdate xdg-desktop-menu Description The xdg-desktop-menu program can be used to install new menu entries to the desktop's application menu. The application menu works according to the XDG Desktop Menu Specification at Commands install Install one or more applications in a submenu of the desktop menu system. desktop-file: A desktop file represents a single menu entry in the menu. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below. Menu entries can be added to the menu system in two different ways. They can either be added to a predefined submenu in the menu system based on one or more category keywords, or they can be added to a new submenu. To add a menu entry to a predefined submenu the desktop file that represents the menu entry must have a Categories= entry that lists one or more keywords. The menu item will be included in an appropriate submenu based on the included keywords. To add menu items to a new submenu the desktop-files must be preceded by a directory-file that describes the submenu. If multiple desktop-files are specified, all entries will be added to the same menu. If entries are installed to a menu that has been created with a previous call to xdg-desktop-menu the entries will be installed in addition to any already existing entries. directory-file: The *.directory file indicated by directory-file represents a submenu. The directory file provides the name and icon for a submenu. The name of the directory file is used to identify the submenu. If multiple directory files are provided each file will represent a submenu within the menu that precedes it, creating a nested menu hierarchy (sub-sub-menus). The menu entries themselves will be added to the last submenu. Directory files follow the syntax defined by the freedesktop.org Desktop Entry Specification. uninstall Remove applications or submenus from the desktop menu system previously installed with xdg-desktop-menu install. A submenu and the associated directory file is only removed when the submenu no longer contains any menu entries. forceupdate Force an update of the menu system. This command is only useful if the last call to xdg-desktop-menu included the option. Options Postpone updating the menu system. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necessary to update the menu system right away. Normally, xdg-desktop-menu checks to ensure that any *.directory and *.desktop files to be installed has a vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. Show command synopsis. Show this manual page. Show the xdg-utils version information. Desktop Files An application item in the application menu is represented by a *.desktop file. A *.desktop file consists of a [Desktop Entry] header followed by several Key=Value lines. A *.desktop file can provide a name and description for an application in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language. The following keys are often used: Type=Application This is a mandatory field that indicates that the *.desktop file describes an application launcher. Name=Application Name The name of the application. For example Mozilla GenericName=Generic Name A generic description of the application. For example Web Browser Comment=Comment Optional field to specify a tooltip for the application. For example Visit websites on the Internet Icon=Icon File The icon to use for the application. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the application icon can be provided in several different sizes as well as in several differently themed styles. Exec=Command Line The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F. Categories=Categories A list of categories separated by semi-colons. A category is a keyword that describes and classifies the application. By default applications are organized in the application menu based on category. When menu entries are explicitly assigned to a new submenu it is not necessary to list any categories. When using categories it is recommended to include one of the following categories: AudioVideo, Development, Education, Game, Graphics, Network, Office, Settings, System, Utility. See Appendix A of the XDG Desktop Menu Specification for information about additional categories: MimeType=Mimetypes A list of mimetypes separated by semi-colons. This field is used to indicate which file types the application is able to open. For a complete overview of the *.desktop file format please visit Directory Files The appearance of submenu in the application menu is provided by a *.directory file. In particular it provides the title of the submenu and a possible icon. A *.directory file consists of a [Desktop Entry] header followed by several Key=Value lines. A *.directory file can provide a title (name) for the submenu in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the Key. This way one can specify different values for the same Key depending on the currently selected language. The following keys are relevant for submenus: Type=Directory This is a mandatory field that indicates that the *.directory file describes a submenu. Name=Menu Name The title of submenu. For example Mozilla Comment=Comment Optional field to specify a tooltip for the submenu. Icon=Icon File The icon to use for the submenu. This can either be an absolute path to an image file or an icon-name. If an icon-name is provided an image lookup by name is done in the user's current icon theme. The xdg-icon-resource command can be used to install image files into icon themes. The advantage of using an icon-name instead of an absolute path is that with an icon-name the submenu icon can be provided in several different sizes as well as in several differently themed styles. Environment Variables xdg-desktop-menu honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-desktop-menu do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. No permission to read one of the files passed on the command line. See Also xdg-desktop-icon 1 , xdg-icon-resource 1 , xdg-mime 1 , Desktop entry specification, Desktop menu specification Examples The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add it to the application menu. The company will use "shinythings" as its vendor id. In order to add the application to the menu there needs to be a .desktop file with a suitable Categories entry: shinythings-webmirror.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=webmirror Name=WebMirror Name[nl]=WebSpiegel Categories=Network;WebDevelopment; Now the xdg-desktop-menu tool can be used to add the shinythings-webmirror.desktop file to the desktop application menu: xdg-desktop-menu install ./shinythings-webmirror.desktop Note that for the purpose of this example the menu items are available in two languages, English and Dutch. The language code for Dutch is nl. In the next example the company ShinyThings Inc. will add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item. First the company needs to create two .desktop files that describe the two menu items. Since the items are to be added to a new submenu it is not necessary to include a Categories= line: shinythings-webmirror.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror Icon=shinythings-webmirror Name=WebMirror Name[nl]=WebSpiegel shinythings-webmirror-admin.desktop: [Desktop Entry] Encoding=UTF-8 Type=Application Exec=webmirror-admintool Icon=shinythings-webmirror-admintool Name=WebMirror Admin Tool Name[nl]=WebSpiegel Administratie Tool In addition a .directory file needs to be created to provide a title and icon for the sub-menu itself: shinythings-webmirror.directory: [Desktop Entry] Encoding=UTF-8 Icon=shinythings-webmirror-menu Name=WebMirror Name[nl]=WebSpiegel These file can now be installed with: xdg-desktop-menu install ./shinythings-webmirror.directory \ ./shinythings-webmirror.desktop ./shinythings-webmirror-admin.desktop The menu entries could also be installed one by one: xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \ ./shinythings-webmirror.desktop xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \ ./shinythings-webmirror-admin.desktop xdg-desktop-menu forceupdate Although the result is the same it is slightly more efficient to install all files at the same time. The *.desktop and *.directory files reference icons with the names webmirror, webmirror-admin and webmirror-menu which should also be installed. In this example the icons are installed in two different sizes, once with a size of 22x22 pixels and once with a size of 64x64 pixels: xdg-icon-resource install --size 22 ./wmicon-22.png shinythings-webmirror xdg-icon-resource install --size 22 ./wmicon-menu-22.png shinythings-webmirror-menu xdg-icon-resource install --size 22 ./wmicon-admin-22.png shinythings-webmirror-admin xdg-icon-resource install --size 64 ./wmicon-64.png shinythings-webmirror xdg-icon-resource install --size 64 ./wmicon-menu-64.png shinythings-webmirror-menu xdg-icon-resource install --size 64 ./wmicon-admin-64.png shinythings-webmirror-admin
xdg-utils-1.1.2/scripts/desc/xdg-email.xml000066400000000000000000000205641310406024200204300ustar00rootroot00000000000000 xdg-email Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
xdg-utils 1.0
xdg-email 1 xdg-email command line tool for sending mail using the user's preferred e-mail composer xdg-email address address text text file mailto-uri address(es) xdg-email Description xdg-email opens the user's preferred e-mail composer in order to send a mail to address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored. address(es) must follow the syntax of RFC822. Multiple addresses may be provided as separate arguments. All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail. xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root. Options Indicates that all command line options that follow are in utf8. Without this option, command line options are expected to be encoded according to locale. If the locale already specifies utf8 this option has no effect. This option does not affect mailto URIs that are passed on the command line. address Specify a recipient to be copied on the e-mail. address Specify a recipient to be blindly copied on the e-mail. text Specify a subject for the e-mail. text Specify a body for the e-mail. Since the user will be able to make changes before actually sending the e-mail, this can be used to provide the user with a template for the e-mail. text may contain linebreaks. file Specify an attachment for the e-mail. file must point to an existing file. Some e-mail applications require the file to remain present after xdg-email returns. Show command synopsis. Show this manual page. Show the xdg-utils version information. Environment Variables xdg-email honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-email do more verbose reporting on stderr. Setting a higher value increases the verbosity. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. No permission to read one of the files passed on the command line. See Also xdg-open 1 , xdg-mime 1 , MIME applications associations specification, RFC 6068 - The 'mailto' URI Scheme Examples xdg-email 'Jeremy White <jwhite@example.com>' xdg-email --attach /tmp/logo.png \ --subject 'Logo contest' \ --body 'Attached you find the logo for the contest.' \ 'jwhite@example.com' xdg-email --subject 'Your password is about to expire' \ 'jwhite@example.com' 'bastian@example.com' 'whipple@example.com'
xdg-utils-1.1.2/scripts/desc/xdg-file-dialog.xml000066400000000000000000000147331310406024200215160ustar00rootroot00000000000000 xdg-file-dialog Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
This is release 0.5 of the xdg-mime Manual.
xdg-file-dialog 1 xdg-file-dialog command line tool for providing file and directory selection dialogs xdg-file-dialog openfilename FILENAME xdg-file-dialog openfilenamelist FILENAME xdg-file-dialog savefilename FILENAME xdg-file-dialog directory DIRNAME xdg-file-dialog Description The xdg-file-dialog program can be used to let the native file selection dialog handle file and directory input. xdg-file-dialog is for use inside a desktop session only. It is not recommended to use xdg-file-dialog as root. Commands openfilename Returns the filename with path for a file to read from. FILENAME can optionally be used to specify path and filename of a preselection. openfilenamelist Returns one or more filenames with path for files to read from, each on a new line. FILENAME can optionally be used to specify path and filename of a preselection. savefilename Returns the filename with path for file to write to. FILENAME can optionally be used to specify path and filename of a preselection. directory Returns the path for an existing directory. DIRNAME can optionally be used to specify a path of a preselection. Options TITLE Sets the dialog's title (caption) to the specified text. Show command synopsis. Show this manual page. Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. Examples xdg-file-dialog savefilename /tmp/foobar.png Asks for a save file name starting in directory /tmp and suggesting foobar.png as the filename xdg-file-dialog directory --title "Select a target folder" /tmp Asks for a directory name starting in directory /tmp using the text "Select a target folder" as the dialog's title/caption.
xdg-utils-1.1.2/scripts/desc/xdg-icon-resource.xml000066400000000000000000000305431310406024200221140ustar00rootroot00000000000000 xdg-icon-resource Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
xdg-utils 1.0
xdg-icon-resource 1 xdg-icon-resource command line tool for (un)installing icon resources xdg-icon-resource install icon-file icon-name xdg-icon-resource uninstall icon-name xdg-icon-resource forceupdate xdg-icon-resource Description The xdg-icon-resource program can be used to install icon resources into the desktop icon system in order to illustrate menu entries, to depict desktop icons or to graphically represent file types. The desktop icon system identifies icons by name. Depending on the required size, the choice of icon theme and the context in which the icon is used, the desktop icon system locates an appropriate icon resource to depict an icon. Icon resources can be XPM files or PNG files. The desktop icon system works according to the XDG Icon Theme Specification at Commands install Installs the icon file indicated by icon-file to the desktop icon system under the name icon-name. Icon names do not have an extension. If icon-name is not provided the name is derived from icon-file. The icon file must have .png or .xpm as extension. If a corresponding .icon file exists in the same location as icon-file it will be installed as well. uninstall Removes the icon indicated by icon-name from the desktop icon system. Note that icon names do not have an extension. forceupdate Force an update of the desktop icon system. This is only useful if the last call to xdg-icon-resource included the option. Options Postpone updating the desktop icon system. If multiple icons are added in sequence this flag can be used to indicate that additional changes will follow and that it is not necessary to update the desktop icon system right away. Normally, xdg-icon-resource checks to ensure that an icon file to be installed in the apps context has a proper vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. theme Installs or removes the icon file as part of theme. If no theme is specified the icons will be installed as part of the default hicolor theme. Applications may install icons under multiple themes but should at least install icons for the default hicolor theme. context Specifies the context for the icon. Icons to be used in the application menu and as desktop icon should use apps as context which is the default context. Icons to be used as file icons should use mimetypes as context. Other common contexts are actions, devices, emblems, filesystems and stock. size Specifies the size of the icon. All icons must be square. Common sizes for icons in the apps context are: 16, 22, 32, 48, 64 and 128. Common sizes for icons in the mimetypes context are: 16, 22, 32, 48, 64 and 128 mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. Show command synopsis. Show this manual page. Show the xdg-utils version information. Environment Variables xdg-icon-resource honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-icon-resource do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. No permission to read one of the files passed on the command line. See Also xdg-desktop-icon 1 , xdg-desktop-menu 1 , xdg-mime 1 , Icon theme specification Examples To install an icon resource to depict a launcher for the application myfoobar, the company ShinyThings Inc. can use: xdg-icon-resource install --size 64 shinythings-myfoobar.png To install an icon for a new application/x-foobar file type one can use: xdg-icon-resource install --context mimetypes --size 48 ./mime-foobar-48.png application-x-foobar xdg-icon-resource install --context mimetypes --size 64 ./mime-foobar-64.png application-x-foobar This will install two icons with the name application-x-foobar but with different sizes.
xdg-utils-1.1.2/scripts/desc/xdg-mime.xml000066400000000000000000000303371310406024200202670ustar00rootroot00000000000000 xdg-mime Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
xdg-utils 1.0
xdg-mime 1 xdg-mime command line tool for querying information about file type handling and adding descriptions for new file types xdg-mime query filetype default ... xdg-mime default application mimetype(s) xdg-mime install mimetypes-file xdg-mime uninstall mimetypes-file xdg-mime Description The xdg-mime program can be used to query information about file types and to add descriptions for new file types. Commands query Returns information related to file types. The query option is for use inside a desktop session only. It is not recommended to use xdg-mime query as root. The following queries are supported: query filetype FILE: Returns the file type of FILE in the form of a MIME type. query default mimetype: Returns the default application that the desktop environment uses for opening files of type mimetype. The default application is identified by its *.desktop file. default Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetypes. application is the desktop file id of the application and has the form vendor-name.desktop application must already be installed in the desktop menu before it can be made the default handler. The application's desktop file must list support for all the MIME types that it wishes to be the default handler for. Requests to make an application a default handler may be subject to system policy or approval by the end-user. xdg-mime query can be used to verify whether an application is the actual default handler for a specific file type. The default option is for use inside a desktop session only. It is not recommended to use xdg-mime default as root. install Adds the file type descriptions provided in mimetypes-file to the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root. For each new file type one or more icons with name type-subtype must be installed with the xdg-icon-resource command in the mimetypes context. For example the filetype application/vnd.oasis.opendocument.text requires an icon named application-vnd.oasis.opendocument.text to be installed (unless the file type recommends another icon name). uninstall Removes the file type descriptions provided in mimetypes-file and previously added with xdg-mime install from the desktop environment. mimetypes-file must be a XML file that follows the freedesktop.org Shared MIME-info Database specification and that has a mime-info element as its document root. Options mode mode can be user or system. In user mode the file is (un)installed for the current user only. In system mode the file is (un)installed for all users on the system. Usually only root is allowed to install in system mode. The default is to use system mode when called by root and to use user mode when called by a non-root user. Normally, xdg-mime checks to ensure that the mimetypes-file to be installed has a proper vendor prefix. This option can be used to disable that check. A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated with a dash ("-"). Companies and organizations are encouraged to use a word or phrase, preferably the organizations name, for which they hold a trademark as their vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. Show command synopsis. Show this manual page. Show the xdg-utils version information. Environment Variables xdg-mime honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-mime do more verbose reporting on stderr. Setting a higher value increases the verbosity. XDG_UTILS_INSTALL_MODE This environment variable can be used by the user or administrator to override the installation mode. Valid values are user and system. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. No permission to read one of the files passed on the command line. See Also xdg-icon-resource 1 , xdg-desktop-menu 1 , Shared MIME database specification, MIME applications associations specification Examples xdg-mime query filetype /tmp/foobar.png Prints the MIME type of the file /tmp/foobar.png, in this case image/png xdg-mime query default image/png Prints the .desktop filename of the application which is registered to open PNG files. xdg-mime install shinythings-shiny.xml Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as follows. shinythings-shiny.xml: <?xml version="1.0"?> <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'> <mime-type type="text/x-shiny"> <comment>Shiny new file type</comment> <glob pattern="*.shiny"/> <glob pattern="*.shi"/> </mime-type> </mime-info> An icon for this new file type must also be installed, for example with: xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny
xdg-utils-1.1.2/scripts/desc/xdg-open.xml000066400000000000000000000111221310406024200202700ustar00rootroot00000000000000 xdg-open Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
xdg-utils 1.0
xdg-open 1 xdg-open opens a file or URL in the user's preferred application xdg-open xdg-open Description xdg-open opens a file or URL in the user's preferred application. If a URL is provided the URL will be opened in the user's preferred web browser. If a file is provided the file will be opened in the preferred application for files of that type. xdg-open supports file, ftp, http and https URLs. xdg-open is for use inside a desktop session only. It is not recommended to use xdg-open as root. Options Show command synopsis. Show this manual page. Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. See Also xdg-mime 1 , xdg-settings 1 , MIME applications associations specification Examples xdg-open 'http://www.freedesktop.org/' Opens the freedesktop.org website in the user's default browser. xdg-open /tmp/foobar.png Opens the PNG image file /tmp/foobar.png in the user's default image viewing application.
xdg-utils-1.1.2/scripts/desc/xdg-screensaver.xml000066400000000000000000000154131310406024200216560ustar00rootroot00000000000000 xdg-screensaver Manual 2006 Bryce Harrington
bryce@osdl.org
xdg-utils 1.0
xdg-screensaver 1 xdg-screensaver command line tool for controlling the screensaver xdg-screensaver xdg-screensaver xdg-screensaver xdg-screensaver Description xdg-screensaver provides commands to control the screensaver. xdg-screensaver is for use inside a desktop session only. It is not recommended to use xdg-screensaver as root. Commands Suspends the screensaver and monitor power management. WindowID must be the X Window ID of an existing window of the calling application. The window must remain in existence for the duration of the suspension. WindowID can be represented as either a decimal number or as a hexadecimal number consisting of the prefix 0x followed by one or more hexadecimal digits. The screensaver can be suspended in relation to multiple windows at the same time. In that case screensaver operation is only restored once the screensaver has been resumed in relation to each of the windows Resume the screensaver and monitor power management after being suspended. WindowID must be the same X Window ID that was passed to a previous call of xdg-screensaver suspend Turns the screensaver on immediately. This may result in the screen getting locked, depending on existing system policies. Lock the screen immediately. Turns the screensaver off immediately. If the screen was locked the user may be asked to authenticate first. Prints enabled to stdout if the screensaver is enabled to turn on after a period of inactivity and prints disabled if the screensaver is not enabled. Options Show command synopsis. Show this manual page. Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. A required tool could not be found. The action failed. Examples xdg-screensaver suspend 0x1c00007 Causes the screensaver to be disabled till xdg-screensaver resume 0x1c00007 is called. 0x1c00007 must be the X Window ID of an existing window.
xdg-utils-1.1.2/scripts/desc/xdg-settings.xml000066400000000000000000000147341310406024200212030ustar00rootroot00000000000000 xdg-settings Manual 2009-2011 Mike Mammarella
mdm@google.com
xdg-utils 1.1.0
xdg-settings 1 xdg-settings get various settings from the desktop environment xdg-settings xdg-settings Description xdg-settings gets various settings from the desktop environment. For instance, desktop environments often provide proxy configuration and default web browser settings. Using xdg-settings these parameters can be extracted for use by applications that do not use the desktop environment's libraries (which would use the settings natively). xdg-settings is for use inside a desktop session only. It is not recommended to use xdg-settings as root. Options Show command synopsis. List all properties xdg-settings knows about. Show this manual page. Show the xdg-utils version information. Properties When using xdg-settings to get, check or set a destkop setting, properties and possibly sub-properties are used to specify the setting to be changed. Some properties (such as default-web-browser) fully describe the setting to be changed. Other properties (such as default-url-scheme-handler) require more information (in this case the actual scheme to set the default handler for) which must be provided in a sub-property. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. See Also xdg-mime 1 , xdg-open 1 , MIME applications associations specification Examples Get the desktop file name of the current default web browser xdg-settings get default-web-browser Check whether the default web browser is firefox.desktop, which can be false even if "get default-web-browser" says that is the current value (if only some of the underlying settings actually reflect that value) xdg-settings check default-web-browser firefox.desktop Set the default web browser to google-chrome.desktop xdg-settings set default-web-browser google-chrome.desktop Set the default mailto URL scheme handler to be evolution.desktop xdg-settings set default-url-scheme-handler mailto evolution.desktop
xdg-utils-1.1.2/scripts/desc/xdg-su.xml000066400000000000000000000106031310406024200177610ustar00rootroot00000000000000 xdg-su Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
Jeremy White
jwhite@codeweavers.com
This is release 0.5 of the xdg-su Manual.
xdg-su 1 xdg-su run a GUI program as root after prompting for the root password xdg-su xdg-su Description xdg-su provides a graphical dialog that prompts the user for a password to run command as user or as root if no user was specified. xdg-su is for use inside a desktop session only. xdg-su discards any stdout and stderr output from command. Options run command as user. The default is to run as root. Show command synopsis. Show this manual page. Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. One of the files passed on the command line did not exist. A required tool could not be found. The action failed. See Also su 1 Examples xdg-su -u root -c "/opt/shinythings/bin/install-GUI --install fast" Runs the /opt/shinythings/bin/install-GUI command with root permissions.
xdg-utils-1.1.2/scripts/desc/xdg-terminal.xml000066400000000000000000000071001310406024200211430ustar00rootroot00000000000000 xdg-terminal Manual 2006 Kevin Krammer
kevin.krammer@gmx.at
xdg-terminal Technology Preview
xdg-terminal 1 xdg-terminal opens the user's preferred terminal emulator application xdg-terminal xdg-terminal Description xdg-terminal opens the user's preferred terminal emulator application. If a command is provided the command will be executed by the shell within the newly opened terminal window. xdg-terminal is for use inside a desktop session only. It is not recommended to use xdg-terminal as root. Options Show command synopsis. Show this manual page. Show the xdg-utils version information. Exit Codes An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: Error in command line syntax. A required tool could not be found. The action failed. Examples xdg-terminal Opens the user's default terminal emulator, just starting an interactive shell. xdg-terminal top Opens the user's default terminal emulator and lets it run the top executable.
xdg-utils-1.1.2/scripts/generate-help-script.awk000066400000000000000000000056551310406024200216530ustar00rootroot00000000000000#!/usr/bin/awk -f #--------------------------------------------- # # generate-script.awk # # Simple AWK script to generate the XDG scripts, substituting the # necessary text from other source files. # # Copyright 2006, Benedikt Meurer # # LICENSE: # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. # #--------------------------------------------- # All lines from the input file should be printed { print } # The text from ../LICENSE should be inserted after # the "# LICENSE:" line /^# LICENSE:/ { while (getline < "../LICENSE") print close ("../LICENSE") } # Insert the examples text from the .txt file # after the "cat << _MANUALPAGE" line /^cat << _MANUALPAGE/ { # determine the name of the .txt file txtfile = FILENAME sub(/\.in$/, ".txt", txtfile) # read the .txt file content for (txtfile_print = 0; getline < txtfile; ) { # if (match ($0, /^Examples/) != 0) { # # print everything starting at the "Examples" line # txtfile_print = 1 # } # if (txtfile_print != 0) { # print $0 # } gsub("`","'") gsub("—","-") print $0 } close (txtfile) } # Insert the usage text from the .txt file # after the "cat << _USAGE" line /^cat << _USAGE/ { # determine the name of the .txt file txtfile = FILENAME sub(/\.in$/, ".txt", txtfile) # read the .txt file content for (txtfile_print = 0; getline < txtfile; ) { if (match ($0, /^Name/) != 0) { # skip empty line after "Name" getline < txtfile # from now on, print everything txtfile_print = 1 } else if (match ($0, /^Description/) != 0) { # stop at "Description" break } else if (txtfile_print != 0) { gsub("—","-") print $0 } } close (txtfile) } # Insert the xdg-utils-common.in content after # the "#@xdg-utils-common@" line /^#@xdg-utils-common@/ { while (getline < "xdg-utils-common.in") print close ("xdg-utils-common.in") } xdg-utils-1.1.2/scripts/html/000077500000000000000000000000001310406024200160565ustar00rootroot00000000000000xdg-utils-1.1.2/scripts/html/.gitignore000066400000000000000000000002401310406024200200420ustar00rootroot00000000000000index.html xdg-desktop-icon.html xdg-desktop-menu.html xdg-email.html xdg-icon-resource.html xdg-mime.html xdg-open.html xdg-screensaver.html xdg-settings.html xdg-utils-1.1.2/scripts/html/index.html.post000066400000000000000000000000301310406024200210300ustar00rootroot00000000000000 xdg-utils-1.1.2/scripts/html/index.html.pre000066400000000000000000000001551310406024200206410ustar00rootroot00000000000000

xdg-utils

This version of xdg-utils contains the following commands:

xdg-utils-1.1.2/scripts/man/000077500000000000000000000000001310406024200156655ustar00rootroot00000000000000xdg-utils-1.1.2/scripts/man/.gitignore000066400000000000000000000001751310406024200176600ustar00rootroot00000000000000xdg-desktop-icon.1 xdg-desktop-menu.1 xdg-email.1 xdg-icon-resource.1 xdg-mime.1 xdg-open.1 xdg-screensaver.1 xdg-settings.1 xdg-utils-1.1.2/scripts/xdg-copy.in000066400000000000000000000037041310406024200172000ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-copy # # Utility script to copy files specified by URLs, including # downloading and uploading from/to remote sites. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # Copyright 2006, Jeremy White # # LICENSE: # #--------------------------------------------- manualpage() { cat << _MANUALPAGE _MANUALPAGE } usage() { cat << _USAGE _USAGE } #@xdg-utils-common@ copy_kde() { kfmclient copy "$1" "$2" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } copy_gnome() { if gio help copy 2>/dev/null 1>&2; then gio copy "$1" "$2" elif gvfs-copy --help 2>/dev/null 1>&2; then gvfs-copy "$1" "$2" else gnomevfs-copy "$1" "$2" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } [ x"$1" != x"" ] || exit_failure_syntax source= dest= while [ $# -gt 0 ] ; do parm=$1 shift case $parm in -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$dest" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi if [ -n "$source" ] ; then dest=$parm else source=$parm fi ;; esac done if [ -z "${source}" ] ; then exit_failure_syntax "source argument missing" fi if [ -z "${dest}" ] ; then exit_failure_syntax "destination argument missing" fi detectDE case "$DE" in kde) copy_kde "$source" "$dest" ;; gnome*|cinnamon|lxde|mate|xfce) copy_gnome "$source" "$dest" ;; *) exit_failure_operation_impossible "no method available for copying '$source' to '$dest'" ;; esac xdg-utils-1.1.2/scripts/xdg-desktop-icon.in000066400000000000000000000065141310406024200206270ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-desktop-icon # # Utility script to install desktop items on a Linux desktop. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # Copyright 2006, Jeremy White # # LICENSE: # #--------------------------------------------- usage() { cat << _USAGE _USAGE } manualpage() { cat << _MANUALPAGE _MANUALPAGE } #@xdg-utils-common@ [ x"$1" != x"" ] || exit_failure_syntax action= desktop_file= case $1 in install) action=install ;; uninstall) action=uninstall ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift vendor=true while [ $# -gt 0 ] ; do parm=$1 shift case $parm in --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$desktop_file" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi if [ "$action" = "install" ] ; then check_input_file "$parm" fi desktop_file=$parm ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi if [ -z "$desktop_file" ] ; then exit_failure_syntax "FILE argument missing" fi filetype= case "$desktop_file" in *.desktop) filetype=desktop if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$desktop_file" fi ;; *) filetype=other ;; esac my_umask=077 desktop_dir="$HOME/Desktop" if xdg-user-dir 2>/dev/null 1>&2; then desktop_dir=`xdg-user-dir DESKTOP` fi desktop_dir_kde=`kde${KDE_SESSION_VERSION}-config --userpath desktop 2> /dev/null` if gconftool-2 -g /apps/nautilus/preferences/desktop_is_home_dir 2> /dev/null | grep true > /dev/null; then desktop_dir_gnome="$HOME" # Don't create $HOME/Desktop if it doesn't exist [ -w "$desktop_dir" ] || desktop_dir= fi if [ -n "$desktop_dir_kde" ]; then if [ ! -d "$desktop_dir_kde" ]; then save_umask=`umask` umask $my_umask mkdir -p "$desktop_dir_kde" umask $save_umask fi # Is the KDE desktop dir != $HOME/Desktop ? if [ "x`readlink -f "$desktop_dir"`" != "x`readlink -f "$desktop_dir_kde"`" ]; then # If so, don't create $HOME/Desktop if it doesn't exist [ -w "$desktop_dir" ] || desktop_dir= else desktop_dir_kde= fi fi basefile=`basename "$desktop_file"` DEBUG 1 "$action $desktop_file in $desktop_dir $desktop_dir_kde $desktop_dir_gnome" case $action in install) save_umask=`umask` umask $my_umask for x in "$desktop_dir" "$desktop_dir_kde" "$desktop_dir_gnome" ; do if [ -n "$x" ]; then mkdir -p "$x" eval 'cp "$desktop_file" "$x/$basefile"'$xdg_redirect_output chmod u+x "$x/$basefile" fi done umask $save_umask ;; uninstall) for x in "$desktop_dir" "$desktop_dir_kde" "$desktop_dir_gnome" ; do if [ -n "$x" ]; then rm -f "$x/$basefile" fi done ;; esac exit_success xdg-utils-1.1.2/scripts/xdg-desktop-menu.in000066400000000000000000000433631310406024200206460ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-desktop-menu # # Utility script to install menu items on a Linux desktop. # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # Copyright 2006, Jeremy White # # LICENSE: # #--------------------------------------------- manualpage() { cat << _MANUALPAGE _MANUALPAGE } usage() { cat << _USAGE _USAGE } #@xdg-utils-common@ update_desktop_database() { # echo Update desktop database: $mode if [ "$mode" = "system" ] ; then for x in `echo $PATH | sed 's/:/ /g'` /opt/gnome/bin; do if [ -x $x/update-desktop-database ] ; then DEBUG 1 "Running $x/update-desktop-database" eval '$x/update-desktop-database'$xdg_redirect_output return fi done fi } # Make application $1/$2 the default for all the mimetypes it support, # iff such mimetype didn't had a default application already. # $1 Install dir for desktop file # $2 base name of desktop file make_lazy_default() { local mimetypes local xdg_user_dir local xdg_default_dirs DEBUG 1 "make_lazy_default $1/$2" mimetypes=`awk ' { if (match($0,/MimeType=/)) { split(substr($0,RSTART+9),mimetypes,";") for (n in mimetypes) { if (mimetypes[n]) print mimetypes[n] } } }' "$1/$2" 2> /dev/null` for MIME in $mimetypes ; do xdg_default_dirs="$XDG_DATA_DIRS" [ -n "$xdg_default_dirs" ] || xdg_default_dirs=/usr/local/share/:/usr/share/ if [ x"$mode" = x"user" ] ; then xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_default_dirs="$xdg_user_dir:$xdg_default_dirs" fi local default_app for x in `echo "$xdg_default_dirs" | sed 's/:/ /g'`; do DEBUG 2 "Checking $x/applications/defaults.list" default_app=`grep "$MIME=" $x/applications/defaults.list 2> /dev/null | cut -d '=' -f 2` if [ -n "$default_app" ] ; then DEBUG 2 "Found default apps for $MIME: $default_app" default_app="$default_app;" break; fi done DEBUG 2 "Current default apps for $MIME: $default_app" if echo "$default_app" | grep "$2" > /dev/null 2> /dev/null; then # App already listed as default continue; fi default_file="$(readlink -f "$1/defaults.list")" DEBUG 1 "Updating $default_file" grep -v "$MIME=" $default_file > ${default_file}.new 2> /dev/null if ! grep "[Default Applications]" ${default_file}.new > /dev/null; then echo "[Default Applications]" >> ${default_file}.new fi echo $MIME="$default_app$2" >> ${default_file}.new mv ${default_file}.new $default_file done } update_submenu() { DEBUG 1 "update_submenu $1" menu_file="$1" xdg_dir_name=menus xdg_user_dir="$XDG_CONFIG_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.config" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_CONFIG_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/etc/xdg xdg_global_dir= for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_dir="$x/$xdg_dir_name" break fi done xdg_user_dir="$xdg_user_dir/applications-merged" xdg_global_dir="$xdg_global_dir/applications-merged" DEBUG 3 "Install locations for *.menu file:" DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 my_chmod=0600 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 my_chmod=0644 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system menu directory found." fi fi if [ -z "$menu_file" ] ; then # Work around for SUSE/gnome 2.12 to pick up new ~/.local/share/applications save_umask=`umask` umask $my_umask mkdir -p $xdg_dir touch $xdg_dir/@NAME@-dummy.menu umask $save_umask return fi if [ $action = "install" ] && [ -f "/etc/xdg/menus/gnome-applications.menu" ] ; then # Work around for Debian Gnome gnome_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/gnome-applications-merged^'` if [ ! -e "$gnome_xdg_dir" ] ; then DEBUG 1 "Debian Workaround: Link '$xdg_dir' to '$gnome_xdg_dir'" mkdir -p `dirname "$gnome_xdg_dir"` eval 'ln -s "applications-merged" "$gnome_xdg_dir"'$xdg_redirect_output fi fi if [ $action = "install" ] && [ -f "/etc/mandrake-release" ] ; then # Work around for Mandriva 2006 mandrake_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/applications-mdk-merged^'` if [ ! -e "$mandrake_xdg_dir" ] ; then DEBUG 1 "Mandriva Workaround: Link '$xdg_dir' to '$mandrake_xdg_dir'" mkdir -p `dirname "$mandrake_xdg_dir"` eval 'ln -s "applications-merged" "$mandrake_xdg_dir"'$xdg_redirect_output fi fi if [ $action = "install" -a x"$mode" = x"user" ] && [ -d "/etc/xdg/menus/kde-applications-merged" ] ; then # Work around for Fedora Core 5 + patched KDE kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'` if [ ! -e "$kde_xdg_dir" ] ; then DEBUG 1 "Fedora Workaround: Link '$xdg_dir' to '$kde_xdg_dir'" mkdir -p `dirname "$kde_xdg_dir"` eval 'ln -s "applications-merged" "$kde_xdg_dir"'$xdg_redirect_output fi fi if [ $action = "install" -a x"$mode" = x"system" ] && [ -d "/etc/xdg/menus/kde-applications-merged" ] && [ ! -d "/etc/xdg/menus/applications-merged" ] ; then # Work around for Kubuntu 6.06 kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'` DEBUG 1 "Kubuntu Workaround: Link '$xdg_dir' to 'kde-applications-merged'" eval 'ln -s "kde-applications-merged" "$xdg_dir"'$xdg_redirect_output fi orig_menu_file=$xdg_dir/$menu_file DEBUG 1 "Updating $orig_menu_file ($action)" test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` orig_desktop_files= if [ -r "$orig_menu_file" ] ; then awk ' # List all files within tags BEGIN { RS="<" } /^Filename/ { if (match($0,/>/)) { print substr($0,RSTART+1) } }' $orig_menu_file > $tmpfile fi orig_desktop_files=`cat $tmpfile` new_desktop_files= if [ $action = "install" ] ; then for desktop_file in $desktop_files; do basefile=`basename "$desktop_file"` if ! grep '^'$basefile'$' $tmpfile > /dev/null 2> /dev/null ; then # Append echo "$basefile" >> $tmpfile fi done new_desktop_files=`cat $tmpfile` fi if [ $action = "uninstall" ] ; then echo > $tmpfile for desktop_file in $desktop_files; do echo "$desktop_file" >> $tmpfile done # Files to uninstall are listed in $tmpfile # Existing files are in $orig_desktop_files if [ ! -z "$orig_desktop_files" ]; then for desktop_file in $orig_desktop_files; do if ! grep '^'$desktop_file'$' $tmpfile > /dev/null 2> /dev/null; then # Keep this file, it's not in the uninstall list new_desktop_files="$new_desktop_files $desktop_file" fi done fi fi rm -f "$tmpfile" DEBUG 3 "Files to list in $menu_file: $new_desktop_files" if [ -n "$new_desktop_files" ] ; then # Install/update test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` ( echo '' echo '' echo '' echo ' Applications' for desktop_file in $directory_files; do basefile=`basename "$desktop_file"` basefilename=`echo "$basefile"|cut -d '.' -f 1` echo "" echo " $basefilename" echo " $basefile" done echo " " for desktop_file in $new_desktop_files; do echo " $desktop_file" done echo " " for desktop_file in $directory_files; do echo "" done echo '' ) > $tmpfile chmod $my_chmod $tmpfile save_umask=`umask` umask $my_umask mkdir -p $xdg_dir eval 'cp $tmpfile $xdg_dir/$menu_file'$xdg_redirect_output umask $save_umask rm -f "$tmpfile" else # Uninstall rm -f $xdg_dir/$menu_file fi # Uninstall .directory files only if no longer referenced if [ $action = "uninstall" ] ; then test "${TMPDIR+set}" = set || TMPDIR=/tmp tmpfile=`mktemp $TMPDIR/tmp.XXXXXXXXXX` for menu_file in $xdg_dir/*; do if grep 'generated and managed by @NAME@' "$menu_file" > /dev/null 2> /dev/null; then awk ' # List all files within tags BEGIN { RS="<" } /^Directory/ { if (match($0,/>/)) { print substr($0,RSTART+1) } }' "$menu_file" >> $tmpfile fi done orig_directory_files="$directory_files" directory_files= for desktop_file in $orig_directory_files; do if ! grep '^'$desktop_file'$' $tmpfile > /dev/null 2> /dev/null; then # No longer in use, safe to delete directory_files="$directory_files $desktop_file" fi done rm -f "$tmpfile" fi } [ x"$1" != x"" ] || exit_failure_syntax mode= action= update=yes desktop_files= directory_files= case $1 in install) action=install ;; uninstall) action=uninstall ;; forceupdate) action=forceupdate ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift vendor=true while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --noupdate) update=no ;; --mode) if [ -z "$1" ] ; then exit_failure_syntax "mode argument missing for --mode" fi case "$1" in user) mode="user" ;; system) mode="system" ;; *) exit_failure_syntax "unknown mode '$1'" ;; esac shift ;; --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ "$action" = "install" ] ; then check_input_file "$parm" fi case "$parm" in *.directory) if [ -n "$desktop_files" ] ; then exit_failure_syntax "'$parm' must preceed any *.desktop file" fi directory_files="$directory_files $parm" ;; *.desktop) desktop_files="$desktop_files $parm" ;; *) exit_failure_syntax "file to $action must be a *.directory or *.desktop file" ;; esac ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then mode="system" elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then mode="user" fi fi if [ -z "$mode" ] ; then if [ `whoami` = "root" ] ; then mode="system" else mode="user" fi fi if [ x"$action" = x"forceupdate" ] ; then update_desktop_database exit_success fi if [ -z "$desktop_files" ] ; then exit_failure_syntax "desktop-file argument missing" fi menu_name= for desktop_file in $directory_files; do if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$desktop_file" fi basefilename=`basename "$desktop_file" | cut -d '.' -f 1` if [ -z "$menu_name" ] ; then menu_name="$basefilename" else menu_name="$menu_name-$basefilename" fi done if [ -n "$menu_name" ] ; then if [ x"$mode" = x"user" ] ; then update_submenu "user-$menu_name.menu" else update_submenu "$menu_name.menu" fi else # Work around for SUSE/gnome 2.12 to pick up new ~/.local/share/applications if [ x"$mode" = x"user" ] ; then update_submenu fi fi # Install *.directory files xdg_dir_name=desktop-directories xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ xdg_global_dir= for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_dir="$x/$xdg_dir_name" break fi done DEBUG 3 "Install locations for *.directory files:" DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system menu directory found." fi fi for desktop_file in $directory_files; do basefile=`basename "$desktop_file"` DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir" case $action in install) save_umask=`umask` umask $my_umask for x in $xdg_dir $kde_dir $gnome_dir ; do mkdir -p $x eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output done umask $save_umask ;; uninstall) for x in $xdg_dir $kde_dir $gnome_dir ; do rm -f $x/$basefile done ;; esac done # Install *.desktop files xdg_dir_name=applications xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ xdg_global_dir= for x in `echo $xdg_system_dirs | sed 's/:/ /g'` ; do if [ -w $x/$xdg_dir_name ] ; then xdg_global_dir="$x/$xdg_dir_name" break fi done kde_user_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 1` kde_global_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 2` [ -w $kde_global_dir ] || kde_global_dir= gnome_user_dir="$HOME/.gnome/apps" gnome_global_dir="/usr/share/gnome/apps" [ -w $gnome_global_dir ] || gnome_global_dir= DEBUG 3 "Install locations for *.desktop files:" DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system menu directory found." fi fi for desktop_file in $desktop_files; do if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$desktop_file" fi basefile=`basename "$desktop_file"` DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir" case $action in install) save_umask=`umask` umask $my_umask for x in $xdg_dir $kde_dir $gnome_dir ; do mkdir -p $x eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output done if [ -f $kde_dir/$basefile ] ; then echo "OnlyShowIn=Old;" >> $kde_dir/$basefile fi if [ -f $gnome_dir/$basefile ] ; then echo "OnlyShowIn=Old;" >> $gnome_dir/$basefile fi make_lazy_default "$xdg_dir" "$basefile" umask $save_umask ;; uninstall) for x in $xdg_dir $kde_dir $gnome_dir ; do rm -f $x/$basefile done ;; esac done if [ x"$update" = x"yes" ] ; then update_desktop_database fi exit_success xdg-utils-1.1.2/scripts/xdg-email.in000066400000000000000000000263771310406024200173300ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-email # # Utility script to open the users favorite email program, using the # RFC 2368 mailto: URI spec # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # Copyright 2006, Jeremy White # # LICENSE: # #--------------------------------------------- manualpage() { cat << _MANUALPAGE _MANUALPAGE } usage() { cat << _USAGE _USAGE } #@xdg-utils-common@ run_thunderbird() { local THUNDERBIRD MAILTO NEWMAILTO TO CC BCC SUBJECT BODY ATTACH THUNDERBIRD="$1" MAILTO=$(echo "$2" | sed 's/^mailto://') echo "$MAILTO" | grep -qs "^?" if [ "$?" = "0" ] ; then MAILTO=$(echo "$MAILTO" | sed 's/^?//') else MAILTO=$(echo "$MAILTO" | sed 's/^/to=/' | sed 's/?/\&/') fi MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g') TO=$(/bin/echo -e $(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')) CC=$(/bin/echo -e $(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')) BCC=$(/bin/echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')) SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1) BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1) ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')) if [ -z "$TO" ] ; then NEWMAILTO= else NEWMAILTO="to='$TO'" fi if [ -n "$CC" ] ; then NEWMAILTO="${NEWMAILTO},cc='$CC'" fi if [ -n "$BCC" ] ; then NEWMAILTO="${NEWMAILTO},bcc='$BCC'" fi if [ -n "$SUBJECT" ] ; then NEWMAILTO="${NEWMAILTO},$SUBJECT" fi if [ -n "$BODY" ] ; then NEWMAILTO="${NEWMAILTO},$BODY" fi if [ -n "$ATTACH" ] ; then NEWMAILTO="${NEWMAILTO},attachment='${ATTACH}'" fi NEWMAILTO=$(echo "$NEWMAILTO" | sed 's/^,//') DEBUG 1 "Running $THUNDERBIRD -compose \"$NEWMAILTO\"" "$THUNDERBIRD" -compose "$NEWMAILTO" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_kde() { if [ -n "$KDE_SESSION_VERSION" ] && [ "$KDE_SESSION_VERSION" -ge 5 ]; then local kreadconfig=kreadconfig$KDE_SESSION_VERSION else local kreadconfig=kreadconfig fi if which $kreadconfig >/dev/null 2>&1; then local profile=$($kreadconfig --file emaildefaults \ --group Defaults --key Profile) if [ -n "$profile" ]; then local client=$($kreadconfig --file emaildefaults \ --group "PROFILE_$profile" \ --key EmailClient \ | cut -d ' ' -f 1) if echo "$client" | grep -Eq 'thunderbird|icedove'; then run_thunderbird "$client" "$1" fi fi fi local command case "$KDE_SESSION_VERSION" in '') command=kmailservice ;; 4) command=kde-open ;; *) command=kde-open$KDE_SESSION_VERSION ;; esac if which $command >/dev/null 2>&1; then DEBUG 1 "Running $command \"$1\"" if [ "$KDE_SESSION_VERSION" = 3 ]; then # KDE3 uses locale's encoding when decoding the URI, # so set it to UTF-8 LC_ALL=C.UTF-8 $command "$1" else $command "$1" fi else DEBUG 1 "$command missing; trying generic mode instead." open_generic "$1" fi if [ $? = 0 ]; then exit_success else exit_failure_operation_failed fi } open_gnome3() { local client local desktop desktop=`xdg-mime query default "x-scheme-handler/mailto"` client=`desktop_file_to_binary "$desktop"` echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi if gio help open 2>/dev/null 1>&2; then DEBUG 1 "Running gio open \"$1\"" gio open "$1" elif gvfs-open --help 2>/dev/null 1>&2; then DEBUG 1 "Running gvfs-open \"$1\"" gvfs-open "$1" else DEBUG 1 "Running gnome-open \"$1\"" gnome-open "$1" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_gnome() { local client client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || "" echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi if gio help open 2>/dev/null 1>&2; then DEBUG 1 "Running gio open \"$1\"" gio open "$1" elif gvfs-open --help 2>/dev/null 1>&2; then DEBUG 1 "Running gvfs-open \"$1\"" gvfs-open "$1" else DEBUG 1 "Running gnome-open \"$1\"" gnome-open "$1" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_xfce() { DEBUG 1 "Running exo-open \"$1\"" exo-open "$1" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_envvar() { local OLDIFS="$IFS" IFS=: for i in $MAILER; do IFS="$OLDIFS" eval "$i" '"$1"' if [ $? -eq 0 ]; then exit_success fi done exit_failure_operation_failed } open_flatpak() { gdbus call --session \ --dest org.freedesktop.portal.Desktop \ --object-path /org/freedesktop/portal/desktop \ --method org.freedesktop.portal.OpenURI.OpenURI \ "" "$1" {} if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } open_generic() { local client local desktop desktop=`xdg-mime query default "x-scheme-handler/mailto"` client=`desktop_file_to_binary "$desktop"` echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi xdg-open "$1" local ret=$? # 3 means exit_failure_operation_impossible if [ $ret != 3 ]; then exit $ret fi IFS=":" for browser in $BROWSER; do if [ x"$browser" != x"" ]; then browser_with_arg=`printf "$browser" "$1" 2>/dev/null` if [ $? -ne 0 ]; then browser_with_arg=$browser; fi if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1"; else $browser_with_arg; fi if [ $? -eq 0 ]; then exit_success; fi fi done exit_failure_operation_impossible "no method available for opening '$1'" } url_encode() { # The shell needs the default internal field separator # otherwise it would search for $utf8 as a command in whole. IFS=" " str=$(echo "$1" | $utf8) local ORIG_LANG="$LANG" local ORIG_LC_ALL="$LC_ALL" LANG=C LC_ALL=C result=$(echo "$str" | awk ' BEGIN { for ( i=1; i<=255; ++i ) ord [ sprintf ("%c", i) "" ] = i + 0 e = "" linenr = 1 } { if ( linenr++ != 1 ) { e = e "%0D%0A" } for ( i=1; i<=length ($0); ++i ) { c = substr ($0, i, 1) if ( ord [c] > 127 ) { e = e "%" sprintf("%02X", ord [c]) } else if ( c ~ /[@a-zA-Z0-9.\-\\\/]/ ) { e = e c } else { e = e "%" sprintf("%02X", ord [c]) } } } END { print e } ') LANG="$ORIG_LANG" LC_ALL="$ORIG_LC_ALL" } options= mailto= utf8="iconv -t utf8" while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --utf8) utf8="cat" ;; --to) if [ -z "$1" ] ; then exit_failure_syntax "email address argument missing for --to" fi url_encode "$1" options="${options}to=${result}&" shift ;; --cc) if [ -z "$1" ] ; then exit_failure_syntax "email address argument missing for --cc" fi url_encode "$1" options="${options}cc=${result}&" shift ;; --bcc) if [ -z "$1" ] ; then exit_failure_syntax "email address argument missing for --bcc" fi url_encode "$1" options="${options}bcc=${result}&" shift ;; --subject) if [ -z "$1" ] ; then exit_failure_syntax "text argument missing for --subject option" fi url_encode "$1" options="${options}subject=${result}&" shift ;; --body) if [ -z "$1" ] ; then exit_failure_syntax "text argument missing for --body option" fi url_encode "$1" options="${options}body=${result}&" shift ;; --attach) if [ -z "$1" ] ; then exit_failure_syntax "file argument missing for --attach option" fi check_input_file "$1" file=`readlink -f "$1"` # Normalize path if [ -z "$file" ] || [ ! -f "$file" ] ; then exit_failure_file_missing "file '$1' does not exist" fi url_encode "$file" options="${options}attach=${result}&" shift ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; mailto:*) mailto="$parm" ;; *@*) url_encode "$parm" if [ -z "${mailto}" ] ; then mailto="mailto:"${result}"?" else options="${options}to=${result}&" fi ;; *) exit_failure_syntax "unexpected argument '$parm'" ;; esac done if [ -z "${mailto}" ] ; then # TO address is optional mailto="mailto:?" fi case $mailto in *\?) mailto="${mailto}${options}" ;; *\?*) mailto="${mailto}&${options}" ;; *) mailto="${mailto}?${options}" ;; esac # Strip trailing ? and & mailto=`echo "${mailto}"| sed 's/[?&]$//'` # Shouldn't happen [ x"${mailto}" != x"" ] || exit_failure_syntax if which @NAME@-hook.sh > /dev/null 2> /dev/null; then @NAME@-hook.sh "${mailto}" if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi fi detectDE if [ x"$DE" = x"" ]; then DE=generic fi if [ x"$MAILER" != x"" ]; then DE=envvar fi # if BROWSER variable is not set, check some well known browsers instead if [ x"$BROWSER" = x"" ]; then BROWSER=www-browser:links2:elinks:links:lynx:w3m if has_display; then BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi case "$DE" in envvar) open_envvar "${mailto}" ;; kde) open_kde "${mailto}" ;; gnome) open_gnome "${mailto}" ;; gnome3|cinnamon|lxde|mate) open_gnome3 "${mailto}" ;; xfce) open_xfce "${mailto}" ;; flatpak) open_flatpak "$url" ;; generic|lxqt|enlightenment) open_generic "${mailto}" ;; *) exit_failure_operation_impossible "no method available for opening '${mailto}'" ;; esac xdg-utils-1.1.2/scripts/xdg-file-dialog.in000066400000000000000000000175231310406024200204060ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-file-dialog # # Utility script to file selection dialogs # on XDG compliant systems. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # # LICENSE: # #--------------------------------------------- manualpage() { cat << _MANUALPAGE _MANUALPAGE } usage() { cat << _USAGE _USAGE } #@xdg-utils-common@ open_kde() { DIALOG=`which kdialog` if [ $? -eq 0 ]; then if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --getopenfilename "$1" "" else $DIALOG --getopenfilename "$1" "" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } open_zenity() { DIALOG=`which zenity` if [ $? -eq 0 ]; then if [ x"$1" != x"" ]; then cd `dirname "$1"` 2>/dev/null FILENAME=`basename "$1"` if [ x"$FILENAME" != x"" ]; then FILENAME="--filename=""$FILENAME" fi fi if [ x"$FILENAME" != x"" ]; then if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --file-selection "$FILENAME" else $DIALOG --file-selection "$FILENAME" fi else if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --file-selection else $DIALOG --file-selection fi fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } open_multi_kde() { DIALOG=`which kdialog` if [ $? -eq 0 ]; then if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --multiple --separate-output \ --getopenfilename "$1" "" else $DIALOG --multiple --separate-output --getopenfilename "$1" "" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } open_multi_zenity() { DIALOG=`which zenity` if [ $? -eq 0 ]; then if [ x"$1" != x"" ]; then cd `dirname "$1"` 2>/dev/null FILENAME=`basename "$1"` if [ x"$FILENAME" != x"" ]; then FILENAME="--filename=""$FILENAME" fi fi if [ x"$FILENAME" != x"" ]; then if [ x"$TITLE" != x"" ]; then LIST=`$DIALOG --title "$TITLE" --multiple --file-selection "$FILENAME"` else LIST=`$DIALOG --multiple --file-selection "$FILENAME"` fi else if [ x"$TITLE" != x"" ]; then LIST=`$DIALOG --title "$TITLE" --multiple --file-selection` else LIST=`$DIALOG --multiple --file-selection` fi fi if [ $? -eq 0 ]; then echo "$LIST" | sed s#'|'#\\n#g exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } save_kde() { DIALOG=`which kdialog` if [ $? -eq 0 ]; then if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --getsavefilename "$1" "" else $DIALOG --getsavefilename "$1" "" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } save_zenity() { DIALOG=`which zenity` if [ $? -eq 0 ]; then if [ x"$1" != x"" ]; then cd `dirname "$1"` 2>/dev/null FILENAME=`basename "$1"` if [ x"$FILENAME" != x"" ]; then FILENAME="--filename=""$FILENAME" fi fi if [ x"$FILENAME" != x"" ]; then if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --save --file-selection "$FILENAME" else $DIALOG --save --file-selection "$FILENAME" fi else if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --save --file-selection else $DIALOG --save --file-selection fi fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } directory_kde() { DIALOG=`which kdialog` if [ $? -eq 0 ]; then if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --getexistingdirectory "$1" "" else $DIALOG --getexistingdirectory "$1" "" fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } directory_zenity() { DIALOG=`which zenity` if [ $? -eq 0 ]; then if [ x"$1" != x"" ]; then cd "$1" 2>/dev/null fi if [ x"$TITLE" != x"" ]; then $DIALOG --title "$TITLE" --directory --file-selection else $DIALOG --directory --file-selection fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi else exit_failure_operation_impossible fi } [ x"$1" != x"" ] || exit_failure_syntax TITLE= action= filename= case $1 in openfilename) action=openfilename ;; openfilenamelist) action=openfilenamelist ;; savefilename) action=savefilename ;; directory) action=directory ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift while [ $# -gt 0 ] ; do parm="$1" shift case "$parm" in --title) if [ -z "$1" ] ; then exit_failure_syntax "TITLE argument missing for --title" fi TITLE="$1" shift ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$filename" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi filename="$parm" ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi detectDE if [ "$action" = "openfilename" ]; then case "$DE" in kde) open_kde "$filename" ;; gnome*|cinnamon|lxde|mate|xfce) open_zenity "$filename" ;; *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; esac elif [ "$action" = "openfilenamelist" ]; then case "$DE" in kde) open_multi_kde "$filename" ;; gnome*|cinnamon|lxde|mate|xfce) open_multi_zenity "$filename" ;; *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; esac elif [ "$action" = "savefilename" ]; then case "$DE" in kde) save_kde "$filename" ;; gnome*|cinnamon|lxde|mate|xfce) save_zenity "$filename" ;; *) exit_failure_operation_impossible "no method available for opening a filename dialog" ;; esac elif [ "$action" = "directory" ]; then case "$DE" in kde) directory_kde "$filename" ;; gnome*|cinnamon|lxde|mate|xfce) directory_zenity "$filename" ;; *) exit_failure_operation_impossible "no method available for opening a directory dialog" ;; esac fi xdg-utils-1.1.2/scripts/xdg-icon-resource.in000066400000000000000000000275171310406024200210130ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-icon-resource # # Utility script to install icons on a Linux desktop. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # Copyright 2006, Jeremy White # # LICENSE: # #--------------------------------------------- manualpage() { cat << _MANUALPAGE _MANUALPAGE } usage() { cat << _USAGE _USAGE } #@xdg-utils-common@ # Set GTK_UPDATE_ICON_CACHE to gtk-update-icon-cache executable path or # to "-" if not found. GTK_UPDATE_ICON_CACHE= find_gtk_update_icon_cache() { [ -n "$GTK_UPDATE_ICON_CACHE" ] && return; GTK_UPDATE_ICON_CACHE="-" for x in `echo "$PATH:/opt/gnome/bin" | sed 's/:/ /g'`; do DEBUG 3 "Checking $x for gtk-update-icon-cache" if [ -x "$x/gtk-update-icon-cache" ] ; then DEBUG 1 "Found $x/gtk-update-icon-cache" GTK_UPDATE_ICON_CACHE="$x/gtk-update-icon-cache" return fi done } # Start GNOME legacy workaround section need_dot_icon_path() { # GTK < 2.6 uses ~/.icons but not XDG_DATA_HOME/icons # The availability of gtk-update-icon-cache is used as indication # of whether the system is using GTK 2.6 or later find_gtk_update_icon_cache [ "$GTK_UPDATE_ICON_CACHE" != "-" ] && return 1; return 0; } update_icon_database() { # Touch me, I'm dirty touch "$1/.@NAME@-dummy" rm -f "$1/.@NAME@-dummy" # Don't create a cache if there wan't one already if [ -f "$1/icon-theme.cache" ] ; then find_gtk_update_icon_cache if [ "$GTK_UPDATE_ICON_CACHE" != "-" ] ; then DEBUG 1 "Running $GTK_UPDATE_ICON_CACHE -f -t \"$1\"" eval '$GTK_UPDATE_ICON_CACHE -f -t "$1"'$xdg_redirect_output return fi fi } [ x"$1" != x"" ] || exit_failure_syntax mode= action= update=yes size= theme=hicolor context=apps icon_file= icon_name= case $1 in install) action=install ;; uninstall) action=uninstall ;; forceupdate) action=forceupdate ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift vendor=true while [ $# -gt 0 ] ; do parm="$1" shift case $parm in --noupdate) update=no ;; --mode) if [ -z "$1" ] ; then exit_failure_syntax "mode argument missing for --mode" fi case "$1" in user) mode="user" ;; system) mode="system" ;; *) exit_failure_syntax "unknown mode '$1'" ;; esac shift ;; --theme) if [ -z "$1" ] ; then exit_failure_syntax "theme argument missing for --theme" fi theme="$1" shift ;; --size) if [ -z "$1" ] ; then exit_failure_syntax "size argument missing for --size" fi if echo "$1" | grep '[^0-9]' > /dev/null 2> /dev/null; then exit_failure_syntax "size argument must be numeric" fi size="$1" shift ;; --context) if [ -z "$1" ] ; then exit_failure_syntax "context argument missing for --context" fi context="$1" shift ;; --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$icon_name" ] ; then exit_failure_syntax "unexpected argument '$parm'" elif [ -n "$icon_file" ] ; then icon_name="$parm" else if [ "$action" = "install" ] ; then check_input_file "$parm" fi icon_file="$parm" fi ;; esac done # Shouldn't happen if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi # Shouldn't happen if [ -z "$context" ] ; then exit_failure_syntax "context argument missing" fi if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then mode="system" elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then mode="user" fi fi if [ -z "$mode" ] ; then if [ "`whoami`" = "root" ] ; then mode="system" else mode="user" fi fi xdg_dir_name="icons/$theme" xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_user_prefix="$xdg_user_dir/icons" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_global_dir= xdg_global_prefix= xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs="/usr/local/share/:/usr/share/" for x in `echo "$xdg_system_dirs" | sed 's/:/ /g'`; do if [ -w "$x/$xdg_dir_name" ] ; then xdg_global_prefix="$x/icons" xdg_global_dir="$x/$xdg_dir_name" break fi done [ -w "$xdg_global_dir" ] || xdg_global_dir= dot_icon_dir= dot_base_dir= if [ x"$mode" = x"user" ] ; then xdg_base_dir="$xdg_user_dir" #Gnome 2.8 supports ~/.icons but not XDG_DATA_HOME if need_dot_icon_path ; then dot_icon_dir="$HOME/.icons" dot_base_dir="$dot_icon_dir/$theme" fi else xdg_base_dir="$xdg_global_dir" if [ -z "$xdg_base_dir" ] ; then exit_failure_operation_impossible "No writable system icon directory found." fi fi if [ x"$action" = x"forceupdate" ] ; then if [ -n "$icon_file" ] ; then exit_failure_syntax "unexpected argument '$icon_file'" fi update_icon_database $xdg_base_dir if [ -n "$dot_icon_dir" ] ; then if [ -d "$dot_icon_dir/" ] && [ ! -L "$dot_icon_dir" ] ; then update_icon_database "$dot_base_dir" fi fi exit_success fi if [ -z "$icon_file" ] ; then if [ x"$action" = x"install" ] ; then exit_failure_syntax "icon-file argument missing" else exit_failure_syntax "icon-name argument missing" fi fi xdg_size_name= extension= if [ -z "$size" ] ; then exit_failure_syntax "the icon size must be specified with --size" fi xdg_size_name="${size}x${size}" if [ x"$action" = x"install" ] ; then case "$icon_file" in *.xpm) extension="xpm" ;; *.png) extension="png" ;; *) exit_failure_syntax "icon file to install must be a *.png or *.xpm file" ;; esac fi if [ -n "$icon_name" ] ; then case "$icon_name" in *.png) exit_failure_syntax "icon name should not include an extension" ;; *.xpm) exit_failure_syntax "icon name should not include an extension" ;; esac fi # Start KDE legacy workaround section need_kde_icon_path() { local path path=`readlink -f "$1" 2> /dev/null` # Normalize path DEBUG 2 "need_kde_icon_path $path" if [ -z "$path" ] ; then DEBUG 2 "need_kde_icon_path RETURN 1 (not needed, no xdg icon dir)" return 1; # Not needed fi # if kde-config not found... return 0 kde_icon_dirs=`kde${KDE_SESSION_VERSION}-config --path icon 2> /dev/null |sed 's/:/ /g'` DEBUG 3 "kde_icon_dirs: $kde_icon_dirs" if [ -z "$kde_icon_dirs" ] ; then DEBUG 3 "no result from kde${KDE_SESSION_VERSION}-config --path icon" DEBUG 2 "need_kde_icon_path RETURN 1 (not needed, no kde icon path)" return 1; # Not needed fi needed=0 # Needed for y in $kde_icon_dirs ; do x=`readlink -f "$y"` # Normalize path DEBUG 3 "Normalize $y --> $x" if [ -n "$x" ] ; then if [ "$x" = "$path" ] ; then needed=1 # Not needed fi if [ -w "$x" ] ; then kde_global_prefix="$x" # Take last writable dir fi fi done DEBUG 2 "kde_global_prefix: $kde_global_prefix" [ $needed -eq 1 ] && DEBUG 2 "need_kde_icon_path RETURN $needed (not needed)" [ $needed -eq 0 ] && DEBUG 2 "need_kde_icon_path RETURN $needed (needed)" return $needed } kde_dir= if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_base_dir/$xdg_size_name/$context" #KDE 3.x doesn't support XDG_DATA_HOME for icons #Check if xdg_dir prefix is listed by kde-config --path icon #If not, install additional symlink to kdedir if need_kde_icon_path "$xdg_user_prefix" ; then kde_user_icon_dir=`kde${KDE_SESSION_VERSION}-config --path icon | cut -d ':' -f 1` kde_user_dir="$kde_user_icon_dir/$theme" kde_dir="$kde_user_dir/$xdg_size_name/$context" fi #Gnome 2.8 supports ~/.icons but not XDG_DATA_HOME if [ -n "$dot_icon_dir" ] ; then if [ -L "$dot_icon_dir" ] ; then # Don't do anything dot_icon_dir= elif [ ! -d "$dot_icon_dir/" ] ; then # Symlink if it doesn't exist eval 'ln -s ".local/share/icons" "$dot_icon_dir"'$xdg_redirect_output dot_icon_dir= else dot_icon_dir="$dot_icon_dir/$theme/$xdg_size_name/$context" fi fi my_umask=077 else xdg_dir="$xdg_base_dir/$xdg_size_name/$context" #KDE 3.x doesn't support XDG_DATA_DIRS for icons #Check if xdg_dir prefix is listed by kde-config --path icon #If not, install additional symlink to kdedir if need_kde_icon_path "$xdg_global_prefix" ; then kde_global_dir="$kde_global_prefix/$theme" kde_dir="$kde_global_dir/$xdg_size_name/$context" fi my_umask=022 fi # End KDE legacy workaround section # Start GNOME legacy workaround section need_gnome_mime= [ "$context" = "mimetypes" ] && need_gnome_mime=true # End GNOME legacy workaround section [ -n "$icon_name" ] || icon_name=`basename "$icon_file" | sed 's/\.[a-z][a-z][a-z]$//'` if [ "$vendor" = "true" -a "$action" = "install" -a "$context" = "apps" ] ; then check_vendor_prefix "$icon_name" "icon name" fi icon_icon_file=`echo "$icon_file" | sed 's/\.[a-z][a-z][a-z]$/.icon/'` icon_icon_name="$icon_name.icon" DEBUG 1 "$action icon in $xdg_dir" [ "$action" = "install" ] && [ -f "$icon_icon_file" ] && DEBUG 1 "install $icon_icon_name meta file in $xdg_dir" [ -n "$kde_dir" ] && DEBUG 1 "$action symlink in $kde_dir (KDE 3.x support)" [ -n "$need_gnome_mime" ] && DEBUG 1 "$action gnome-mime-$icon_name symlink (GNOME 2.x support)" [ "$action" = "install" -a -n "$dot_icon_dir" ] && DEBUG 1 "$action ~/.icons symlink (GNOME 2.8 support)" case "$action" in install) save_umask=`umask` umask $my_umask for icon_dir in "$xdg_dir" "$dot_icon_dir"; do [ -z "$icon_dir" ] && continue mkdir -p "$icon_dir" eval 'cp "$icon_file" "$icon_dir/$icon_name.$extension"'$xdg_redirect_output if [ -f "$icon_icon_file" ] ; then eval 'cp "$icon_icon_file" "$icon_dir/$icon_icon_name"'$xdg_redirect_output fi if [ -n "$need_gnome_mime" ] ; then eval 'ln -s "$icon_name.$extension" "$icon_dir/gnome-mime-$icon_name.$extension"'$xdg_redirect_output fi done if [ -n "$kde_dir" ] ; then mkdir -p "$kde_dir" eval 'ln -s "$xdg_dir/$icon_name.$extension" "$kde_dir/$icon_name.$extension"'$xdg_redirect_output fi umask $save_umask ;; uninstall) for icon_dir in "$xdg_dir" "$dot_icon_dir"; do [ -z "$icon_dir" ] && continue rm -f "$icon_dir/$icon_name.xpm" "$icon_dir/$icon_name.png" rm -f "$icon_dir/$icon_icon_name" if [ -n "$need_gnome_mime" ] ; then rm -f "$icon_dir/gnome-mime-$icon_name.xpm" rm -f "$icon_dir/gnome-mime-$icon_name.png" fi done if [ -n "$kde_dir" ] ; then rm -f "$kde_dir/$icon_name.xpm" "$kde_dir/$icon_name.png" fi ;; esac if [ x"$update" = x"yes" ] ; then update_icon_database "$xdg_base_dir" if [ -n "$dot_icon_dir" ] ; then if [ -d "$dot_icon_dir/" ] && [ ! -L "$dot_icon_dir" ] ; then update_icon_database "$dot_base_dir" fi fi fi exit_success xdg-utils-1.1.2/scripts/xdg-mime.in000066400000000000000000000567051310406024200171660ustar00rootroot00000000000000#!/bin/sh #--------------------------------------------- # xdg-mime # # Utility script to manipulate MIME related information # on XDG compliant systems. # # Refer to the usage() function below for usage. # # Copyright 2009-2010, Fathi Boudra # Copyright 2009-2010, Rex Dieter # Copyright 2006, Kevin Krammer # Copyright 2006, Jeremy White # # LICENSE: # #--------------------------------------------- manualpage() { cat << _MANUALPAGE _MANUALPAGE } usage() { cat << _USAGE _USAGE } #@xdg-utils-common@ update_mime_database() { if [ "$mode" = user ] && has_display; then detectDE if [ x"$DE" = x"kde" ] ; then DEBUG 1 "Running kbuildsycoca" eval 'kbuildsycoca${KDE_SESSION_VERSION}'$xdg_redirect_output fi fi for x in `echo "$PATH:/opt/gnome/bin" | sed 's/:/ /g'`; do if [ -x $x/update-mime-database ] ; then DEBUG 1 "Running $x/update-mime-database $1" eval '$x/update-mime-database $1'$xdg_redirect_output return fi done } info_kde() { if [ -n "${KDE_SESSION_VERSION}" ]; then case "${KDE_SESSION_VERSION}" in 4) DEBUG 1 "Running kmimetypefinder \"$1\"" kmimetypefinder "$1" 2>/dev/null | head -n 1 ;; 5) DEBUG 1 "Running kmimetypefinder${KDE_SESSION_VERSION} \"$1\"" kmimetypefinder${KDE_SESSION_VERSION} "$1" 2>/dev/null | head -n 1 ;; esac else DEBUG 1 "Running kfile \"$1\"" kfile "$1" 2> /dev/null | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1 fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } info_gnome() { if gio help info 2>/dev/null 1>&2; then DEBUG 1 "Running gio info \"$1\"" gio info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4 elif gvfs-info --help 2>/dev/null 1>&2; then DEBUG 1 "Running gvfs-info \"$1\"" gvfs-info "$1" 2> /dev/null | grep standard::content-type | cut -d' ' -f4 elif gnomevfs-info --help 2>/dev/null 1>&2; then DEBUG 1 "Running gnomevfs-info \"$1\"" gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } info_generic() { if mimetype --version >/dev/null 2>&1; then DEBUG 1 "Running mimetype --brief --dereference \"$1\"" mimetype --brief --dereference "$1" else DEBUG 1 "Running file --brief --dereference --mime-type \"$1\"" /usr/bin/file --brief --dereference --mime-type "$1" 2> /dev/null fi if [ $? -eq 0 ]; then exit_success else exit_failure_operation_failed fi } make_default_kde() { # $1 is vendor-name.desktop # $2 is mime/type # # On KDE 3, add to $KDE_CONFIG_PATH/profilerc: # [$2 - 1] # Application=$1 # # Remove all [$2 - *] sections, or even better, # renumber [$2 - *] sections and remove duplicate # # On KDE 4, add $2=$1 to $XDG_DATA_APPS/mimeapps.list # # Example file: # # [Added Associations] # text/plain=kde4-kate.desktop;kde4-kwrite.desktop; # # [Removed Associations] # text/plain=gnome-gedit.desktop;gnu-emacs.desktop; vendor="$1" mimetype="$2" if [ x"$KDE_SESSION_VERSION" = x"4" ]; then default_dir=`kde4-config --path xdgdata-apps 2> /dev/null | cut -d ':' -f 1` default_file="$default_dir/mimeapps.list" else default_dir=`kde-config --path config 2> /dev/null | cut -d ':' -f 1` default_file="$default_dir/profilerc" fi if [ -z "$default_dir" ]; then DEBUG 2 "make_default_kde: No kde runtime detected" return fi DEBUG 2 "make_default_kde $vendor $mimetype" DEBUG 1 "Updating $default_file" mkdir -p "$default_dir" [ -f "$default_file" ] || touch "$default_file" if [ x"$KDE_SESSION_VERSION" = x"4" ]; then [ -f "$default_file" ] || touch "$default_file" awk -v application="$vendor" -v mimetype="$mimetype" ' BEGIN { prefix=mimetype "=" associations=0 found=0 blanks=0 } { suppress=0 if (index($0, "[Added Associations]") == 1) { associations=1 } else if (index($0, "[") == 1) { if (associations && !found) { print prefix application found=1 } associations=0 } else if ($0 == "") { blanks++ suppress=1 } else if (associations && index($0, prefix) == 1) { value=substr($0, length(prefix) + 1, length) split(value, apps, ";") value=application ";" count=0 for (i in apps) { count++ } for (i=0; i < count; i++) { if (apps[i] != application && apps[i] != "") { value=value apps[i] ";" } } $0=prefix value found=1 } if (!suppress) { while (blanks > 0) { print "" blanks-- } print $0 } } END { if (!found) { if (!associations) { print "[Added Associations]" } print prefix application } while (blanks > 0) { print "" blanks-- } } ' "$default_file" > "${default_file}.new" && mv "${default_file}.new" "$default_file" eval 'kbuildsycoca4'$xdg_redirect_output else awk -v application="$vendor" -v mimetype="$mimetype" ' BEGIN { header_start="[" mimetype " - " suppress=0 } { if (index($0, header_start) == 1 ) suppress=1 else if (/^\[/) { suppress=0 } if (!suppress) { print $0 } } END { print "" print "[" mimetype " - 1]" print "Application=" application print "AllowAsDefault=true" print "GenericServiceType=Application" print "Preference=1" print "ServiceType=" mimetype } ' "$default_file" > "${default_file}.new" && mv "${default_file}.new" "$default_file" fi } make_default_generic() { # $1 is vendor-name.desktop # $2 is mime/type # Add $2=$1 to XDG_CONFIG_HOME/mimeapps.list xdg_config_home="$XDG_CONFIG_HOME" [ -n "$xdg_config_home" ] || xdg_config_home="$HOME/.config" default_file="$xdg_config_home/mimeapps.list" DEBUG 2 "make_default_generic $1 $2" DEBUG 1 "Updating $default_file" [ -f "$default_file" ] || touch "$default_file" awk -v mimetype="$2" -v application="$1" ' BEGIN { prefix=mimetype "=" indefault=0 added=0 blanks=0 found=0 } { suppress=0 if (index($0, "[Default Applications]") == 1) { indefault=1 found=1 } else if (index($0, "[") == 1) { if (!added && indefault) { print prefix application added=1 } indefault=0 } else if ($0 == "") { suppress=1 blanks++ } else if (indefault && !added && index($0, prefix) == 1) { $0=prefix application added=1 } if (!suppress) { while (blanks > 0) { print "" blanks-- } print $0 } } END { if (!added) { if (!found) { print "" print "[Default Applications]" } print prefix application } while (blanks > 0) { print "" blanks-- } } ' "$default_file" > "${default_file}.new" && mv "${default_file}.new" "$default_file" } search_desktop_file() { local MIME="$1" local dir="$2" grep -l "$MIME;" "$dir/"*.desktop 2>/dev/null for f in $dir/*/; do [ -d "$f" ] && search_desktop_file "$MIME" "$f" done } defapp_fallback() { MIME="$1" xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ preference=-1 desktop_file="" for d in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do for x in `search_desktop_file "$MIME" "$d/applications"`; do pref=0`awk -F"=" '/InitialPreference=/ {print($2)}' "$x"` DEBUG 2 " Checking $x" if [ $pref -gt $preference ]; then DEBUG 2 " Select $x [ $preference => $pref ]" preference=$pref desktop_file=$x fi done done if [ -n "$desktop_file" ] ; then echo `basename $desktop_file` exit_success fi } check_mimeapps_list() { local mimetype="$1" dir="$2" local desktop oldifs="$IFS" IFS=: for desktop in $XDG_CURRENT_DESKTOP ''; do IFS="$oldifs" if [ -n "$desktop" ]; then local prefix=$(echo "$desktop-" | tr '[:upper:]' '[:lower:]') else local prefix= fi local mimeapps_list="$dir/${prefix}mimeapps.list" if [ -f "$mimeapps_list" ] ; then DEBUG 2 "Checking $mimeapps_list" local result=$(awk -v mimetype="$mimetype" ' BEGIN { prefix=mimetype "=" indefault=0 found=0 } { if (index($0, "[Default Applications]") == 1) { indefault=1 } else if (index($0, "[") == 1) { indefault=0 } else if (!found && indefault && index($0, prefix) == 1) { print substr($0, length(prefix) +1, length) found=1 } } ' "$mimeapps_list" | cut -d ';' -f 1) if [ -n "$result" ]; then # $result could be a ; separated list of .desktop files # use the first on the system IFS=\; for app in $result; do IFS="$oldifs" exists=$(desktop_file_to_binary "$app") if [ -n "$exists" ]; then echo "$app" exit_success fi done fi fi done } defapp_generic() { MIME="$1" xdg_config_home="$XDG_CONFIG_HOME" [ -n "$xdg_config_home" ] || xdg_config_home="$HOME/.config" xdg_config_dirs="$XDG_CONFIG_DIRS" [ -n "$xdg_config_dirs" ] || xdg_config_dirs="/etc/xdg" xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ local oldifs="$IFS" dir IFS=: for dir in $xdg_config_home $xdg_config_dirs; do IFS="$oldifs" check_mimeapps_list "$MIME" "$dir" done IFS=: for dir in $xdg_user_dir $xdg_system_dirs; do IFS="$oldifs" check_mimeapps_list "$MIME" "$dir/applications" done for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do for prefix in "$XDG_MENU_PREFIX" ""; do DEBUG 2 "Checking $x/applications/${prefix}defaults.list and $x/applications/${prefix}mimeinfo.cache" trader_result=`grep "$MIME=" $x/applications/${prefix}defaults.list $x/applications/${prefix}mimeinfo.cache 2> /dev/null | head -n 1 | cut -d '=' -f 2 | cut -d ';' -f 1` if [ -n "$trader_result" ] ; then echo $trader_result exit_success fi done done defapp_fallback $MIME exit_success } defapp_kde() { MIME="$1" if [ -n "${KDE_SESSION_VERSION}" ]; then case "${KDE_SESSION_VERSION}" in 4) KTRADER=`which ktraderclient 2> /dev/null` ;; 5) KTRADER=`which ktraderclient${KDE_SESSION_VERSION} 2> /dev/null` ;; esac else KTRADER=`which ktradertest 2> /dev/null` fi if [ -n "$KTRADER" ] ; then DEBUG 1 "Running KDE trader query \"$MIME\" mimetype and \"Application\" servicetype" trader_result=`$KTRADER --mimetype "$MIME" --servicetype Application 2>/dev/null \ | grep -E "^DesktopEntryPath : |\.desktop$" | head -n1 | sed "s/^DesktopEntryPath : '\(.*\.desktop\)'\$/\1/"` if [ -n "$trader_result" ] ; then basename "$trader_result" exit_success else exit_failure_operation_failed fi else defapp_generic "$1" fi } [ x"$1" != x"" ] || exit_failure_syntax mode= action= filename= mimetype= case $1 in install) action=install ;; uninstall) action=uninstall ;; query) shift if [ -z "$1" ] ; then exit_failure_syntax "query type argument missing" fi case $1 in filetype) action=info filename="$2" if [ -z "$filename" ] ; then exit_failure_syntax "FILE argument missing" fi case $filename in -*) exit_failure_syntax "unexpected option '$filename'" ;; esac check_input_file "$filename" filename=`readlink -f -- "$filename"` ;; default) action=defapp mimetype="$2" if [ -z "$mimetype" ] ; then exit_failure_syntax "mimetype argument missing" fi case $mimetype in -*) exit_failure_syntax "unexpected option '$mimetype'" ;; */*) # Ok ;; *) exit_failure_syntax "mimetype '$mimetype' is not in the form 'minor/major'" ;; esac ;; *) exit_failure_syntax "unknown query type '$1'" ;; esac ;; default) action=makedefault shift if [ -z "$1" ] ; then exit_failure_syntax "application argument missing" fi case $1 in -*) exit_failure_syntax "unexpected option '$1'" ;; *.desktop) filename="$1" ;; *) exit_failure_syntax "malformed argument '$1', expected *.desktop" ;; esac ;; *) exit_failure_syntax "unknown command '$1'" ;; esac shift if [ "$action" = "makedefault" ]; then if [ -z "$1" ] ; then exit_failure_syntax "mimetype argument missing" fi while [ $# -gt 0 ] ; do case $1 in -*) exit_failure_syntax "unexpected option '$1'" ;; esac mimetype="$1" shift make_default_kde "$filename" "$mimetype" make_default_generic "$filename" "$mimetype" done exit_success fi if [ "$action" = "info" ]; then detectDE if [ x"$DE" = x"" ]; then if [ -x /usr/bin/file ]; then DE=generic fi fi case "$DE" in kde) info_kde "$filename" ;; gnome*|cinnamon|lxde|mate|xfce) info_gnome "$filename" ;; *) info_generic "$filename" ;; esac exit_failure_operation_impossible "no method available for quering MIME type of '$filename'" fi if [ "$action" = "defapp" ]; then detectDE case "$DE" in kde) defapp_kde "$mimetype" ;; *) defapp_generic "$mimetype" ;; esac exit_failure_operation_impossible "no method available for quering default application for '$mimetype'" fi vendor=true while [ $# -gt 0 ] ; do parm="$1" shift case $parm in --mode) if [ -z "$1" ] ; then exit_failure_syntax "mode argument missing for --mode" fi case "$1" in user) mode="user" ;; system) mode="system" ;; *) exit_failure_syntax "unknown mode '$1'" ;; esac shift ;; --novendor) vendor=false ;; -*) exit_failure_syntax "unexpected option '$parm'" ;; *) if [ -n "$filename" ] ; then exit_failure_syntax "unexpected argument '$parm'" fi filename="$parm" check_input_file "$filename" ;; esac done if [ -z "$action" ] ; then exit_failure_syntax "command argument missing" fi if [ -n "$XDG_UTILS_INSTALL_MODE" ] ; then if [ "$XDG_UTILS_INSTALL_MODE" = "system" ] ; then mode="system" elif [ "$XDG_UTILS_INSTALL_MODE" = "user" ] ; then mode="user" fi fi if [ -z "$mode" ] ; then if [ `whoami` = "root" ] ; then mode="system" else mode="user" fi fi if [ -z "$filename" ] ; then exit_failure_syntax "mimetypes-file argument missing" fi if [ "$vendor" = "true" -a "$action" = "install" ] ; then check_vendor_prefix "$filename" fi xdg_base_dir= xdg_dir_name=mime/packages/ xdg_user_dir="$XDG_DATA_HOME" [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" [ x"$mode" = x"user" ] && xdg_base_dir="$xdg_user_dir/mime" xdg_user_dir="$xdg_user_dir/$xdg_dir_name" xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ for x in `echo $xdg_system_dirs | sed 's/:/ /g'`; do if [ -w $x/$xdg_dir_name ] ; then [ x"$mode" = x"system" ] && xdg_base_dir="$x/mime" xdg_global_dir="$x/$xdg_dir_name" break fi done [ -w $xdg_global_dir ] || xdg_global_dir= DEBUG 3 "xdg_user_dir: $xdg_user_dir" DEBUG 3 "xdg_global_dir: $xdg_global_dir" # Find KDE3 mimelnk directory kde_user_dir= kde_global_dir= kde_global_dirs=`kde${KDE_SESSION_VERSION}-config --path mime 2> /dev/null` DEBUG 3 "kde_global_dirs: $kde_global_dirs" first= for x in `echo $kde_global_dirs | sed 's/:/ /g'` ; do if [ -z "$first" ] ; then first=false kde_user_dir="$x" elif [ -w $x ] ; then kde_global_dir="$x" fi done DEBUG 3 "kde_user_dir: $kde_user_dir" DEBUG 3 "kde_global_dir: $kde_global_dir" # TODO: Gnome legacy support # See http://forums.fedoraforum.org/showthread.php?t=26875 gnome_user_dir="$HOME/.gnome/apps" gnome_global_dir=/usr/share/gnome/apps [ -w $gnome_global_dir ] || gnome_global_dir= DEBUG 3 "gnome_user_dir: $gnome_user_dir" DEBUG 3 "gnome_global_dir: $gnome_global_dir" if [ x"$mode" = x"user" ] ; then xdg_dir="$xdg_user_dir" kde_dir="$kde_user_dir" gnome_dir="$gnome_user_dir" my_umask=077 else xdg_dir="$xdg_global_dir" kde_dir="$kde_global_dir" gnome_dir="$gnome_global_dir" my_umask=022 if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then exit_failure_operation_impossible "No writable system mimetype directory found." fi fi # echo "[xdg|$xdg_user_dir|$xdg_global_dir]" # echo "[kde|$kde_user_dir|$kde_global_dir]" # echo "[gnome|$gnome_user_dir|$gnome_global_dir]" # echo "[using|$xdg_dir|$kde_dir|$gnome_dir]" basefile=`basename "$filename"` #[ -z $vendor ] || basefile="$vendor-$basefile" mimetypes= if [ -n "$kde_dir" ] ; then DEBUG 2 "KDE3 mimelnk directory found, extracting mimetypes from XML file" mimetypes=`awk < "$filename" ' # Strip XML comments BEGIN { suppress=0 } { do if (suppress) { if (match($0,/-->/)) { $0=substr($0,RSTART+RLENGTH) suppress=0 } else { break } } else { if (match($0,//)) { $0=substr($0,RSTART+RLENGTH) suppress=0 } else { break } } else { if (match($0,/