Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 503140 - >=sys-fs/udev-210: If user has empty 80-net-name-slot.rules, do automigration
Summary: >=sys-fs/udev-210: If user has empty 80-net-name-slot.rules, do automigration
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-01 17:40 UTC by Samuli Suominen (RETIRED)
Modified: 2014-03-02 14:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Possible patch for automigration (migration.patch,1.15 KB, patch)
2014-03-01 17:40 UTC, Samuli Suominen (RETIRED)
Details | Diff
Proposed patch for doing the migration (udev-migration.patch,1.35 KB, patch)
2014-03-01 19:57 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Suominen (RETIRED) gentoo-dev 2014-03-01 17:40:06 UTC
Created attachment 371506 [details, diff]
Possible patch for automigration

I was almost ready to commit this, but I realized that the grep and wc -l combination doesn't take account if there is actual empty lines, like:

<snip>
# Line 1

# Line 3
</snip>

As in, empty, not just commented out. Also, I'm not sure of the external tool usage of `wc`, `readlink` and `grep`. There has to be bash syntax for this
stuff?

Please work on the attached patch.
Comment 1 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2014-03-01 19:57:54 UTC
Created attachment 371522 [details, diff]
Proposed patch for doing the migration

As requested by Samuli, I'm attaching a proposed patch that addresses some of his concerns here.
About the use of sed, I've picked it since it's part of system.
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2014-03-02 14:05:30 UTC
(In reply to Jorge Manuel B. S. Vicetto from comment #1)
> Created attachment 371522 [details, diff] [details, diff]
> Proposed patch for doing the migration
> 
> As requested by Samuli, I'm attaching a proposed patch that addresses some
> of his concerns here.
> About the use of sed, I've picked it since it's part of system.

15:54 <@ssuominen> jmbsvicetto: The patch has at least one bug
15:54 <@ssuominen> jmbsvicetto: You added "local net_name_slot_sym=0" so $net_name_slot_sym has a value, even if 0, it has a value
15:54 <@ssuominen> jmbsvicetto: Then it does... if [[ ${net_name_slot_sym} ]]; then
15:55 <@ssuominen> jmbsvicetto: Which will always return true, since there is always a value, 0 or 1, doesn't matter
15:55 <@ssuominen> jmbsvicetto: So, this happens: http://bpaste.net/show/4wkmqA1Akf8mODN6qpda/


Anyways, applied a fixed version of your patch to tree. Thanks.