Branch: Tag:

2001-07-26

2001-07-26 00:16:29 by Martin Nilsson <mani@lysator.liu.se>

Don't write target files when nothing has changed.

Rev: bin/autodoc_images.pike:1.3

1: -  - // #define DEBUG +    string copy_to = "manual/images";      void parse_directory(string directory) {
15:    continue;    if(file=="sub_manual.xml")    continue; -  string x; +  string x,y; +  y = Stdio.read_file(directory+file);   #ifdef DEBUG    array err = catch {    x = Tools.AutoDoc.ProcessXML.moveImages -  (Stdio.read_file(directory+file), directory, copy_to); +  (y, directory, copy_to);    }; -  if(!err) +  if(!err) { +  if(x!=y)    Stdio.write_file(directory+file, x); -  +  }    else    werror(describe_backtrace(err));   #else    x = Tools.AutoDoc.ProcessXML.moveImages    (Stdio.read_file(directory+file), directory, copy_to); -  +  if(x!=y)    Stdio.write_file(directory+file, x);   #endif    }