Merge lp://staging/~beehock/ubuntu/natty/lirc/lirc-fix-695767 into lp://staging/ubuntu/natty/lirc
- Natty (11.04)
- lirc-fix-695767
- Merge into natty
Status: | Merged |
---|---|
Approved by: | Martin Pitt |
Approved revision: | 48 |
Merged at revision: | 45 |
Proposed branch: | lp://staging/~beehock/ubuntu/natty/lirc/lirc-fix-695767 |
Merge into: | lp://staging/ubuntu/natty/lirc |
Diff against target: |
28 lines (+7/-3) 2 files modified
debian/changelog (+5/-0) debian/lirc.postinst (+2/-3) |
To merge this branch: | bzr merge lp://staging/~beehock/ubuntu/natty/lirc/lirc-fix-695767 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Pitt | Approve | ||
Review via email: mp+51706@code.staging.launchpad.net |
Commit message
Description of the change
Dave Walker (davewalker) wrote : | # |
Hawk (beehock) wrote : | # |
Dave,
Thanks for the advice. It is indeed much better than what I did.
Using your proposal, I managed to merge into a single command which can also support future new directory branch in /dev/input
Martin Pitt (pitti) wrote : | # |
Thanks!
Can you please forward this to Debian? It doesn't need to go to "real" upstream, as this is only a packaging change. But it should be reported as a Debian bug with the patch, see http://
Please note that your branch changes #DEBHELPER# into the dh_installinit generated code, which should not be done. Please exclude that from forwarding (I'll do that for sponsoring).
Martin Pitt (pitti) wrote : | # |
Hang on, don't you mean to search devices in /dev/input/by-id/ only? With the current patch you'd filter those _out_, but I think that's wrong. /dev/input/eventN aren't stable, and the user doesn't know which is the right one anyway. by-id symlinks are the ones which should be used IMHO.
Hawk (beehock) wrote : | # |
On Wed, Mar 2, 2011 at 8:39 PM, Martin Pitt <email address hidden> wrote:
> Review: Needs Fixing
> Hang on, don't you mean to search devices in /dev/input/by-id/ only? With the current patch you'd filter those _out_, but I think that's wrong. /dev/input/eventN aren't stable, and the user doesn't know which is the right one anyway. by-id symlinks are the ones which should be used IMHO.
> --
> https:/
> You are the owner of lp:~beehock/ubuntu/natty/lirc/lirc-fix-695767.
>
No, I meant to fix the issue where devices in the /dev/input/by-id are
not shown. The current code included the /dev/input/eventN. Would
there be cases where devices does not appear in in by-id and by-path?
> Please note that your branch changes #DEBHELPER# into the dh_installinit generated code, which should not be done. Please exclude that from forwarding (I'll do that for sponsoring).
> --
Can you let me know what I did to change that? I only modified the
debian/changelog and lirc.postinst from my branch and follow the steps
from the sponsorship. I have no idea on it what cause the change to
#DBHLPER#
Martin Pitt (pitti) wrote : | # |
> No, I meant to fix the issue where devices in the /dev/input/by-id are
> not shown. The current code included the /dev/input/eventN.
Hm, when I install current lirc, I get a full tree of /dev/input/, including by-id, by-path, etc.
> Would there be cases where devices does not appear in in by-id and by-path?
In theory yes, if a device isn't on USB, or doesn't have a vendor/product name. This shouldn't happen with USB devices, only perhaps with some builtin stuff like lid switches, etc.
But in general I'd really avoid hardcoding /dev/input/eventX in a configuration file. It's inevitably going to break, as the enumeration is completely dynamic, and random up to some degree.
> > Please note that your branch changes #DEBHELPER# into the dh_installinit
> generated code, which should not be done. Please exclude that from forwarding
> (I'll do that for sponsoring).
> > --
>
> Can you let me know what I did to change that?
I don't know either -- building a package does not change debian/
Hawk (beehock) wrote : | # |
Isnt this the current code?
EVENTS_BY_PATH=`ls /dev/input/by-path | sed 's/^/,\
\/dev\/
23 - EVENTS=`ls /dev/input | grep -v "by-path" | sed 's/^/,\
\/dev\/input\//' | tr '\n' '\0'`
24 - db_subst lirc/dev_
Only /dev/input/by-id is down and not the actual device.
Didnt `find /dev/input/* -not -type d -printf ", %p"` cover all the
devices in /dev/input excluding the directory?
I still dont understand what I need to fix.
On Wed, Mar 2, 2011 at 10:11 PM, Martin Pitt <email address hidden> wrote:
>> No, I meant to fix the issue where devices in the /dev/input/by-id are
>> not shown. The current code included the /dev/input/eventN.
>
> Hm, when I install current lirc, I get a full tree of /dev/input/, including by-id, by-path, etc.
>
>> Would there be cases where devices does not appear in in by-id and by-path?
>
> In theory yes, if a device isn't on USB, or doesn't have a vendor/product name. This shouldn't happen with USB devices, only perhaps with some builtin stuff like lid switches, etc.
>
> But in general I'd really avoid hardcoding /dev/input/eventX in a configuration file. It's inevitably going to break, as the enumeration is completely dynamic, and random up to some degree.
>
>> > Please note that your branch changes #DEBHELPER# into the dh_installinit
>> generated code, which should not be done. Please exclude that from forwarding
>> (I'll do that for sponsoring).
>> > --
>>
>> Can you let me know what I did to change that?
>
> I don't know either -- building a package does not change debian/
> --
> https:/
> You are the owner of lp:~beehock/ubuntu/natty/lirc/lirc-fix-695767.
>
Martin Pitt (pitti) wrote : | # |
> Isnt this the current code?
>
> EVENTS_BY_PATH=`ls /dev/input/by-path | sed 's/^/,\
> \/dev\/
> 23 - EVENTS=`ls /dev/input | grep -v "by-path" | sed 's/^/,\
> \/dev\/input\//' | tr '\n' '\0'`
> 24 - db_subst lirc/dev_
>
> Only /dev/input/by-id is down and not the actual device.
Correct. Above code filters out the by-path/ devices.
> Didnt `find /dev/input/* -not -type d -printf ", %p"` cover all the
> devices in /dev/input excluding the directory?
It does. My point is that it should _only_ show by-id/ (and perhaps per-path/ too), since the user should never select something like /dev/input/event7.
I thought that was the actual point of this bug report/fix?
Martin Pitt (pitti) wrote : | # |
In other words, I think that
EVENTS=`ls /dev/input/by-id/* /dev/input/
would be quite appropriate here?
Martin Pitt (pitti) wrote : | # |
And finally you need to revert the #DEBHELPER# change in the postinst, as pointed out above.
Thanks!
Hawk (beehock) wrote : | # |
EVENTS=`find /dev/input/* -type d -exec find {} -not -type d -printf ", %p" \;`
I used this to avoid the issue of similar bug from arising. it cover
all sub-directory devices with /dev/input.
On Thu, Mar 3, 2011 at 1:04 AM, Martin Pitt <email address hidden> wrote:
> In other words, I think that
>
> EVENTS=`ls /dev/input/by-id/* /dev/input/
>
> would be quite appropriate here?
> --
> https:/
> You are the owner of lp:~beehock/ubuntu/natty/lirc/lirc-fix-695767.
>
Martin Pitt (pitti) wrote : | # |
Well, *shrug*, I still think it's a lot better to only show by-path/ and by-id/, but if you want to show all devices, so be it.
Can you then please change it to not use a double-find, but the much simpler
find /dev/input ! -type d -printf ", %p"
?
Thanks!
Hawk (beehock) wrote : | # |
Actually, the double find was meant to do what you ask of(ignore the
eventN). Another reason I use the double find was to factor in future
additional /dev/input/
find /dev/input/* -type d -exec find {} -not -type d \;
/dev/input/
/dev/input/
/dev/input/
/dev/input/
/dev/input/
/dev/input/
/dev/input/
while your latest recommendation list everything,
find /dev/input ! -type d -printf ", %p"
/dev/input/
/dev/input/
/dev/input/js0
/dev/input/event3
/dev/input/mouse0
/dev/input/event4
/dev/input/mouse1
/dev/input/
/dev/input/
/dev/input/
/dev/input/
/dev/input/
/dev/input/event2
/dev/input/event1
/dev/input/event0
/dev/input/mice
On Thu, Mar 3, 2011 at 4:40 PM, Martin Pitt <email address hidden> wrote:
> Well, *shrug*, I still think it's a lot better to only show by-path/ and by-id/, but if you want to show all devices, so be it.
>
> Can you then please change it to not use a double-find, but the much simpler
>
> find /dev/input ! -type d -printf ", %p"
>
> ?
>
> Thanks!
> --
> https:/
> You are the owner of lp:~beehock/ubuntu/natty/lirc/lirc-fix-695767.
>
Martin Pitt (pitti) wrote : | # |
Ah, of course. Sorry, I missed that.
Thanks, this looks good now! I'll merge this after the alpha-3 freeze.
ls, grep x 2, sed and tr is a little clunky..
Does something like:
find /dev/input/* -type c -prune -printf ", %p"
Make more sense?