Mailinglist Archive: yast-devel (121 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] r64314 - in /branches/SuSE-Code-11-SP2-Branch/autoinstallation: package/autoyast2.changes src/include/io.ycp
  • From: Lukas Ocilka <lukas.ocilka@xxxxxxx>
  • Date: Mon, 13 Jun 2011 09:37:27 +0200
  • Message-id: <4DF5BE37.4010200@suse.cz>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dne 10.6.2011 15:22, ug@xxxxxxxxxxxxxxxxx napsal(a):
Author: ug
Date: Fri Jun 10 15:22:36 2011
New Revision: 64315

Modified:

branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
branches/SuSE-Code-11-SP2-Branch/autoinstallation/src/include/io.ycp

Modified:
branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes?rev=64315&r1=64314&r2=64315&view=diff
==============================================================================
---
branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
(original)
+++
branches/SuSE-Code-11-SP2-Branch/autoinstallation/package/autoyast2.changes
Fri Jun 10 15:22:36 2011
@@ -1,10 +1,4 @@
-------------------------------------------------------------------
-Fri Jun 10 15:06:40 CEST 2011 - ug@xxxxxxx
-
-- merged the code for autoyast=device and autoyast=usb to reduce
- redundancy and fix the "already mounted" bug for USB (bnc#565558)
-
--------------------------------------------------------------------

Just an idea, while you are refactoring... wouldn't it be better to move
a particular schema-related code to functions instead of having it in
one big function (287 lines long)?

if ( Scheme == "http" || Scheme == "https" )
{
return GetHTTP(...);
}
else if ( Scheme == "ftp" )
{
return GetFTP(...);
}
else if (Scheme == "file")
{
return GetFile(...);
}
else if ...

This was almost the first thing I had to do with the code in YaST Backup
as it used looooong `if, else if` statements with even looooonger
`while` loops. That made the code uneasy to understand and debug.

I know that YCP is not an object-oriented language and that makes is
harder but it can still be done with, for instance, pointers to variables.

BTW, splitting into more functions makes it easier to test too.

Bye
Lukas



- --

Lukas Ocilka, Appliances Department, SUSE LINUX s.r.o.
MD: Jeff Hawn, Jennifer Guild, Alena Hendrichova
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/

iD8DBQFN9b43VSqMdRCqTiwRAgvlAKCEK42IoZ7YEkyg+8V6iFy4OsP/AgCdHIQp
XWQisjCpvBmCsl0vj9igrxE=
=Pw4a
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages