david.l.cantr...@gmail.com wrote: > Stuart Henderson <s...@spacehopper.org> wrote: > > > On 2011/02/24 14:37, david.l.cantr...@gmail.com wrote: > > > Attached are updated and new patches for the sysutils/conky port. The > > > patches enable the ${apm_adapter}, ${apm_battery_life}, and > > > ${apm_battery_time} variables in conky on amd64. There is also a patch to > > > the man page explaining these variables are also available on OpenBSD. > > > > > > I made these patches on the conky port from the OPENBSD_4_8 branch. I am > > > not sure if current has an updated conky port, but I do know that at least > > > the latest stable upstream conky release does not have these patches. > > > I've submitted these fixes to the upstream maintainers. > > > > it's likely that every single port in the tree has changed > > between OPENBSD_4_8 and OPENBSD_4_9, conky certainly has. > > Sure. I'm unclear as to whether the previous release branches still take > on patches after a new stable release is made. I only have a single > usable OpenBSD system right now, and that's running 4.8. I figured the > patches would be useful in at least a "hey, has anyone seen if this still > affects 4.9?" capacity. > > I did check the upstream code and 1.8.2 (OPENBSD_4_8 is using 1.7.2) still > has the same OpenBSD support, so I don't think anyone upstream has touched > it. So my thought there was that even if ports for OPENBSD_4_9 has > updated to a more recent version of conky, I think the problem is still > there. > > > > dev = obsd_sensors.device; // FIXME: read more than one device > > > > > > - /* for (dev = 0; dev < MAXSENSORDEVICES; dev++) { */ > > > + for (dev = 0; dev < MAXSENSORDEVICES; dev++) { > > > mib[2] = dev; > > > if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) { > > > - if (errno != ENOENT) { > > > - warn("sysctl"); > > > - } > > > - return; > > > - // continue; > > > + if (errno == ENOENT) /* end of sensors */ > > > + return; > > > + if (errno == ENXIO) /* missing e.g. usb sensor that was > > > unplugged */ > > > + continue; > > > } > > > for (type = 0; type < SENSOR_MAX_TYPES; type++) { > > > mib[3] = type; > > > @@ -496,7 +495,8 @@ void update_obsd_sensors() > > > sensor_cnt++; > > > } > > > } > > > - /* } */ > > > + break; // FIXME: read more than one device > > > + } > > > > did you check that multiple devices work properly? istr having > > problems with this when i converted it to the new sensors api. > > No, I did not. The first two hunks of patch-src_openbsd_c were already > there, my additions were the architecture checks in hunks 3, 4, and 5. > > > > -#if defined(__i386) || defined(__x86_64) > > > +#if defined(__i386) || defined(__amd64) > > > > no need for this, __x86_64 is already defined. > > > > $ arch -s > > amd64 > > > > $ cpp -dM /dev/null | grep x86 > > #define __x86_64 1 > > #define __x86_64__ 1 > > Fair enough. I was unsure if this was a style preference or not. I > decided to go with 'amd64' as that's the arch name and I'd seen a least > several other places where the __amd64 macros are used rather than > __x86_64. > > > > + || defined(__OpenBSD__)) \ > > > + && (defined(i386) || defined(__i386__) || > > > defined(__amd64__)) > > > > is it necessary to restrict arch like this? there are others > > which use apm (probably at least zaurus, macppc, longsoon). > > Probably not. It may be better to invert the architecture check because > the list of non-applicable arches may be shorter. Upstream had it > restricted to i386 already, I just added amd64.
OK, some updates. I've checked HEAD and sysutils/conky is still using conky-1.7.2. Looks unchanged from OPENBSD_4_8. Upstream latest release is 1.8.1, not 1.8.2. I've restructed my patchset and applied them to the upstream repo (as well as some other patches to make 1.8.x build on OpenBSD). I added a new test for APM support on OpenBSD. I check for the existence of <machine/apmvar.h> and if so, enable the APM support in the code. Better than a long arch list in the ifdefs. I've submitted my patchset upstream here: http://sourceforge.net/tracker/?func=detail&aid=3195517&group_id=143975&atid=757310 If the port is updated to 1.8.1, these patches should make things work correctly. Lastly, the master branch for conky is now completely different from the 1.8.x series. They've rewritten it in C++ and restructed a lot of the code and how things work, so my patches will not directly apply to master. That's next on the to do list, but I figured I'd post these now with the hopes that we can get the OpenBSD port updated and working on OpenBSD systems. Thanks, -- David Cantrell <david.l.cantr...@gmail.com> KB1PCX | http://blog.burdell.org/