fix the indentation only
This commit is contained in:
parent
c253ce3399
commit
748a7a0a03
2 changed files with 12 additions and 14 deletions
|
@ -8,18 +8,16 @@ class PopulateNodeTagsAndRemove < ActiveRecord::Migration
|
|||
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
|
||||
|
||||
|
|
|
@ -51,10 +51,10 @@ static void unescape(char *str) {
|
|||
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++;
|
||||
|
@ -115,7 +115,7 @@ static void proc_nodes(struct data *d, const char *tbl, FILE *out, FILE *out_tag
|
|||
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]);*/
|
||||
|
@ -124,9 +124,9 @@ static void proc_nodes(struct data *d, const char *tbl, FILE *out, FILE *out_tag
|
|||
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, ',');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue