Add patch with squirrel3 support

This commit is contained in:
Andrey Bondrov 2015-12-22 02:11:49 +10:00
parent 9936b05b80
commit 8f6b88e0e1
2 changed files with 36 additions and 1 deletions

View file

@ -0,0 +1,32 @@
diff -urN rpm-5.4.10/rpmio/rpmsquirrel.c rpm-5.4.10-patched/rpmio/rpmsquirrel.c
--- rpm-5.4.10/rpmio/rpmsquirrel.c 2012-04-16 08:20:53.000000000 +1100
+++ rpm-5.4.10-patched/rpmio/rpmsquirrel.c 2015-12-22 02:04:15.011765783 +1000
@@ -72,6 +72,16 @@
(void) rpmiobAppend(squirrel->iob, b, 0);
b = _free(b);
}
+
+#if defined(SQUIRREL_VERSION_NUMBER) && SQUIRREL_VERSION_NUMBER >= 300
+static void rpmsquirrelStderr(HSQUIRRELVM v, const SQChar *s,...)
+{
+ va_list vl;
+ va_start(vl, s);
+ vfprintf(stderr, s, vl);
+ va_end(vl);
+}
+#endif
#endif
/* XXX FIXME: honor 0x8000000 in flags to use global interpreter */
@@ -103,7 +113,11 @@
squirrel->I = v;
sq_setforeignptr(v, squirrel);
+#if defined(SQUIRREL_VERSION_NUMBER) && SQUIRREL_VERSION_NUMBER >= 300
+ sq_setprintfunc(v, rpmsquirrelPrint, rpmsquirrelStderr);
+#else
sq_setprintfunc(v, rpmsquirrelPrint);
+#endif
#ifdef NOTYET
{ int i;

View file

@ -61,7 +61,7 @@ Summary: The RPM package management system
Name: rpm
Epoch: 1
Version: %{libver}.%{minorver}
Release: %{?prereldate:0.%{prereldate}.}60
Release: %{?prereldate:0.%{prereldate}.}61
License: LGPLv2.1+
Group: System/Configuration/Packaging
Url: http://rpm5.org/
@ -78,6 +78,8 @@ Source2: rpm.rpmlintrc
Source3: cpu-os-macros.tar.gz
Source4: legacy_compat.macros
Source5: RPMBDB-0.1.tar.xz
# add squirrel3 support
Patch0: rpm-5.4.10-squirrel3.patch
# TODO: make conditional & disabled through macro by default (enable for legacy compatibility)
# status: to be removed later
Patch2: rpm-5.4.9-non-pre-scripts-dont-fail.patch
@ -765,6 +767,7 @@ This package contains the RPM API documentation generated in HTML format.
%prep
%setup -q -a5
%patch111 -p1 -b .script_macros~
%patch0 -p1 -b .squirrel3~
%patch2 -p1 -b .scriptlet~
%patch3 -p1 -b .doc_conflicts~
%patch11 -p1 -b .ru~