Changeset 2328
- Timestamp:
- 05/17/07 05:44:12 (2 years ago)
- Files:
-
- frontend/trunk/manager/ChangeLog (modified) (1 diff)
- frontend/trunk/manager/frontend-gtk/main.c (modified) (5 diffs)
- frontend/trunk/manager/po/Makefile.in.in (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
frontend/trunk/manager/ChangeLog
r2327 r2328 1 2007-05-17 Isak Savo <isak.savo@gmail.com> 2 3 * frontend-gtk/main.c (remove_clicked): Spawn autosu synchronously so that we can wait and see what it returns (we don't wanna exit if user clicks cancel for instance) 4 Check so that the g_spawn_() call succeeded and abort the exit if it failed. 5 1 6 2007-05-13 Isak Savo <isak.savo@gmail.com> 2 7 frontend/trunk/manager/frontend-gtk/main.c
r2321 r2328 35 35 #include <time.h> 36 36 #include <sys/types.h> 37 #include <sys/wait.h> 37 38 #include <libintl.h> 38 39 … … 627 628 if (!autosu) 628 629 { 630 uninstall_completed_callback(GINT_TO_POINTER(-1)); 629 631 GtkWidget *dlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, 630 632 GTK_MESSAGE_ERROR, … … 637 639 638 640 } 641 GError *err = NULL; 642 gint child_exitstatus; 639 643 gchar *argv[7]; 640 644 argv[0] = autosu; … … 645 649 argv[5] = "--rootmode"; 646 650 argv[6] = NULL; 647 g_spawn_async (NULL, argv, NULL, G_SPAWN_CHILD_INHERITS_STDIN, NULL, NULL, NULL, NULL); 648 exit(0); 651 if (!g_spawn_sync (NULL, argv, NULL, G_SPAWN_CHILD_INHERITS_STDIN, 652 NULL, NULL, NULL /* stdout */, NULL /* stderr */, &child_exitstatus, &err)) 653 { 654 uninstall_completed_callback(GINT_TO_POINTER(-2)); 655 GtkWidget *dlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, 656 GTK_MESSAGE_ERROR, 657 GTK_BUTTONS_OK, 658 "Cannot uninstall the selected package because the program used to switch " 659 "to root (autosu) could not be launched.\n\n" 660 "The error reported was: %s", err->message); 661 gtk_dialog_run(GTK_DIALOG(dlg)); 662 g_error_free(err); 663 gtk_widget_destroy(dlg); 664 return; 665 666 } 667 child_exitstatus = WEXITSTATUS(child_exitstatus); 668 TRACE ("Exitstatus of autosu: %d\n", child_exitstatus); 669 if (child_exitstatus == 0) 670 exit(0); 671 uninstall_completed_callback(GINT_TO_POINTER(-3)); 649 672 } 650 673 … … 803 826 g_free (prefix); 804 827 g_free (selfpath); 805 } 806 828 829 return 0; 830 } 831 frontend/trunk/manager/po/Makefile.in.in
r2307 r2328 26 26 srcdir = @srcdir@ 27 27 top_srcdir = @top_srcdir@ 28 top_builddir = ..28 top_builddir = @top_builddir@ 29 29 VPATH = @srcdir@ 30 30 … … 57 57 PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) 58 58 59 POFILES=$(shell if test -n "$(PO_LINGUAS)"; then LINGUAS="$(PO_LINGUAS)"; else LINGUAS="$(ALL_LINGUAS)"; fi; for lang in $$LINGUAS; do printf "$$lang.po "; done) 59 USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) 60 61 USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) 62 63 POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) 60 64 61 65 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES) … … 63 67 64 68 POTFILES = \ 65 # This Gets Replace for some reason66 67 CATALOGS=$(shell if test -n "$(PO_LINGUAS)"; then LINGUAS="$(PO_LINGUAS)"; else LINGUAS="$(ALL_LINGUAS)"; fi; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)69 # This comment gets stripped out 70 71 CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done) 68 72 69 73 .SUFFIXES: … … 99 103 install-data-yes: all 100 104 $(mkdir_p) $(DESTDIR)$(itlocaledir) 101 if test -n "$(PO_LINGUAS)"; then \ 102 linguas="$(PO_LINGUAS)"; \ 103 else \ 104 linguas="$(ALL_LINGUAS)"; \ 105 fi; \ 105 linguas="$(USE_LINGUAS)"; \ 106 106 for lang in $$linguas; do \ 107 107 dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ … … 137 137 138 138 uninstall: 139 if test -n "$(PO_LINGUAS)"; then \ 140 linguas="$(PO_LINGUAS)"; \ 141 else \ 142 linguas="$(ALL_LINGUAS)"; \ 143 fi; \ 139 linguas="$(USE_LINGUAS)"; \ 144 140 for lang in $$linguas; do \ 145 141 rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \ … … 148 144 149 145 check: all $(GETTEXT_PACKAGE).pot 146 rm -f missing notexist 147 srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m 148 if [ -r missing -o -r notexist ]; then \ 149 exit 1; \ 150 fi 150 151 151 152 mostlyclean: … … 180 181 $(MAKE) $(GETTEXT_PACKAGE).pot 181 182 tmpdir=`pwd`; \ 182 if test -n "$(PO_LINGUAS)"; then \ 183 linguas="$(PO_LINGUAS)"; \ 184 else \ 185 linguas="$(ALL_LINGUAS)"; \ 186 fi; \ 183 linguas="$(USE_LINGUAS)"; \ 187 184 for lang in $$linguas; do \ 188 185 echo "$$lang:"; \ … … 212 209 fi 213 210 214 stamp-it: Makefile.in.in ../config.status POTFILES.in215 cd ..\211 stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in 212 cd $(top_builddir) \ 216 213 && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \ 217 214 $(SHELL) ./config.status
