[uzbl] Add a message for new users without uzbl-defaults
Ben Boeckel
mathstuf at fedoraproject.org
Sun Oct 10 19:50:23 UTC 2010
commit 8603c3ae4cf822b445e0eacc50cb151134f08d93
Author: Ben Boeckel <MathStuf at gmail.com>
Date: Sun Oct 10 15:48:13 2010 -0400
Add a message for new users without uzbl-defaults
...se-the-global-configuration-as-a-fallback.patch | 43 ++++++++++++++++++++
...ora-specific-error-messages-on-no-configs.patch | 37 +++++++++++++++++
uzbl.spec | 4 ++
3 files changed, 84 insertions(+), 0 deletions(-)
---
diff --git a/0001-Use-the-global-configuration-as-a-fallback.patch b/0001-Use-the-global-configuration-as-a-fallback.patch
new file mode 100644
index 0000000..0e5c100
--- /dev/null
+++ b/0001-Use-the-global-configuration-as-a-fallback.patch
@@ -0,0 +1,43 @@
+From ee3e5ccc576041baeacf9ee3082d453e2fe74fb6 Mon Sep 17 00:00:00 2001
+From: Ben Boeckel <MathStuf at gmail.com>
+Date: Sat, 2 Oct 2010 16:19:18 -0400
+Subject: [PATCH] Use the global configuration as a fallback
+
+First check if there isn't a global config. If there isn't *then* we can
+fail. If there is and the copy fails, at least run with the global
+configuration.
+---
+ src/uzbl-browser | 10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/uzbl-browser b/src/uzbl-browser
+index de4f7af..fabefc4 100755
+--- a/src/uzbl-browser
++++ b/src/uzbl-browser
+@@ -40,10 +40,16 @@ done
+ # if no config exists yet in the recommended location, put the default (recommended) config there
+ if [ ! -f $XDG_CONFIG_HOME/uzbl/config ]
+ then
++ if [ ! -r $PREFIX/share/uzbl/examples/config/config ]
++ then
++ echo "Error: Global config not found; please check if your distribution ships them separately"
++ exit 3
++ fi
+ if ! cp $PREFIX/share/uzbl/examples/config/config $XDG_CONFIG_HOME/uzbl/config
+ then
+ echo "Could not copy default config to $XDG_CONFIG_HOME/uzbl/config" >&2
+- exit 3
++ # Run with the global configs as a last resort
++ config="--config $PREFIX/share/uzbl/examples/config/config"
+ fi
+ fi
+
+@@ -63,4 +69,4 @@ DAEMON_PID=${DAEMON_SOCKET}.pid
+ uzbl-event-manager -va start
+ #fi
+
+-exec uzbl-core "$@" --connect-socket $DAEMON_SOCKET
++exec uzbl-core "$@" $config --connect-socket $DAEMON_SOCKET
+--
+1.7.3.1
+
diff --git a/0002-Fedora-specific-error-messages-on-no-configs.patch b/0002-Fedora-specific-error-messages-on-no-configs.patch
new file mode 100644
index 0000000..e18e57e
--- /dev/null
+++ b/0002-Fedora-specific-error-messages-on-no-configs.patch
@@ -0,0 +1,37 @@
+From 92bc0e4d7f8d3d81d75de4513a51253ac3a29cf0 Mon Sep 17 00:00:00 2001
+From: Ben Boeckel <MathStuf at gmail.com>
+Date: Sat, 2 Oct 2010 16:57:33 -0400
+Subject: [PATCH 2/2] Fedora-specific error messages on no configs
+
+---
+ src/uzbl-browser | 14 +++++++++++++-
+ 1 files changed, 13 insertions(+), 1 deletions(-)
+
+diff --git a/src/uzbl-browser b/src/uzbl-browser
+index fabefc4..a299620 100755
+--- a/src/uzbl-browser
++++ b/src/uzbl-browser
+@@ -42,7 +42,19 @@ if [ ! -f $XDG_CONFIG_HOME/uzbl/config ]
+ then
+ if [ ! -r $PREFIX/share/uzbl/examples/config/config ]
+ then
+- echo "Error: Global config not found; please check if your distribution ships them separately"
++ text="Global config not found; please install the uzbl-defaults package"
++ if [ -x zenity ]
++ then
++ zenity --error --text="$text"
++ elif [ -x kdialog ]
++ then
++ kdialog --error "$text"
++ elif [ -x Xdialog ]
++ then
++ Xdialog --msgbox "Error: $text"
++ else
++ echo "Error: $text"
++ fi
+ exit 3
+ fi
+ if ! cp $PREFIX/share/uzbl/examples/config/config $XDG_CONFIG_HOME/uzbl/config
+--
+1.7.3.1
+
diff --git a/uzbl.spec b/uzbl.spec
index 3373018..1b22cfa 100644
--- a/uzbl.spec
+++ b/uzbl.spec
@@ -21,6 +21,8 @@ Patch0: %{name}-makefile.patch
# Security bug (RHBZ#621965)
Patch1: 0001-Don-t-shell-interpret-SELECTED_URI-fixes-FS-240.patch
Patch2: 0001-Fix-crash-on-Open-Image-in-New-Window-FS-231.patch
+Patch3: 0001-Use-the-global-configuration-as-a-fallback.patch
+Patch4: 0002-Fedora-specific-error-messages-on-no-configs.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: webkitgtk-devel
@@ -101,6 +103,8 @@ Highlighting files for uzbl's configuration.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
mkdir -p icons/hicolor/32x32/apps
mv examples/data/uzbl.png icons/hicolor/32x32/apps
More information about the scm-commits
mailing list