Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9011)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9012)
@@ -19,4 +19,22 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2008/07/18 Thomas Bretz
+
+   * datacenter/macros/buildsequenceentries.C:
+     - Use the GetId also in the constructor of Rule
+     - fixed reading of the sections in the sequences.rc
+
+   * mbase/MTime.cc:
+     - GetStringFmt was taking the daylight saving time into account
+       (hopefully this fix is not too much dependent on the kernel)
+
+   * mjobs/MSequence.cc:
+     - added some preliminary code for comparing two sequences
+     - fixed output in Print (the "s" was missing in LightConditions)
+     - do not write the "Run[0-]*" line for anything else than
+       the "Runs" (needs more fixes)
+
+
+
  2008/07/17 Thomas Bretz
 
@@ -102,4 +120,5 @@
      - commmented out caco files
      - write telescope run and file-number to the file
+     - some simplification
 
 
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 9011)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 9012)
@@ -759,12 +759,18 @@
     time.tm_mon   = mon-1;
     time.tm_year  = y-1900;
-    time.tm_isdst = 0;
-
+    time.tm_isdst = -1;
+
+    // -1: If dst, isdst is set to 1 but hour is not changed
+    //  0: If dst, hour is changed
+
+    // Get old local
     const TString locale = setlocale(LC_TIME, 0);
 
+    // Set new local (e.g. Montag instead of Monday)
     setlocale(LC_TIME, loc);
 
     // recalculate tm_yday and tm_wday
-    mktime(&time);
+    if (mktime(&time)<0)
+        return "";
 
     char ret[128];
Index: trunk/MagicSoft/Mars/mjobs/MSequence.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 9011)
+++ trunk/MagicSoft/Mars/mjobs/MSequence.cc	(revision 9012)
@@ -705,4 +705,58 @@
 }
 
+static int operator==(const TArrayI &a, const TArrayI &b)
+{
+    return a.GetSize()==b.GetSize() ?
+        memcmp(a.GetArray(), b.GetArray(), a.GetSize()*sizeof(Int_t))==0 :
+        false;
+}
+
+static int IsNull(const TArrayI &a)
+{
+    if (a.GetSize()==0)
+        return true;
+
+    return a.GetSize()==0 ? true : a==TArrayI(a.GetSize());
+}
+
+static int IsNull(const TArrayI &a, const TArrayI &b)
+{
+    return IsNull(a) && IsNull(b);
+}
+
+Bool_t MSequence::IsSimilar(const MSequence &s) const
+{
+    return // Mandatory
+        fTelescope==s.fTelescope && fSequence==s.fSequence &&
+        fNight==s.fNight
+        && fLightCondition==s.fLightCondition &&
+
+        fMonteCarlo==s.fMonteCarlo &&
+
+        (fRunsSub    ==s.fRunsSub     || IsNull(fRunsSub,     s.fRunsSub))     &&
+        (fCalRunsSub ==s.fCalRunsSub  || IsNull(fCalRunsSub,  s.fCalRunsSub))  &&
+        (fPedRunsSub ==s.fPedRunsSub  || IsNull(fPedRunsSub,  s.fPedRunsSub))  &&
+        (fDatRunsSub ==s.fDatRunsSub  || IsNull(fDatRunsSub,  s.fDatRunsSub))  &&
+        (fExclRunsSub==s.fExclRunsSub || IsNull(fExclRunsSub, s.fExclRunsSub))
+        ;
+}
+
+Bool_t MSequence::IsIdentical(const MSequence &s) const
+{
+    return IsSimilar(s) &&
+        // Unnecessary
+        fStart==s.fStart         && fLastRun==s.fLastRun   &&
+        fNumEvents==s.fNumEvents && fPeriod==s.fPeriod     &&
+        fProject==s.fProject     && fSource==s.fSource     &&
+        /*fTriggerTable==s.fTriggerTable &&*/ fHvSettings==s.fHvSettings;
+}
+
+Bool_t MSequence::operator==(const MSequence &s) const
+{
+    return IsIdentical(s) &&
+        // Obsolete
+        fDataPath==s.fDataPath && fFileName==s.fFileName;
+}
+
 //---------------------------------------------------------------------------
 //
@@ -927,5 +981,5 @@
         out << pre << "Night:          " << fNight.GetStringFmt("%Y-%m-%d") << endl;
     out << endl;
-    out << pre << "LightCondition: ";
+    out << pre << "LightConditions: ";
     switch (fLightCondition)
     {
@@ -965,8 +1019,8 @@
     {
         str += PrintRuns(out, pre, "Runs:     ", fRuns,     fRunsSub);
-        str += PrintRuns(out, pre, "CalRuns:  ", fCalRuns,  fCalRunsSub);
-        str += PrintRuns(out, pre, "PedRuns:  ", fPedRuns,  fPedRunsSub);
-        str += PrintRuns(out, pre, "DataRuns: ", fDatRuns,  fDatRunsSub);
-        str += PrintRuns(out, pre, "Exclude:  ", fExclRuns, fExclRunsSub);
+        /*str +=*/ PrintRuns(out, pre, "CalRuns:  ", fCalRuns,  fCalRunsSub);
+        /*str +=*/ PrintRuns(out, pre, "PedRuns:  ", fPedRuns,  fPedRunsSub);
+        /*str +=*/ PrintRuns(out, pre, "DataRuns: ", fDatRuns,  fDatRunsSub);
+        /*str +=*/ PrintRuns(out, pre, "Exclude:  ", fExclRuns, fExclRunsSub);
     }
 
Index: trunk/MagicSoft/Mars/mjobs/MSequence.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MSequence.h	(revision 9011)
+++ trunk/MagicSoft/Mars/mjobs/MSequence.h	(revision 9012)
@@ -22,4 +22,5 @@
         kCalibrated, kImages
     };
+
 private:
     TString fFileName;         // Expanded file name
@@ -115,4 +116,8 @@
         fExclRunsSub(s.fExclRunsSub), fMonteCarlo(s.fMonteCarlo) { }
 
+    Bool_t IsSimilar(const MSequence &s) const;
+    Bool_t IsIdentical(const MSequence &s) const;
+    Bool_t operator==(const MSequence &s) const;
+
     // I/O
     Bool_t WriteFile(const char *filename, const Option_t *o) const;
