Accepting request 121476 from GNOME:Apps

Push G:A

OBS-URL: https://build.opensuse.org/request/show/121476
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/inkscape?expand=0&rev=58
This commit is contained in:
Stephan Kulow 2012-05-22 06:15:58 +00:00 committed by Git OBS Bridge
parent 8d669b1c57
commit e9544333d0
3 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,83 @@
--- inkscape-0.48.3.1/src/main.cpp.orig 2012-04-18 20:25:28.000000000 +0200
+++ inkscape-0.48.3.1/src/main.cpp 2012-04-19 17:42:14.731534000 +0200
@@ -986,12 +986,13 @@ sp_main_gui(int argc, char const **argv)
}
/**
* Process file list
*/
-void sp_process_file_list(GSList *fl)
+int sp_process_file_list(GSList *fl)
{
+ int retVal = 0;
while (fl) {
const gchar *filename = (gchar *)fl->data;
SPDocument *doc = NULL;
try {
@@ -1011,10 +1012,11 @@ void sp_process_file_list(GSList *fl)
doc = NULL;
}
}
if (doc == NULL) {
g_warning("Specified document %s cannot be opened (does not exist or not a valid SVG file)", filename);
+ retVal++;
} else {
if (sp_vacuum_defs) {
vacuum_document(doc);
}
if (sp_vacuum_defs && !sp_export_svg) {
@@ -1060,10 +1062,11 @@ void sp_process_file_list(GSList *fl)
delete doc;
}
fl = g_slist_remove(fl, fl->data);
}
+ return retVal;
}
/**
* Run the application as an interactive shell, parsing command lines from stdin
* Returns -1 on error.
@@ -1115,19 +1118,21 @@ int sp_main_shell(char const* command_na
if ( g_shell_parse_argv(command_line, &argc, &argv, &parseError) ) {
poptContext ctx = poptGetContext(NULL, argc, const_cast<const gchar**>(argv), options, 0);
poptSetOtherOptionHelp(ctx, _("[OPTIONS...] [FILE...]\n\nAvailable options:"));
if ( ctx ) {
GSList *fl = sp_process_args(ctx);
- sp_process_file_list(fl);
+ if (sp_process_file_list(fl))
+ retval = -1;
poptFreeContext(ctx);
} else {
retval = 1; // not sure why. But this was the previous return value
}
resetCommandlineGlobals();
g_strfreev(argv);
} else {
g_warning("Cannot parse commandline: %s", useme);
+ retval = -1;
}
}
}
} // if (linedata...
} while (linedata && (retval == 0));
@@ -1160,14 +1165,15 @@ int sp_main_console(int argc, char const
}
inkscape_application_init(argv[0], false);
if (sp_shell) {
- sp_main_shell(argv[0]); // Run as interactive shell
- exit(0);
+ int retVal = sp_main_shell(argv[0]); // Run as interactive shell
+ exit((retVal < 0) ? 1 : 0);
} else {
- sp_process_file_list(fl); // Normal command line invokation
+ int retVal = sp_process_file_list(fl); // Normal command line invokation
+ if (retVal) exit(1);
}
return 0;
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 16 13:11:44 UTC 2012 - dimstar@opensuse.org
- Add inkscape-return-on-exit.patch: Return non-zero values in case
of errors. Patch has been accepted and merged by upstream.
[bnc#758275, lp#993500].
-------------------------------------------------------------------
Fri Feb 24 14:08:44 UTC 2012 - vuntz@opensuse.org

View File

@ -16,6 +16,7 @@
#
Name: inkscape
Version: 0.48.3.1
Release: 0
@ -31,6 +32,8 @@ Source2: inkscape-split-extensions-extra.sh
Patch0: inkscape-remove-datetime.patch
# PATCH-FIX-OPENSUSE inkscape-packages.patch sbrabec@suse.cz -- Suggest packages instead of compilation from source.
Patch1: inkscape-packages.patch
# PATCH-FIX-UPSTREAM inkscape-return-on-exit.patch bnc#758275 lp#993500 dimstar@opensuse.org -- Return non-zero on error.
Patch2: inkscape-return-on-exit.patch
BuildRequires: boost-devel
BuildRequires: docbook-toys
BuildRequires: fdupes
@ -150,6 +153,7 @@ Inkscape is a vector illustration program for the GNOME desktop.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
@ -206,6 +210,7 @@ rm -rf %{buildroot}
# We can't really move the localized manpages to the lang package, since they'd
# create a conflict between the lang subpackage and bundles
%files -f inkscape.lst -f %{name}.man-lang
%defattr(-,root,root)
%doc AUTHORS COPYING COPYING.LIB ChangeLog INSTALL NEWS README* TRANSLATORS