On 6/10/2019 7:39 AM, Jean-Marc Pigeon via blfs-dev wrote:

Let me comments on this, trying not to be mean but rather constructive.
(after all, the whole LFS project purpose is to learn).

Lets be blunt and summarize your previous statement as I understand it.

"previous script incarnation are messy, I have problems with message cosmetic entries, such lets add a a variable (VIRTINT) to configuration STANDARD to help me write code).
Then in the 20190524 iteration,  ifup code become such:

# If interface ISNOT virtual then configure interface
# prepare interface
# if interface IS virtual then configure interface.

May I suggest (as it was previously)

# prepare interface
# configure interface
If I'm correctly understanding your comments above, you've misinterpreted the first if block in the original script (lending credit to my assertion of needless complexity). Please try and single step through it once for a virtual interface and take note of the unneeded call to up(). The logic you applied to the new script is ultimately exactly how the old worked as well, and this is how it needs to be. You can't set up an interface if it doesn't yet exist. The method of determining if it is a virtual interface has changed to explicitly stating so, avoiding that unnecessary call to up(), and the expensive test that also leads to unnecessary redirection and several unnecessary 'echo \n' invocations that made the downstream scripts more complex than they needed to be. I could simply end the output (accurately stating that the interface was set UP, and so I did. There is still room for improvement in that regard, I could probably kill a few of the 'echo -n' as well, and it was only reduced by a couple of empty messages anyway, but it's better than it was, and presentation is now consistent with the rest of the scripts (the original reason that I looked at it).

From above, I am unable to determine if you are still having a problem after you've set VIRTINT to yes as requested. If there is still a problem after correcting your configuration for the new script, then I do need to address that error. Additionally, if you can suggest a better way to test (preferably a test that we don't have to dump the result and do the echo \n thing again), I could reconsider the additional variable if it's really a big deal, but please understand that I view this as static data, something that does belong in the configuration rather than being tucked away in difficult to read logic.

--DJ


--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to