[ewg] RFC: OFED-1.3-20070823-1130 - first build

Yosef Etigin yosefe at voltaire.com
Mon Aug 27 10:47:46 PDT 2007


Hi Vlad,

I have some comments regarding install.pl.
Overall, I think it's too long for a perl script.

1. The first ~1K lines are a database of the existing packages.
   It has some unneccesary initiallizations:
     selected => 0, installed => 0, rpm_exist => 0, rpm_exist32 => 0
    In my opinion, this database could exist an an external XML file,
   rather easy to parse that with perl.

2. How about doing "a ? b : c" instead of "if (a) { b } else { c }" ? 

3. There are some copy-and-paste blocks.. for example, in select_packages():

instead of:
	if ($package eq "mvapich2_conf_impl") {
		$mvapich2_conf_impl = $selected;
		next;
	}
	elsif ...
write:
	if ($package =~ /^mvapich2_conf_/) {
		$$package = $selected;
		next;
	}

   same for the stuff in set_compilers()

4. Instead of print RED "...", RESET "\n"; exit 1, you could do smth like error()
   since redirecting this to files causes some mess

5. instead of iterating over arrays and checking conditions you
   could use grep, map, and such.

-- 
Yossi




More information about the ewg mailing list