equal
deleted
inserted
replaced
21 List("CFLAGS" -> CFLAGS, "LIBS" -> LIBS).filter(p => p._2.nonEmpty) |
21 List("CFLAGS" -> CFLAGS, "LIBS" -> LIBS).filter(p => p._2.nonEmpty) |
22 |
22 |
23 def print: Option[String] = |
23 def print: Option[String] = |
24 if (changed.isEmpty) None |
24 if (changed.isEmpty) None |
25 else |
25 else |
26 Some(" * " + platform + ":\n" + changed.map(p => " " + p._1 + "=" + p._2) |
26 Some(" * " + platform + ":\n" + changed.map(p => " " + Properties.Eq(p)) |
27 .mkString("\n")) |
27 .mkString("\n")) |
28 |
28 |
29 def change(path: Path): Unit = |
29 def change(path: Path): Unit = |
30 { |
30 { |
31 def change_line(line: String, entry: (String, String)): String = |
31 def change_line(line: String, entry: (String, String)): String = |
32 line.replaceAll(entry._1 + "=.*", entry._1 + "=" + entry._2) |
32 line.replaceAll(entry._1 + "=.*", Properties.Eq(entry)) |
33 File.change(path, s => |
33 File.change(path, s => |
34 split_lines(s).map(line => changed.foldLeft(line)(change_line)).mkString("\n")) |
34 split_lines(s).map(line => changed.foldLeft(line)(change_line)).mkString("\n")) |
35 } |
35 } |
36 } |
36 } |
37 |
37 |