Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9402)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9408)
@@ -18,4 +18,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2009/03/19 Daniel Hoehne-Moench
+
+   * datacenter/scropts/mcsequences:
+     - bugfix: replaced $user by $us
+     - bugfix: fPriority is now inserted into the correct table
+
+
+
  2009/03/16 Thomas Bretz
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/mcsequences
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/mcsequences	(revision 9402)
+++ trunk/MagicSoft/Mars/datacenter/scripts/mcsequences	(revision 9408)
@@ -95,11 +95,11 @@
             do
                trainupdate=" update MCRunData set fSequenceFirst=\"$firstruntrain\" where fRunNumber=\"$trainrun\" "
-   	       mysql -ss -u $user --password=$pw --host=$ho $db -e " $trainupdate "
+   	       mysql -ss -u $us --password=$pw --host=$ho $db -e " $trainupdate "
             done   
 
             trainquery1=" select fSpectrumKEY, fPSFKEY, fAmplFadcKEY, fAtmosphericModelKEY, fObservationModeKEY, fMCParticleKEY, fReflectorVersionKEY, fCorsikaVersionKEY, fCameraVersionKEY, fViewConeAngleOKEY, fAddSpotSizeKEY, fTriggerFlagKEY from MCRunData where fRunNumber=\"$firstruntrain\" "
             trainquery2=" select sum(fNumEvents), sum(fNumTriggers), sum(fNumSumTriggers) from MCRunData where fRunNumber in ($trainruns2) "
-            trainvalues=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $trainquery1 "`
-            trainvalues2=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $trainquery2 "`
+            trainvalues=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $trainquery1 "`
+            trainvalues2=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $trainquery2 "`
             trainspec=`echo $trainvalues | cut -d" " -f1`
             trainpsf=`echo $trainvalues | cut -d" " -f2`
@@ -119,18 +119,18 @@
    	    trainquery3=" select fSequenceFirst from MCSequenceProcessStatus where fSequenceFirst=\"$firstruntrain\" "
    	    trainquery4=" select fSequenceFirst from MCSequences where fSequenceFirst=\"$firstruntrain\" "
-   	    traincheck3=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $trainquery3 "`
-   	    traincheck4=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $trainquery4 "`
-   	    traininsert1=" insert MCSequenceProcessStatus set fSequenceFirst=\"$firstruntrain\", fSequenceFileWritten=Now() "
-   	    traininsert2=" insert MCSequences set fSequenceFirst=\"$firstruntrain\", fPriority=\"$firstruntrain\", fRunStart=\"$date\", fNumEvents=\"$trainevents\", fNumTriggers=\"$traintriggers\", fNumSumTriggers=\"$trainsumtriggers\", fZBin=\"$zbin\", fSpectrumKEY=\"$trainspec\", fPSFKEY=\"$trainpsf\", fAddSpotSizeKEY=\"$trainass\", fAmplFadcKEY=\"$trainamplfadc\", fAtmosphericModelKEY=\"$trainatmo\", fObservationModeKEY=\"$trainobs\", fMCParticleKEY=\"$trainpart\", fReflectorVersionKEY=\"$trainrefl\", fCorsikaVersionKEY=\"$traincors\", fCameraVersionKEY=\"$traincam\", fViewConeAngleOKEY=\"$trainview\", fTriggerFlagKEY=\"$traintrig\", fTestTrainKEY=2 "
+   	    traincheck3=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $trainquery3 "`
+   	    traincheck4=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $trainquery4 "`
+   	    traininsert1=" insert MCSequenceProcessStatus set fSequenceFirst=\"$firstruntrain\", fPriority=\"$firstruntrain\", fSequenceFileWritten=Now() "
+   	    traininsert2=" insert MCSequences set fSequenceFirst=\"$firstruntrain\", fRunStart=\"$date\", fNumEvents=\"$trainevents\", fNumTriggers=\"$traintriggers\", fNumSumTriggers=\"$trainsumtriggers\", fZBin=\"$zbin\", fSpectrumKEY=\"$trainspec\", fPSFKEY=\"$trainpsf\", fAddSpotSizeKEY=\"$trainass\", fAmplFadcKEY=\"$trainamplfadc\", fAtmosphericModelKEY=\"$trainatmo\", fObservationModeKEY=\"$trainobs\", fMCParticleKEY=\"$trainpart\", fReflectorVersionKEY=\"$trainrefl\", fCorsikaVersionKEY=\"$traincors\", fCameraVersionKEY=\"$traincam\", fViewConeAngleOKEY=\"$trainview\", fTriggerFlagKEY=\"$traintrig\", fTestTrainKEY=2 "
             trainupdate2=" update MCSequences set fRunStart=\"$date\", fNumEvents=\"$trainevents\", fNumTriggers=\"$traintriggers\", fNumSumTriggers=\"$trainsumtriggers\", fZBin=\"$zbin\", fSpectrumKEY=\"$trainspec\", fPSFKEY=\"$trainpsf\", fAddSpotSizeKEY=\"$trainass\", fAmplFadcKEY=\"$trainamplfadc\", fAtmosphericModelKEY=\"$trainatmo\", fObservationModeKEY=\"$trainobs\", fMCParticleKEY=\"$trainpart\", fReflectorVersionKEY=\"$trainrefl\", fCorsikaVersionKEY=\"$traincors\", fCameraVersionKEY=\"$traincam\", fViewConeAngleOKEY=\"$trainview\", fTriggerFlagKEY=\"$traintrig\", fTestTrainKEY=2 where fSequenceFirst=\"$firstruntrain\" "
             if [ "$traincheck3" == "" ]
             then
-               mysql -ss -u $user --password=$pw --host=$ho $db -e " $traininsert1 "
+               mysql -ss -u $us --password=$pw --host=$ho $db -e " $traininsert1 "
             fi
             if [ "$traincheck4" == "" ]
             then
-   	       mysql -ss -u $user --password=$pw --host=$ho $db -e " $traininsert2 "
+   	       mysql -ss -u $us --password=$pw --host=$ho $db -e " $traininsert2 "
             else
-   	       mysql -ss -u $user --password=$pw --host=$ho $db -e " $trainupdate2 "
+   	       mysql -ss -u $us --password=$pw --host=$ho $db -e " $trainupdate2 "
             fi
             
@@ -159,11 +159,11 @@
             do
                testupdate=" update MCRunData set fSequenceFirst=\"$firstruntest\" where fRunNumber=\"$testrun\" "
-   	       mysql -ss -u $user --password=$pw --host=$ho $db -e " $testupdate "
+   	       mysql -ss -u $us --password=$pw --host=$ho $db -e " $testupdate "
             done   
 
             testquery1=" select fSpectrumKEY, fPSFKEY, fAmplFadcKEY, fAtmosphericModelKEY, fObservationModeKEY, fMCParticleKEY, fReflectorVersionKEY, fCorsikaVersionKEY, fCameraVersionKEY, fViewConeAngleOKEY, fAddSpotSizeKEY, fTriggerFlagKEY from MCRunData where fRunNumber=\"$firstruntest\" "
             testquery2=" select sum(fNumEvents), sum(fNumTriggers), sum(fNumSumTriggers) from MCRunData where fRunNumber in ($testruns2) "
-            testvalues=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $testquery1 "`
-            testvalues2=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $testquery2 "`
+            testvalues=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $testquery1 "`
+            testvalues2=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $testquery2 "`
             testspec=`echo $testvalues | cut -d" " -f1`
             testpsf=`echo $testvalues | cut -d" " -f2`
@@ -183,18 +183,18 @@
    	    testquery3=" select fSequenceFirst from MCSequenceProcessStatus where fSequenceFirst=\"$firstruntest\" "
    	    testquery4=" select fSequenceFirst from MCSequences where fSequenceFirst=\"$firstruntest\" "
-   	    testcheck3=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $testquery3 "`
-   	    testcheck4=`mysql -ss -u $user --password=$pw --host=$ho $db -e " $testquery4 "`
-   	    testinsert1=" insert MCSequenceProcessStatus set fSequenceFirst=\"$firstruntest\", fSequenceFileWritten=Now() "
-   	    testinsert2=" insert MCSequences set fSequenceFirst=\"$firstruntest\", fPriority=\"$firstruntest\", fRunStart=\"$date\", fNumEvents=\"$testevents\", fNumTriggers=\"$testtriggers\", fNumSumTriggers=\"$testsumtriggers\", fZBin=\"$zbin\", fSpectrumKEY=\"$testspec\", fPSFKEY=\"$testpsf\", fAddSpotSizeKEY=\"$testass\", fAmplFadcKEY=\"$testamplfadc\", fAtmosphericModelKEY=\"$testatmo\", fObservationModeKEY=\"$testobs\", fMCParticleKEY=\"$testpart\", fReflectorVersionKEY=\"$testrefl\", fCorsikaVersionKEY=\"$testcors\", fCameraVersionKEY=\"$testcam\", fViewConeAngleOKEY=\"$testview\", fTriggerFlagKEY=\"$testtrig\", fTestTrainKEY=3 "
+   	    testcheck3=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $testquery3 "`
+   	    testcheck4=`mysql -ss -u $us --password=$pw --host=$ho $db -e " $testquery4 "`
+   	    testinsert1=" insert MCSequenceProcessStatus set fSequenceFirst=\"$firstruntest\", fPriority=\"$firstruntest\", fSequenceFileWritten=Now() "
+   	    testinsert2=" insert MCSequences set fSequenceFirst=\"$firstruntest\", fRunStart=\"$date\", fNumEvents=\"$testevents\", fNumTriggers=\"$testtriggers\", fNumSumTriggers=\"$testsumtriggers\", fZBin=\"$zbin\", fSpectrumKEY=\"$testspec\", fPSFKEY=\"$testpsf\", fAddSpotSizeKEY=\"$testass\", fAmplFadcKEY=\"$testamplfadc\", fAtmosphericModelKEY=\"$testatmo\", fObservationModeKEY=\"$testobs\", fMCParticleKEY=\"$testpart\", fReflectorVersionKEY=\"$testrefl\", fCorsikaVersionKEY=\"$testcors\", fCameraVersionKEY=\"$testcam\", fViewConeAngleOKEY=\"$testview\", fTriggerFlagKEY=\"$testtrig\", fTestTrainKEY=3 "
             testupdate2=" update MCSequences set fRunStart=\"$date\", fNumEvents=\"$testevents\", fNumTriggers=\"$testtriggers\", fNumSumTriggers=\"$testsumtriggers\", fZBin=\"$zbin\", fSpectrumKEY=\"$testspec\", fPSFKEY=\"$testpsf\", fAddSpotSizeKEY=\"$testass\", fAmplFadcKEY=\"$testamplfadc\", fAtmosphericModelKEY=\"$testatmo\", fObservationModeKEY=\"$testobs\", fMCParticleKEY=\"$testpart\", fReflectorVersionKEY=\"$testrefl\", fCorsikaVersionKEY=\"$testcors\", fCameraVersionKEY=\"$testcam\", fViewConeAngleOKEY=\"$testview\", fTriggerFlagKEY=\"$testtrig\", fTestTrainKEY=3 where fSequenceFirst=\"$firstruntest\" "
             if [ "$testcheck3" == "" ]
             then
-               mysql -ss -u $user --password=$pw --host=$ho $db -e " $testinsert1 "
+               mysql -ss -u $us --password=$pw --host=$ho $db -e " $testinsert1 "
             fi
             if [ "$testcheck4" == "" ]
             then
-   	       mysql -ss -u $user --password=$pw --host=$ho $db -e " $testinsert2 "
+   	       mysql -ss -u $us --password=$pw --host=$ho $db -e " $testinsert2 "
             else
-   	       mysql -ss -u $user --password=$pw --host=$ho $db -e " $testupdate2 "
+   	       mysql -ss -u $us --password=$pw --host=$ho $db -e " $testupdate2 "
             fi
             
