Thanks for the update.
I'm currently away from a PC so can't dig into libusb nuances. Cursorily
I
remember discussions that FreeBSD at least had a different implementation
or build of libusb, in particular for error handling (-1 or more nuanced
IIRC). Not sure which side NetBSD picked.
As for shells, historically Solaris/illumos had a system shell (at some
point also statically linked and so self-sufficient) as the efficient
standard interpreter and root recovery shell (but not too convenient, no
cruft). Since /usr could and still can be a separate partition, dataset or
an NFS mount, and /bin is nowadays a symlink to usr/bin, the system/root
shell remained separate from interactive one(s) for users - the choice of
which can vary with no impact to init scripts, service methods and other
system tooling. So yes, /sbin/sh is the correct thing :)
Jim
On Fri, Apr 1, 2022, 15:05 Greg Troxel <gdt at lexort.com> wrote:
>
> I am taking the tarball I built from rc1 and using it as if released in
> pkgsrc. The great news is that it only took me about 15 minutes to
> update the package.
>
> I am getting one error:
>
> => Checking for non-existent script interpreters in ups-nut-2.7.4.1
> ERROR: [check-interpreter.mk] The interpreter "/sbin/sh" of
>
"/tmp/work/sysutils/ups-nut/work/.destdir/usr/pkg/share/nut/solaris-init/nut"
> does not exist.
>
> And I wonder:
>
> Should the solaris-init file only be installed on Solaris?
>
> Is /sbin/sh really right? I've never heard of 1) sh in sbin or 2) a
> system without /bin/sh as POSIX requires.
>
> I've appended my diff, trimmed to remove pkgsrc stuff not of interest.
>
> - The PLIST diff is perhaps interesting, showing the files installed
> by 2.7.4.1 and not installed by 2.7.4.
>
> - It looks like drivers/hidparser.c has been rewritten so that the
> previous BIGENDIAN branch that used "long" when it should
perhaps be
> fixed-width is no longer present, and this was fixed in
> 24293b3f6d0cd157ac76f4901e0b6732068b55d4
> and thus it really is correct for me to just drop the patch.
>
> - We had a patch to change libusb_strerror to be >=0 instead of >0,
> and I am not entirely sure why or what the correct semantics are.
> Looking at libusb.h (focusing on libusb1), it seems 0 is
> LIBUSB_SUCCESS, which isn't an error. Is the idea that if you
> called libusb_strerror with 0, that was wrong and hence should be
> logged? I am not really following the mapping from enum
> libusb_error to this function. Also the name is confusing as
> strerror indicates a translation from errno to a string, and this
> function takes both and does logging.
>
> And that's it, a wicked short list, as we say in Boston.
>
> I will try to actually run it when I can schedule a maintenance window.
>
>
> Index: PLIST
> ==================================================================> RCS
file: /cvsroot/pkgsrc/sysutils/ups-nut/PLIST,v
> retrieving revision 1.28
> diff -u -p -r1.28 PLIST
> --- PLIST 13 Jul 2020 18:50:05 -0000 1.28
> +++ PLIST 1 Apr 2022 12:26:28 -0000
> @@ -6,14 +6,18 @@ bin/upsrw
> bin/upssched-cmd
> include/nut-scan.h
> include/nutclient.h
> +include/nutclientmem.h
> include/nutscan-device.h
> include/nutscan-init.h
> include/nutscan-ip.h
> +include/nutscan-serial.h
> include/parseconf.h
> include/upsclient.h
> lib/libnutclient.la
> +lib/libnutclientstub.la
> lib/libupsclient.la
> lib/pkgconfig/libnutclient.pc
> +lib/pkgconfig/libnutclientstub.pc
> lib/pkgconfig/libnutscan.pc
> lib/pkgconfig/libupsclient.pc
> libexec/nut/al175
> @@ -44,8 +48,9 @@ libexec/nut/metasys
> libexec/nut/mge-shut
> libexec/nut/mge-utalk
> libexec/nut/microdowell
> +libexec/nut/microsol-apc
> libexec/nut/nutdrv_qx
> -libexec/nut/oldmge-shut
> +libexec/nut/nutdrv_siemens-sitop
> libexec/nut/oneac
> libexec/nut/optiups
> libexec/nut/powercom
> @@ -120,7 +125,9 @@ man/man3/upscli_init.3
> man/man3/upscli_list_next.3
> man/man3/upscli_list_start.3
> man/man3/upscli_readline.3
> +man/man3/upscli_readline_timeout.3
> man/man3/upscli_sendline.3
> +man/man3/upscli_sendline_timeout.3
> man/man3/upscli_splitaddr.3
> man/man3/upscli_splitname.3
> man/man3/upscli_ssl.3
> @@ -160,9 +167,12 @@ man/man8/metasys.8
> man/man8/mge-shut.8
> man/man8/mge-utalk.8
> man/man8/microdowell.8
> +man/man8/microsol-apc.8
> +man/man8/nut-driver-enumerator.8
> man/man8/nut-recorder.8
> man/man8/nut-scanner.8
> man/man8/nutdrv_qx.8
> +man/man8/nutdrv_siemens_sitop.8
> man/man8/nutupsdrv.8
> man/man8/oneac.8
> man/man8/optiups.8
> @@ -179,6 +189,7 @@ man/man8/upscmd.8
> man/man8/upscode2.8
> man/man8/upsd.8
> man/man8/upsdrvctl.8
> +man/man8/upsdrvsvcctl.8
> man/man8/upslog.8
> man/man8/upsmon.8
> man/man8/upsrw.8
> @@ -196,6 +207,7 @@ share/doc/nut/NEWS
> share/doc/nut/README
> share/doc/nut/UPGRADING
> share/doc/nut/acknowledgements.txt
> +share/doc/nut/asciidoc.txt
> share/doc/nut/cables.txt
> share/doc/nut/cables/apc-rs500-serial.txt
> share/doc/nut/cables/apc.txt
> @@ -205,9 +217,12 @@ share/doc/nut/cables/mgeups.txt
> share/doc/nut/cables/powerware.txt
> share/doc/nut/cables/repotec.txt
> share/doc/nut/cables/sms.txt
> +share/doc/nut/ci-farm-lxc-setup.txt
> share/doc/nut/config-notes.txt
> +share/doc/nut/config-prereqs.txt
> share/doc/nut/configure.txt
> share/doc/nut/contact-closure.txt
> +share/doc/nut/daisychain.txt
> share/doc/nut/design.txt
> share/doc/nut/developer-guide.txt
> share/doc/nut/developers.txt
> @@ -230,6 +245,7 @@ share/doc/nut/security.txt
> share/doc/nut/snmp-subdrivers.txt
> share/doc/nut/snmp.txt
> share/doc/nut/sock-protocol.txt
> +share/doc/nut/solaris-usb.txt
> share/doc/nut/support.txt
> share/doc/nut/user-manual.txt
> share/examples/nut/nut.conf.sample
> @@ -240,5 +256,6 @@ share/examples/nut/upsmon.conf.sample
> share/examples/nut/upssched.conf.sample
> share/nut/cmdvartab
> share/nut/driver.list
> +share/nut/solaris-init/nut
> @pkgdir share/doc/nut/drivers
> @pkgdir etc/nut
> Index: patches/patch-drivers_hidparser.c
> ==================================================================> RCS
file: patches/patch-drivers_hidparser.c
> diff -N patches/patch-drivers_hidparser.c
> --- patches/patch-drivers_hidparser.c 10 Nov 2015 08:52:38 -0000 1.1
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,17 +0,0 @@
> -$NetBSD: patch-drivers_hidparser.c,v 1.1 2015/11/10 08:52:38 mrg Exp $
> -
> -work around horrible big-endian code that assumes "long" is 32
bits.
> -enables usb-nut-ups to work on sparc64.
> -
> -
> ---- drivers/hidparser.c.orig 2012-07-31 10:38:59.000000000 -0700
> -+++ drivers/hidparser.c 2015-11-10 00:30:11.000000000 -0800
> -@@ -163,7 +163,7 @@
> - #if WORDS_BIGENDIAN
> - {
> - int i;
> -- unsigned long valTmp = 0;
> -+ unsigned valTmp = 0;
> -
> - for (i = 0; i <
ItemSize[pParser->Item &
> SIZE_MASK]; i++) {
> - memcpy(&valTmp,
> &pParser->ReportDesc[(pParser->Pos)+i], 1);
> Index: patches/patch-drivers_libusb0.c
> ==================================================================> RCS
file: patches/patch-drivers_libusb0.c
> diff -N patches/patch-drivers_libusb0.c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-drivers_libusb0.c 1 Apr 2022 12:26:28 -0000
> @@ -0,0 +1,12 @@
> +$NetBSD$
> +
> +--- drivers/libusb0.c.orig 2022-03-27 12:59:49.000000000 +0000
> ++++ drivers/libusb0.c
> +@@ -532,6 +532,7 @@ static int libusb_open(usb_dev_handle **
> + */
> + static int libusb_strerror(const int ret, const char *desc)
> + {
> ++ /* \todo: Possibly change to >= */
> + if (ret > 0) {
> + return ret;
> + }
> Index: patches/patch-drivers_libusb1.c
> ==================================================================> RCS
file: patches/patch-drivers_libusb1.c
> diff -N patches/patch-drivers_libusb1.c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-drivers_libusb1.c 1 Apr 2022 12:26:28 -0000
> @@ -0,0 +1,12 @@
> +$NetBSD$
> +
> +--- drivers/libusb1.c.orig 2022-03-27 12:59:49.000000000 +0000
> ++++ drivers/libusb1.c
> +@@ -599,6 +599,7 @@ static int nut_libusb_open(libusb_device
> + */
> + static int nut_libusb_strerror(const int ret, const char *desc)
> + {
> ++ /* \todo: Possibly change to >= */
> + if (ret > 0) {
> + return ret;
> + }
>
>
>
> _______________________________________________
> Nut-upsdev mailing list
> Nut-upsdev at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20220401/2cd74088/attachment-0001.htm>