*/
static Arch s390x() { return zypp::Arch_s390x; }
-#if defined(SWIGRUBY)
+#if 0 /* defined(SWIGRUBY) */
%typemap(out) int is_builtin
"$result = $1 ? Qtrue : Qfalse;";
%rename("builtin?") builtin;
* Whether this is a builtin (or known) architecture.
*
*/
- int is_builtin() {
+ bool is_builtin() {
return ($self->isBuiltIn() ? 1 : 0);
}
#if defined(SWIGRUBY)
return ($self->compatibleWith(arch) ? 1 : 0);
}
+#if ZYPP_VERSION > 800
/*
* return the arch before noarch if it's not a multilib arch
* (e.g. x86_64,sparc64v,sparc64,ppc64,s390x).
{
return $self->baseArch();
}
+#endif
#if defined(SWIGRUBY)
%alias compare "<=>";
# Arch
#
-$:.unshift "../../../build/swig/ruby"
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__),"..","..","..","build","swig","ruby"))
require 'test/unit'
require 'zypp'
a = Arch.new("i386")
assert a
assert_equal "i386", a.to_s
- assert a.is_builtin
+ assert_equal true, a.is_builtin
# i486 is 'bigger' than i386
assert b
assert_equal "i486", b.to_s
assert b.is_builtin
- assert_equal a, b.base_arch
+ if VERSION > 800
+ assert_equal a, b.base_arch
+ end
assert a < b
assert a.compatible_with?(b)
z = Arch.new("xyzzy")
assert z
assert_equal "xyzzy", z.to_s
- assert !z.is_builtin
+ assert_equal false, z.is_builtin
# predefined archs
assert_equal Arch.new("noarch"), Arch.noarch
%module zypp
+/* set this to 0 (zero) to only create a subset of the bindings
+ * for testing
+ */
#define PRODUCTION 1
#ifdef SWIGPERL5
%}
-%nodefault ByKind;
-
+/* prevent swig from creating a type called 'Target_Type' */
#if defined(SWIGRUBY)
#define Target_Type VALUE
#endif
#define Target_Type SV *
#endif
-%rename("+") "operator+";
-%rename("<<") "operator<<";
-%rename("!=") "operator!=";
-%rename("!") "operator!";
-%rename("==") "operator==";
-
-namespace zypp {
- namespace base {
- // silence 'Nothing known about class..' warning
- class ReferenceCounted {};
- }
-}
-
-%include "std_string.i"
-%include "stl.i"
-
#ifdef SWIGRUBY
%include "ruby/std_list.i"
%include "ruby/std_set.i"
%include "perl5/perl.i"
#endif
+#define VERSION ZYPP_VERSION
+
/* These include files are already cleaned up from C++ cruft */
%include "Arch.i"
+%include "Resolvable.i"
+%include "Callbacks.i"
/* These include files are pending to be cleaned up from C++ cruft */
+#if PRODUCTION /* set 0 for testing, these files still carry the full C++ cruft */
+
+%nodefault ByKind;
+
+%rename("+") "operator+";
+%rename("<<") "operator<<";
+%rename("!=") "operator!=";
+%rename("!") "operator!";
+%rename("==") "operator==";
+
+namespace zypp {
+ namespace base {
+ // silence 'Nothing known about class..' warning
+ class ReferenceCounted {};
+ }
+}
+
+%include "std_string.i"
+%include "stl.i"
#ifdef BOOST_SMARTPTR_INCLUDE_DIR
%import <boost/smart_ptr/scoped_ptr.hpp>
%import <zypp/base/PtrTypes.h>
%import <zypp/base/Flags.h>
-#if PRODUCTION /* set 0 for testing, these files still carry the full C++ cruft */
%include "IdStringType.i"
%include "Pathname.i"
%include "ByteCount.i"
%include "ServiceInfo.i"
%include "ResTraits.i"
%include "ResStatus.i"
-%include "Resolvable.i"
%include "ResObject.i"
%include "Package.i"
%include "Patch.i"
%include "Target.i"
%include "MediaSetAccess.i"
%include "PoolItem.i"
-#endif
%include "ResPool.i"
-#if PRODUCTION
%include "ZYppCommitPolicy.i"
%include "ZYppCommitResult.i"
%include "TmpPath.i"
%include "Resolver.i"
%include "ZConfig.i"
-%include "Callbacks.i"
-#endif
%ignore zypp::ZYpp::setTextLocale;
%ignore zypp::ZYpp::getTextLocale;
%include <zypp/ZYpp.h>
%include "ZYppFactory.i"
+#endif
//
// helper