Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 318937

Summary: sys-power/nut-2.4.3 needs upstream patch to fix problem with low-speed USB devices
Product: Gentoo Linux Reporter: Rebecca Menessec <rebecca.menessec>
Component: New packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: me
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://boxster.ghz.cc/projects/nut/changeset/2407
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: nut-2.4.3-lowspeed-buffer-size.patch

Description Rebecca Menessec 2010-05-07 23:57:50 UTC
Please see and apply upstream patch for NUT which fixes problems with some USB HID UPSes.  Works for me.

Reproducible: Always

Steps to Reproduce:
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-25 20:21:58 UTC
fixed in 2.4.3-r1
Comment 2 Martin Gysel (bearsh) 2010-05-26 05:50:23 UTC
unfortunately patch does no apply...

[ebuild     U ] sys-power/nut-2.4.3-r1 [2.4.3] USE="bash-completion hal snmp ssl usb xml -cgi" 0 kB

-- snip --

* Applying nut-2.4.3-lowspeed-buffer-size.patch ...

* Failed Patch: nut-2.4.3-lowspeed-buffer-size.patch !
*  ( /usr/portage/sys-power/nut/files/nut-2.4.3-lowspeed-buffer-size.patch )


# cat /var/tmp/portage/sys-power/nut-2.4.3-r1/temp/nut-2.4.3-lowspeed-buffer-size.patch.out
***** nut-2.4.3-lowspeed-buffer-size.patch *****

NOTE: skipping -p0 due to absolute paths in patch:
6:--- /trunk/drivers/libhid.c (revision 2336)
7:+++ /trunk/drivers/libhid.c (revision 2407)
================================================

PATCH COMMAND:  patch -p1 -g0 -E --no-backup-if-mismatch < '/usr/portage/sys-power/nut/files/nut-2.4.3-lowspeed-buffer-size.patch'

================================================
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|http://bugs.gentoo.org/show_bug.cgi?id=318937
|http://boxster.ghz.cc/projects/nut/changeset/2407
|
|Index: /trunk/drivers/libhid.c
|===================================================================
|--- /trunk/drivers/libhid.c (revision 2336)
|+++ /trunk/drivers/libhid.c (revision 2407)
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
================================================

PATCH COMMAND:  patch -p2 -g0 -E --no-backup-if-mismatch < '/usr/portage/sys-power/nut/files/nut-2.4.3-lowspeed-buffer-size.patch'

================================================
patching file drivers/libhid.c
Hunk #1 FAILED at 142.
Hunk #2 FAILED at 470.
2 out of 2 hunks FAILED -- saving rejects to file drivers/libhid.c.rej
================================================

PATCH COMMAND:  patch -p3 -g0 -E --no-backup-if-mismatch < '/usr/portage/sys-power/nut/files/nut-2.4.3-lowspeed-buffer-size.patch'

================================================
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|http://bugs.gentoo.org/show_bug.cgi?id=318937
|http://boxster.ghz.cc/projects/nut/changeset/2407
|
|Index: /trunk/drivers/libhid.c
|===================================================================
|--- /trunk/drivers/libhid.c (revision 2336)
|+++ /trunk/drivers/libhid.c (revision 2407)
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
================================================

PATCH COMMAND:  patch -p4 -g0 -E --no-backup-if-mismatch < '/usr/portage/sys-power/nut/files/nut-2.4.3-lowspeed-buffer-size.patch'

================================================
missing header for unified diff at line 8 of patch
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|http://bugs.gentoo.org/show_bug.cgi?id=318937
|http://boxster.ghz.cc/projects/nut/changeset/2407
|
|Index: /trunk/drivers/libhid.c
|===================================================================
|--- /trunk/drivers/libhid.c (revision 2336)
|+++ /trunk/drivers/libhid.c (revision 2407)
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-26 06:18:19 UTC
m.gysel:
what version of the patch tool are you using?

>>> Preparing source in /dev/shm/portage/sys-power/nut-2.4.3-r1/work/nut-2.4.3 ...
 * Replacing obsolete head/tail with POSIX compliant ones
 *  - fixed configure.in
 * Applying nut-2.4.1-no-libdummy.patch ...                                                                                      [ ok ]
 * Applying nut-2.4.3-lowspeed-buffer-size.patch ...                                                                             [ ok ]
 * Running eautoreconf in '/dev/shm/portage/sys-power/nut-2.4.3-r1/work/nut-2.4.3' ...
 * Running aclocal -I m4 ...                                                                                                     [ ok ]
 * Running libtoolize --copy --force --install --automake ...                                                                    [ ok ]
 * Running aclocal -I m4 ...                                                                                                     [ ok ]
 * Running autoconf ...                                                                                                          [ ok ]
 * Running autoheader ...                                                                                                        [ ok ]
 * Running automake --add-missing --copy ...                                                                                     [ ok ]
 * Running elibtoolize in: nut-2.4.3
 *   Applying portage-2.2.patch ...
 *   Applying sed-1.5.6.patch ...
 *   Applying as-needed-2.2.6.patch ...
>>> Source prepared.

If you removing the leading / on "/trunk" in the patch, does it work for you?
Comment 4 Martin Gysel (bearsh) 2010-05-26 06:32:16 UTC
eix -I patch
[I] sys-devel/patch
     Available versions:  2.5.9 ~2.5.9-r1 ~2.6.1 {static test}
     Installed versions:  2.5.9(19:42:09 27.06.2007)(-build -static)

removing the leading '/' doesn't help...
Comment 5 Martin Gysel (bearsh) 2010-05-26 07:07:54 UTC
Created attachment 232957 [details]
nut-2.4.3-lowspeed-buffer-size.patch

with this patch it works fine...
Comment 6 Martin Gysel (bearsh) 2010-05-26 07:19:39 UTC
(In reply to comment #3)
> m.gysel:
> what version of the patch tool are you using?

on my ~amd64 it also works out of the box with
# eix -I patch
[I] sys-devel/patch
     Available versions:  2.5.9 (~)2.5.9-r1 (~)2.6.1 {static test}
     Installed versions:  2.6.1(04:10:51 12.03.2010)(-static -test)
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-26 09:07:32 UTC
ah, so it's hating on the p1 level directly. weird.
What was the error output when you removed the leading / from trunk? (in all 3 places).
Comment 8 Vitaly V. Bursov 2010-05-26 10:09:35 UTC
dos2unix on nut-2.4.3-lowspeed-buffer-size.patch fixed this one for me.

$ patch --version
patch 2.5.9
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-05-26 10:30:34 UTC
Vitaly:
Nice catch. Upstream system seems to like to hand out DOS linefeeds in their patches. Committed the converted version now.

m.gysel:
retest please.
Comment 10 Martin Gysel (bearsh) 2010-05-26 14:49:24 UTC
resynced and reemerged sys-power/nut (on stable server) - seems to work!
thanks