Bug#95079: libsmi2: Build failure on PARISC [fwd]

Hi!
Some feedback I got from someone running Debian GNU/Linux on PARISC... instead of me updating the 'local' config.{guess,sub} files I guess it would be better if Frank or Juergen could do that if they want to...
cheers, Remco.
----- Forwarded message from LaMont Jones lamont@smallone.fc.hp.com -----
Subject: Bug#95079: libsmi2: Build failure on PARISC From: LaMont Jones lamont@smallone.fc.hp.com To: submit@bugs.debian.org Date: Tue, 24 Apr 2001 00:21:38 -0600 (MDT)
Package: libsmi2 Version: 0.2.16-1 Severity: normal
The config.guess and config.sub files in the source need to be updated to the current ones (at http://subversions.gnu.org/cgi-bin/cvsweb/config).
Once this is done, the package builds.
lamont
-- System Information Debian Release: testing/unstable Kernel Version: Linux smallone 2.4.0 #36 Mon Apr 23 23:15:58 MDT 2001 parisc64 unknown
Versions of the packages libsmi2 depends on: ii libc6 2.2.1-1 GNU C Library: Shared libraries and Timezone
----- End forwarded message ----- -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Hi!
Remco> Some feedback I got from someone running Debian GNU/Linux on PARISC... Remco> instead of me updating the 'local' config.{guess,sub} files I guess it Remco> would be better if Frank or Juergen could do that if they want to...
LaMont> The config.guess and config.sub files in the source need to be LaMont> updated to the current ones (at LaMont> http://subversions.gnu.org/cgi-bin/cvsweb/config). LaMont> Once this is done, the package builds.
Thanks. I've updated these two files in the libsmi CVS repository, so that it will show up in the next release.
-frank -- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to libsmi-request@ibr.cs.tu-bs.de. !! See http://www.ibr.cs.tu-bs.de/projects/libsmi/ for more information.

Some of you may be interested in the attached Python files. These comprise an SMI access library that uses the output frpm the "smidump -python" format (which is a simple dictionary) and puts an object wrapper around it. One advantage of this method is that a third party that you might distribute these modules to are pure-Python, and don't require the third party to have libsmi (or a wrapper) installed. That could also mean a host that you might have around your company that you might want to run something on, but don't want to install libsmi on.
I have not officially "packaged" this yet, but you might get some ideas, and me feedback, from these.
Here is how to use them:
1. In a directory on your PYTHONPATH create a subdirectory called "mibs". This will become the mibs package, and the original SMI modules will have Python equivalents located here.
2. Place the __init__.py file in this directory. For you Python newbies, this defines it as a Python package.
3. Do the following:
bash$ python
import mibs mibs.make_modules("/usr/local/share/mibs") # change path
#accordingly.
^D
4. Put the pysmi_dict.py and PYSMI.py in a directory on your PYTHONPATH (a.k.a sys.path).
Now, you can access SMI module data using the objects and methods contained in the pysmi_dict module. Note that these methods are what I found useful for a project I'm doing, and don't match the "real" libsmi API.
NOTE: I just noticed that there is a small dependency in this module. It uses a class from my new SNMP package, which I have not published yet. So, in the meantime, to use this module you can create an SNMP.py file, and put it in your PYTHONPATH directory. This file should contain:
-----SNMP.py----- #!/usr/bin/python
from UserList import UserList
# XXX This object can be the interface to the pysmi module class OID(UserList): def __init__(self, oid=None): if not oid: self.data = [] elif type(oid) is ListType: self.data = oid elif isinstance(oid, UserList): self.data = oid.data else: raise ValueErorr, "OID must be initialized with OID string, list or another instance" def __repr__(self): return "%s(%s)" % (self.__class__.__name__, repr(self.data)) def __cmp__(self, other): # Until python 2.1... # self can only be greater than other if prefixes match. len_self = len(self) ; len_other = len(other) cv = cmp(len(self), len(other)) if cv < 0: # then self is shorter than other, defined as less return -1 elif cv == 0: # then self is same size as other if self.data == other.data: return 0 else: return -1 else: # then self is longer than other if self.data[:len(other.data)] == other.data: return 1 else: return -1
# subtracting one oid from another removes any common prefix # (considered to be the difference). def __sub__(self, other): if isinstance(other, UserList): l = other.data elif isinstance(other, type(self.data)): l = other else: l = list(other) for i in range(min(len(self.data), len(l))): if self.data[i] != other.data[i]: return self.__class__(self.data[i:])
------end-SNMP.py----
Comments welcome.
\|// (O O) -- --------------------oOOo~(_)~oOOo---------------------------------------- Keith Dart mailto:kdart@kdart.com http://www.kdart.com/ ---------------------------------------------------------------------------- Ever since my brain transplant I ... ============================================================================
participants (3)
-
Frank Strauss
-
Keith Dart
-
Remco van de Meent