[csw-devel] SF.net SVN: gar:[16552] csw/mgar/pkg/gtk2/branches/2.24-raos/files
guengel at users.sourceforge.net
guengel at users.sourceforge.net
Sat Dec 17 17:48:31 CET 2011
Revision: 16552
http://gar.svn.sourceforge.net/gar/?rev=16552&view=rev
Author: guengel
Date: 2011-12-17 16:48:30 +0000 (Sat, 17 Dec 2011)
Log Message:
-----------
gtk2/branches/2.24-raos: Improved postinstall.
Modified Paths:
--------------
csw/mgar/pkg/gtk2/branches/2.24-raos/files/CSWgtk2.postinstall
Added Paths:
-----------
csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
Removed Paths:
-------------
csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
Deleted: csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch 2011-12-17 16:07:25 UTC (rev 16551)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch 2011-12-17 16:48:30 UTC (rev 16552)
@@ -1,82 +0,0 @@
-From c6d567e18c04b779d3d7b587b903c2cbf4d392e5 Mon Sep 17 00:00:00 2001
-From: Rafael Ostertag <rafisol at opencsw.org>
-Date: Sat, 17 Dec 2011 10:12:38 +0100
-Subject: [PATCH] Add --update-modules cmd line option
-
----
- gtk/queryimmodules.c | 42 +++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 41 insertions(+), 1 deletions(-)
-
-diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
-index 5369c7f..8287790 100644
---- a/gtk/queryimmodules.c
-+++ b/gtk/queryimmodules.c
-@@ -23,6 +23,7 @@
-
- #include <glib.h>
- #include <glib/gprintf.h>
-+#include <glib/gstdio.h>
- #include <gmodule.h>
-
- #include <errno.h>
-@@ -30,6 +31,8 @@
- #ifdef HAVE_UNISTD_H
- #include <unistd.h>
- #endif
-+#include <fcntl.h>
-+#include <stdlib.h>
-
- #ifdef USE_LA_MODULES
- #define SOEXT ".la"
-@@ -164,10 +167,47 @@ query_module (const char *dir, const char *name)
- int main (int argc, char **argv)
- {
- char *cwd;
-- int i;
-+ int i, fd, retval;
- char *path;
-+ char *gtk_immodules;
- gboolean error = FALSE;
-
-+ /*
-+ * Quick an dirty hack.
-+ *
-+ * This will allow us to create the gtk.immodules in the default
-+ * place by providing `--update-modules' as cmd line argument,
-+ * without worrying where this might be when calling
-+ * gtk-query-immodules-2.0 from a postinstall script.
-+ *
-+ * The basic idea is to redirect STDOUT to the default file and then
-+ * let the normal flow of the program continue like there was no cmd
-+ * line argument. Be aware, that this only works when no other cmd
-+ * line options were passed.
-+ */
-+ if ( argc == 2 && strcmp("--update-modules", argv[1]) == 0 )
-+ {
-+ gtk_immodules = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
-+ fd = g_open(gtk_immodules, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-+ if ( fd == -1 )
-+ {
-+ g_fprintf(stderr, "Cannot open %s.\n", gtk_immodules);
-+ exit(1);
-+ }
-+
-+ if ( dup2(fd, STDOUT_FILENO) == -1 )
-+ {
-+ g_fprintf(stderr, "Unable to redirect STDOUT.\n");
-+ exit(1);
-+ }
-+
-+ /*
-+ * cheat, to make it think there are no arguments given
-+ */
-+ argc = 1;
-+ }
-+
-+
- g_printf ("# GTK+ Input Method Modules file\n"
- "# Automatically generated file, do not edit\n"
- "# Created by %s from gtk+-%d.%d.%d\n"
---
-1.7.6.1
-
Added: csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch (rev 0)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/files/0000-Add-update-modules-cmd-line-option.patch 2011-12-17 16:48:30 UTC (rev 16552)
@@ -0,0 +1,96 @@
+From 1ae7e710bce003ff900de41947f8ae5e57fc6409 Mon Sep 17 00:00:00 2001
+From: Rafael Ostertag <rafisol at opencsw.org>
+Date: Sat, 17 Dec 2011 16:54:29 +0100
+Subject: [PATCH] Add --update-modules cmd line option
+
+---
+ gtk/queryimmodules.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 49 insertions(+), 4 deletions(-)
+
+diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c
+index 5369c7f..223e8ee 100644
+--- a/gtk/queryimmodules.c
++++ b/gtk/queryimmodules.c
+@@ -23,6 +23,7 @@
+
+ #include <glib.h>
+ #include <glib/gprintf.h>
++#include <glib/gstdio.h>
+ #include <gmodule.h>
+
+ #include <errno.h>
+@@ -30,6 +31,8 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#include <fcntl.h>
++#include <stdlib.h>
+
+ #ifdef USE_LA_MODULES
+ #define SOEXT ".la"
+@@ -164,16 +167,58 @@ query_module (const char *dir, const char *name)
+ int main (int argc, char **argv)
+ {
+ char *cwd;
+- int i;
++ int i, fd, retval;
+ char *path;
++ char *gtk_immodules;
+ gboolean error = FALSE;
+
++ /*
++ * Quick an dirty hack.
++ *
++ * This will allow us to create the gtk.immodules in the default
++ * place by providing `--update-modules' as cmd line argument,
++ * without worrying where this might be when calling
++ * gtk-query-immodules-2.0 from a postinstall script.
++ *
++ * The basic idea is to redirect STDOUT to the default file and then
++ * let the normal flow of the program continue like there was no cmd
++ * line argument. Be aware, that this only works when no other cmd
++ * line options were passed.
++ */
++ if ( argc == 2 && strcmp("--update-modules", argv[1]) == 0 )
++ {
++ gtk_immodules = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
++ fd = g_open(gtk_immodules, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++ if ( fd == -1 )
++ {
++ g_fprintf(stderr, "Cannot open %s.\n", gtk_immodules);
++ exit(1);
++ }
++
++ if ( dup2(fd, STDOUT_FILENO) == -1 )
++ {
++ g_fprintf(stderr, "Unable to redirect STDOUT.\n");
++ exit(1);
++ }
++
++ /*
++ * cheat, to make it think there are no arguments given
++ */
++ argc = 1;
++ }
++
++
+ g_printf ("# GTK+ Input Method Modules file\n"
+ "# Automatically generated file, do not edit\n"
+- "# Created by %s from gtk+-%d.%d.%d\n"
+- "#\n",
++ "# Created by %s from gtk+-%d.%d.%d (OpenCSW Patch)\n"
++ "#\n"
++ "#\n"
++ "# DefaultFile = %s\n"
++ "# DefaultDir = %s\n",
+ argv[0],
+- GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
++ GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION,
++ g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL),
++ g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", NULL));
+
+
+ if (argc == 1) /* No arguments given */
+--
+1.7.6.1
+
Modified: csw/mgar/pkg/gtk2/branches/2.24-raos/files/CSWgtk2.postinstall
===================================================================
--- csw/mgar/pkg/gtk2/branches/2.24-raos/files/CSWgtk2.postinstall 2011-12-17 16:07:25 UTC (rev 16551)
+++ csw/mgar/pkg/gtk2/branches/2.24-raos/files/CSWgtk2.postinstall 2011-12-17 16:48:30 UTC (rev 16552)
@@ -4,19 +4,35 @@
BIN=gtk-update-icon-cache
+if [ "${PKG_ROOT_DIR}" = "" ]
+then
+ PKG_ROOT_DIR=/
+fi
+if [ -z "${PKGINST}" ]
+then
+ PKGINST=CSWgtk2
+fi
+
echo "** Updating Icon cache"
-for i in @datadir@/icons/*
+for i in ${PKG_ROOT_DIR}@datadir@/icons/*
do
if [ -d "${i}" ]
then
/usr/bin/printf "- ${i}... "
- @bindir@/${BIN} ${i} >/dev/null 2>&1
+ /usr/sbin/chroot "${PKG_ROOT_DIR}" @bindir@/${BIN} ${i} >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Error"
else
+ # Directories with no icons in them do not raise an error,
+ # so we have to check whether the file has been actually
+ # created.
+ if [ -f "${i}/icon-theme.cache" ]
+ then
+ /usr/sbin/chroot "${PKG_ROOT_DIR}" /usr/sbin/installf ${PKGINST} ${i}/icon-theme.cache f 0644 root bin
+ fi
echo "OK"
fi
fi
@@ -29,31 +45,36 @@
echo "** Querying IM Modules"
-# But first, do the obvious
-/usr/bin/printf "- Default ISA... "
- at prefix@/bin/${BIN} ${BIN_OPTS} >/dev/null 2>&1
-if [ $? -ne 0 ]
-then
- echo "Error"
-else
- echo "OK"
-fi
-
# Now, do all other
for i in @NEEDED_ISAS@
do
- ISABIN=@prefix@/bin/$i/${BIN}
+ # The default ISA is removed
+ isa="`echo $i | /usr/bin/sed -e 's|@ISA_DEFAULT@||g'`"
+ ISABIN=@prefix@/bin/${isa}/${BIN}
if [ -x "${ISABIN}" ]
then
- /usr/bin/printf "- $i ISA... "
- "${ISABIN}" ${BIN_OPTS} >/dev/null 2>&1
+ if [ -z "${isa}" ]
+ then
+ /usr/bin/printf "- Default ISA... "
+ else
+ /usr/bin/printf "- ${isa} ISA... "
+ fi
+
+ # Figure out the default file path (binary has to be patched for this)
+ gtk_immodules="`${ISABIN} | /usr/bin/awk '/DefaultFile =/ { print $4 }`"
+
+
+ /usr/sbin/chroot "${PKG_ROOT_DIR}" "${ISABIN}" ${BIN_OPTS} >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Error"
else
+ /usr/sbin/chroot "${PKG_ROOT_DIR}" /usr/sbin/installf ${PKGINST} ${gtk_immodules} f 0644 root bin
echo "OK"
fi
fi
done
+/usr/sbin/chroot "${PKG_ROOT_DIR}" /usr/sbin/installf -f ${PKGINST}
+
echo "** Done querying IM Modules"
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list