cmd = "db/migrate/017_populate_node_tags_and_remove_helper"
src = "#{cmd}.c"
if not File.exists? cmd or File.mtime(cmd) < File.mtime(src) then
- system 'cc -O3 -Wall `mysql_config --cflags --libs` ' +
- "#{src} -o #{cmd}" or fail
+ system 'cc -O3 -Wall `mysql_config --cflags --libs` ' +
+ "#{src} -o #{cmd}" or fail
end
- conn_opts = ActiveRecord::Base.connection.
- instance_eval { @connection_options }
+ conn_opts = ActiveRecord::Base.connection.instance_eval { @connection_options }
args = conn_opts.map { |arg| arg.to_s } + [prefix]
fail "#{cmd} failed" unless system cmd, *args
- tempfiles = ['nodes', 'node_tags',
- 'current_nodes', 'current_node_tags'].
- map { |base| prefix + base }
+ tempfiles = ['nodes', 'node_tags', 'current_nodes', 'current_node_tags'].
+ map { |base| prefix + base }
nodes, node_tags, current_nodes, current_node_tags = tempfiles
end
if (*i == '\\') {
i++;
switch (tmp = *i++) {
- case 's': *o++ = ';'; break;
- case 'e': *o++ = '='; break;
- case '\\': *o++ = '\\'; break;
- default: *o++ = tmp; break;
+ case 's': *o++ = ';'; break;
+ case 'e': *o++ = '='; break;
+ case '\\': *o++ = '\\'; break;
+ default: *o++ = tmp; break;
}
} else {
*o++ = *i++;
version = ++(d->version[id]);
fprintf(out, "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%u\"\n",
- row[0], row[1], row[2], row[3], row[4], row[6], row[7], version);
+ row[0], row[1], row[2], row[3], row[4], row[6], row[7], version);
} else {
/*fprintf(out, "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"\n",
row[0], row[1], row[2], row[3], row[4], row[6], row[7]);*/
char *tags_it = row[5], *k, *v;
while (read_node_tags(&tags_it, &k, &v)) {
if (hist) {
- fprintf(out_tags, "\"%s\",\"%u\",", row[0], version);
+ fprintf(out_tags, "\"%s\",\"%u\",", row[0], version);
} else {
- fprintf(out_tags, "\"%s\",", row[0]);
+ fprintf(out_tags, "\"%s\",", row[0]);
}
write_csv_col(out_tags, k, ',');