Le mercredi 14 décembre 2011, à 14:29 +0100, Vincent Untz a écrit :
Le mercredi 14 décembre 2011, à 12:31 +0100, Guido Berhoerster a écrit :
The macro also has some other very useful functions, it allows one to replace the name, generic name, or all categories without the need add and maintain patches.
It's doable with desktop-file-install now (in my git branch, will push to master soon and a release will also come).
In desktop-file-utils from git [1], we now have desktop-file-edit. This works like desktop-file-install, except that it changes the desktop file directly, instead of installing it somewhere. =================== Usage: desktop-file-edit [OPTION...] [FILE...] Edit a desktop file. Edition options for desktop file --set-key=KEY Set the KEY key to VALUE passed to next --set-value option --set-value=VALUE Set the KEY key from previous --set-key option to VALUE --set-name=NAME Set the "Name" key to NAME --copy-generic-name-to-name Copy the value of the "GenericName" key to the "Name" key --set-generic-name=GENERIC-NAME Set the "GenericName" key to GENERIC-NAME --copy-name-to-generic-name Copy the value of the "Name" key to the "GenericName" key --set-comment=COMMENT Set the "Comment" key to COMMENT --set-icon=ICON Set the "Icon" key to ICON --add-category=CATEGORY Add CATEGORY to the list of categories --remove-category=CATEGORY Remove CATEGORY from the list of categories --add-mime-type=MIME-TYPE Add MIME-TYPE to the list of MIME types --remove-mime-type=MIME-TYPE Remove MIME-TYPE from the list of MIME types --add-only-show-in=ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should be displayed --remove-only-show-in=ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should be displayed --add-not-show-in=ENVIRONMENT Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed --remove-not-show-in=ENVIRONMENT Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed --remove-key=KEY Remove the KEY key from the desktop files, if present =================== Here's how to replace %suse_update_desktop_file options with it: %suse_update_desktop_file -N <string> => desktop-file-edit --set-name <string> %suse_update_desktop_file -C <string> => desktop-file-edit --set-comment <string> %suse_update_desktop_file -G <string> => desktop-file-edit --set-generic-name <string> %suse_update_desktop_file <category> => desktop-file-edit --add-category=<category> %suse_update_desktop_file -r => desktop-file-edit --remove-key Categories %suse_update_desktop_file -u => desktop-file-edit --set-key NoDisplay --set-value true %suse_update_desktop_file -D <string> => desktop-file-edit --set-key DocPath --set-value <string> %suse_update_desktop_file -d <string> => desktop-file-edit --set-key X-SuSE-DocTeamID --set-value <string> %suse_update_desktop_file -i => desktop-file-install --dir %{buildroot}%{_datadir}/applications Of course, you can combine all the options. I don't believe that -u and -D options are used often enough to be worth a specific desktop-file-edit option. If there are people caring deeply about --create, I can add such an option too. Is there anything else missing people would like to see before I do a release? Cheers, Vincent [1] http://cgit.freedesktop.org/xdg/desktop-file-utils/ -- Les gens heureux ne sont pas pressés. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org