openbsd-ports/x11/fluxbox/patches/patch-util_fluxbox-generate_menu_in
dcoppa de1a79ce07 Update to fluxbox-1.3.3.
Tested on sparc64.
Tested by bcallah@ on amd64 and loongson.

OK bcallah@
2013-01-11 08:11:26 +00:00

37 lines
1.4 KiB
Plaintext

$OpenBSD: patch-util_fluxbox-generate_menu_in,v 1.9 2013/01/11 08:11:26 dcoppa Exp $
Adapt to our non-GNU grep
Remove bashisms
(upstream git commit dcdfdfd56b5dbb6453062ad60876647b11433f18)
Default browswer variable can be empty
(upstream git commit be2c52a146a013ebbfb708073317c337986371ff)
--- util/fluxbox-generate_menu.in.orig Mon Dec 10 18:26:53 2012
+++ util/fluxbox-generate_menu.in Thu Jan 10 12:43:23 2013
@@ -330,8 +330,8 @@ searchForIcon(){
# echo "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>"
if [ -f "$entry_icon" ]; then
# if icon exists and entry does not already exists, add it
- if ! grep -q -m 1 "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2> /dev/null; then
- echo -e "\"${entry_exec}\" \t <${entry_icon}>" >> $ICONMAPPING
+ if ! grep -q "^.${entry_exec}.[[:space:]]*<.*/${icon_base}\....>" $ICONMAPPING 2> /dev/null; then
+ printf "\"${entry_exec}\" \t <${entry_icon}>\n" >> $ICONMAPPING
else
: echo "# mapping already exists for ${entry_exec}" >> $ICONMAPPING
fi
@@ -1530,7 +1530,11 @@ else
done
fi
DEFAULT_BROWSERNAME=`echo $DEFAULT_BROWSER|awk '{print $1}'`
-DEFAULT_BROWSERNAME=`basename $DEFAULT_BROWSERNAME`
+if [ "x$DEFAULT_BROWSERNAME" != "x" ]; then
+ DEFAULT_BROWSERNAME=`basename $DEFAULT_BROWSERNAME`
+else
+ DEFAULT_BROWSERNAME="firefox"
+fi
if [ -z "$LAUNCHER" ]; then
LAUNCHER=@pkgprefix@fbrun@pkgsuffix@@EXEEXT@