Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Nov 2017, 00:20
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
Code Duplication (Puppylinux)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
s243a

Joined: 02 Sep 2014
Posts: 650

PostPosted: Sun 09 Oct 2016, 23:44    Post subject:  Code Duplication (Puppylinux)  

This thread is simply to identify duplicated code within puppylinux. It doesn't mean that the duplication isn't warranted but having identified where duplications arise might lead to code which is easier for people to get up to speed on and will result in better maintainability.
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 650

PostPosted: Mon 10 Oct 2016, 00:15    Post subject:  

There are at least two functions in puppylinux for testing network connectivity. They are:

/etc/rc.d/rc.network::testInterface()

and

/etc/sbin/net-setup.sh::tetInterface()

In the first script at the start of the function it says that, "you can't simply source net-setup.sh"

However, it is not hard to modify net-setup.sh so you can. See thread:
http://murga-linux.com/puppy/viewtopic.php?t=108463

This isn't to say that there aren't other reasons for having two separate functions. For instance rc.network is used at stat-up. Perhaps there are things like progress bars in the net-setup.sh version that would slow down start-up or perhaps the desire was to minimize the amount of functions loaded during start-up for start-up speed.

Again, I am only documenting duplication. This isn't a judgment on the code.
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Mon 10 Oct 2016, 00:17    Post subject:  

There is duplicated code in many places, i've been deleting, simplifying and merging code, this is in woofce fork, rationalise branch.

About net-setup.sh i'm also working on that.. https://github.com/puppylinux-woof-CE/woof-CE/issues/884
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 650

PostPosted: Mon 10 Oct 2016, 23:24    Post subject:  

jlst wrote:
There is duplicated code in many places, i've been deleting, simplifying and merging code, this is in woofce fork, rationalise branch.

About net-setup.sh i'm also working on that.. https://github.com/puppylinux-woof-CE/woof-CE/issues/884


I agree with you about getting rid of the simple network setup wizard but from the thread it sounds like a lot of people still use it. So perhaps we have to improve the other wizards more before getting rid of it.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 9522
Location: Charleston S.C. USA

PostPosted: Tue 11 Oct 2016, 00:50    Post subject:  

simple network setup wizard was suppose to be the next step in providing a way to setup a network connection.
The idea was to replace the network wizard with something that was easier to use.
For the most part it did provide that, but it does not always work with all hardware. It probably still needs some code tweaking.
Barry K coded it and he never coded to 100% bug free condition, but did get it working OK, for the most part.

Puppy has 3 possible network connection tools (Network Wizard, SNS, and Frisbee), because in the past, it seemed no one tool would work perfect with all hardware.
However, at least one of them would hopefully work and usually did.
Also, Network Wizard does provide more setup options, if you need to use them. Most people do not.

Frisbee was developed at a time when there was a lot of problems getting laptops wifi to work. Someone different from Barry K. developed it and it seemed to do the job when other programs failed.

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send private message 
s243a

Joined: 02 Sep 2014
Posts: 650

PostPosted: Tue 11 Oct 2016, 03:12    Post subject:  

bigpup wrote:
simple network setup wizard was suppose to be the next step in providing a way to setup a network connection.
The idea was to replace the network wizard with something that was easier to use.
For the most part it did provide that, but it does not always work with all hardware. It probably still needs some code tweaking.
Barry K coded it and he never coded to 100% bug free condition, but did get it working OK, for the most part.

Puppy has 3 possible network connection tools (Network Wizard, SNS, and Frisbee), because in the past, it seemed no one tool would work perfect with all hardware.
However, at least one of them would hopefully work and usually did.
Also, Network Wizard does provide more setup options, if you need to use them. Most people do not.

Frisbee was developed at a time when there was a lot of problems getting laptops wifi to work. Someone different from Barry K. developed it and it seemed to do the job when other programs failed.


It is my experience "Network Wizard" works in more cases than "Simple Network Wizard". Has anyone ever had a case where "Network Wizard" didn't work but "Simple Network Wizard" did?

In my opinion it is better to have a wizard with more options but I understand the desire to keep it simple for newcomers. However, "Simple Network Wizard" does not need to re-produce all of the functions of "network wizard" in order to do this. Instead it can simply provide a different user interface but use the same underlying functions as "Network Wizard".

Separating the functions which do the actual work from the user interface is a standard practice in software design. We can easily make the functions in "network wizard" available to other wizards by the procedure I noted in the following thread:
Turn net-setup.sh into a function library

P.S. It is D-Link Wifi Dongles that I have not been able to get working with "simple network wizard". Simple network wizard does not seem to have the option to load drivers for d-link wifi dongles. I have been able to get them to work though using "Network Wizard"
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Tue 11 Oct 2016, 15:22    Post subject:  

Well, what i have in mind is make net wizard as straightforward as SNS but having a more reliable code and more gui stuff, such as for static IP, extra stuff the "Modules" window... probably including a very simple version of wagprofiles, or basically something to just delete profiles, as in SNS.

And instead of Hwaddress, use only interface names, if something is wrong, just relaunch the net wizard, and click on the interface icon, there will be a new working profile afterwards
Back to top
View user's profile Send private message 
jlst

Joined: 23 Nov 2012
Posts: 571

PostPosted: Wed 12 Oct 2016, 18:26    Post subject:  

There is duplicated code in the [ initrd init + bootmanager + various system scripts ] and [ sfs_load ]

In woofce, init has been rewritten and does not handle extra sfs's. bootmanager does not have code to choose extra sfs's. sfs_load takes care of this and is now part of the base instead of being a random pkg.

However sfs_load still has tons of code that is already somewhere in the system: rc.update and scripts that deal with the rox desktop.

To solve this i have to carefully read sfs_load and the system scripts to see how they should interact to avoid code duplication... to be honest stuff should just be deleted.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0480s ][ Queries: 11 (0.0076s) ][ GZIP on ]