pike.git / lib / modules / Calendar.pmod / mkrules.pike

version» Context lines:

pike.git/lib/modules/Calendar.pmod/mkrules.pike:3:   // ftp://elsie.nci.nih.gov/pub/   // (timezone mailing list: tz@elsie.nci.nih.gov)   //   // source datafile are usually found somewhere around zic(8),   // if they exist in the system.   //   // Most systems only have compiled files, just like pike,   // and zic(8) is the usual compiler.      // pike mkrules.pike ../data/{africa,antarctica,asia,australasia,backward,etcetera,europe,northamerica,pacificnew,southamerica,systemv} - // $Id: mkrules.pike,v 1.14 2009/05/12 12:03:41 grubba Exp $ + // $Id: mkrules.pike,v 1.15 2009/05/12 15:48:35 grubba Exp $      #pike __REAL_VERSION__      object cal=Calendar.ISO->set_timezone("UTC");   function Year=cal->Year;   object nleapy=Year(1999);      object tzrules; // needed to make timezones, compiled below      mapping rules=([]);
pike.git/lib/modules/Calendar.pmod/mkrules.pike:684:    if (err)    if (stringp(err))    werror("%s:%d: %s",file,n,err);    else    throw(err);    }   }      int main(int ac,array(string) am)   { -  if (sizeof(am)<1) +  array(string) files = am[1..]; +  if (!sizeof(files))    { -  werror("USAGE: %s datafile [datafile ...]\n",am[0]); -  return 1; +  werror("defaulting to reading zonefiles from %s...", +  combine_path(__FILE__, "../tzdata")); +  files = get_dir(combine_path(__FILE__, "../tzdata")); +  files = map(sort(files), +  lambda(string fname) { +  if ((< "CVS", "factory", "leapseconds", >)[fname] || +  has_prefix(fname, "solar") || +  has_suffix(fname, ".sh") || +  has_suffix(fname, ".tab")) return 0; +  return combine_path(__FILE__, "../tzdata", fname); +  }) - ({ 0 });    } -  map(am[1..],collect_rules); +  map(files, collect_rules);       write("thinking...\n");       string t=TZrules_base;       foreach (arules,MyRule r)    t+=r->dump();       tzrules=compile_string(t)();