[PC-BSD Commits] r3932 - in pbibuild/pbi-source: PBIsource PBItext

svn at pcbsd.org svn at pcbsd.org
Thu May 14 13:53:40 PDT 2009


Author: kris
Date: 2009-05-14 13:53:40 -0700 (Thu, 14 May 2009)
New Revision: 3932

Modified:
   pbibuild/pbi-source/PBIsource/pbi.cpp
   pbibuild/pbi-source/PBIsource/pbi.h
   pbibuild/pbi-source/PBItext/main.cpp
Log:

Updated our PBI installers, now we can turn off the CrashHandler program, and also the generated scripts are smarter and will use ldconfig config files if present



Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp	2009-05-14 20:40:57 UTC (rev 3931)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp	2009-05-14 20:53:40 UTC (rev 3932)
@@ -276,6 +276,10 @@
 	    {
 		NoDesktop[i] = line.replace("ExeNoDesktop: ", "");
 	    }
+	    if ( line.indexOf("ExeNoCrashHandler:") == 0)
+	    {
+		NoCrashHandler[i] = line.replace("ExeNoCrashHandler: ", "");
+	    }
 	    if ( line.indexOf("ExeRunRoot:") == 0)
 	    {
 		RunRoot[i] = line.replace("ExeRunRoot: ", "");
@@ -615,7 +619,7 @@
              stream2 << "#!/bin/sh\n";
              stream2 << "# Auto-Generated by PC-BSD\n";
              stream2 << "PROGDIR=\"/Programs/" + ProgDirName + "\" ; export PROGDIR\n";     
-             stream2 << "PATH=\"${PROGDIR}/bin:$PATH\"; export PATH\n\n";     
+             stream2 << "PATH=\"${PROGDIR}/bin:${PROGDIR}/sbin:${PROGDIR}/libexec:$PATH\"; export PATH\n\n";     
 
              stream2 << "# Check locale setup\n";
 	     stream2 << "if [ -z \"${LANG}\" ]\n";
@@ -639,32 +643,40 @@
 
              if ( LibDir == "Auto")
 	     {
+                   stream2 << "# Check and parse any ldconfig entries\n";
+                   stream2 << "LDCONFIGDIRS=\"\"\n";
+                   stream2 << "if [ -d \"${PROGDIR}/libdata/ldconfig\" ]\n";
+                   stream2 << "then\n";
+                   stream2 << "  for i in `ls ${PROGDIR}/libdata/ldconfig`\n";
+                   stream2 << "  do\n";
+                   stream2 << "    TMP=`cat ${PBILOC}/libdata/ldconfig/${i}`\n";
+                   stream2 << "    echo $LDCONFIGDIRS | grep \"${TMP}:\" >/dev/null 2>/dev/null\n";
+                   stream2 << "    if [ \"$?\" != \"0\" ]\n";
+                   stream2 << "    then\n";
+                   stream2 << "      LDCONFIGDIRS=\"${TMP}:${LDCONFIGDIRS}\"\n";
+                   stream2 << "    fi\n";
+                   stream2 << "  done\n";
+                   stream2 << "fi\n";
+
                    stream2 << "\n#Setup our LD_LIBRARY_PATH variable with all found lib dirs\n";
-                   stream2 << "LD_LIBRARY_PATH=\"${PROGDIR}/lib/:${PROGDIR}/kde4/lib\"\n";
-                   stream2 << "for i in `ls \"${PROGDIR}/lib\"`\n";
-                   stream2 << "do\n";
-                   stream2 << "  if [ -d \"${PROGDIR}/lib/${i}\" ]\n";
-                   stream2 << "  then\n";
-                   stream2 << "     LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH}:${PROGDIR}/lib/${i}\"\n";
-                   stream2 << "  fi\n";
-                   stream2 << "done\n";
+                   stream2 << "LD_LIBRARY_PATH=\"${LDCONFIGDIRS}:${PROGDIR}/lib/:${PROGDIR}/kde4/lib:${PROGDIR}/lib/qt4\"\n";
                    stream2 << "export LD_LIBRARY_PATH\n\n";
+                   
+
 	      } else if ( LibDir != "NONE" ) {
                    stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n"; 
               }
 	
-	 if ( RunShell[i] == "1" )
-	{
-	stream2 << "/Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\"";	 
-	} else {
-			 
-	stream2 << "STDLOG=\"${HOME}/.$$stdout\"\n";
-	stream2 << "STELOG=\"${HOME}/.$$stderr\"\n";
-	stream2 << "(((( /Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\" || /PCBSD/bin/CrashHandler \"" + ExePath[i] + "\" \"${STDLOG}\" \"${STELOG}\" ) | tee $STDLOG) 3>&1 1>&2 2>&3 | tee $STELOG) 3>&1 1>&2 2>&3)\n\n";
-	stream2 << "rm $STDLOG >/dev/null 2>/dev/null\n";
-	stream2 << "rm $STELOG >/dev/null 2>/dev/null\n";
-	
-            }
+	   if ( RunShell[i] == "1" || NoCrashHandler[i] == "1" )
+	   {
+	     stream2 << "/Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\"";	 
+	   } else {
+	     stream2 << "STDLOG=\"${HOME}/.$$stdout\"\n";
+	     stream2 << "STELOG=\"${HOME}/.$$stderr\"\n";
+	     stream2 << "(((( /Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\" || /PCBSD/bin/CrashHandler \"" + ExePath[i] + "\" \"${STDLOG}\" \"${STELOG}\" ) | tee $STDLOG) 3>&1 1>&2 2>&3 | tee $STELOG) 3>&1 1>&2 2>&3)\n\n";
+             stream2 << "rm $STDLOG >/dev/null 2>/dev/null\n";
+             stream2 << "rm $STELOG >/dev/null 2>/dev/null\n";
+           }
 	   
            file2.close();
          }

Modified: pbibuild/pbi-source/PBIsource/pbi.h
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.h	2009-05-14 20:40:57 UTC (rev 3931)
+++ pbibuild/pbi-source/PBIsource/pbi.h	2009-05-14 20:53:40 UTC (rev 3932)
@@ -95,6 +95,7 @@
     QString ExeIcon[100];
     QString ExeDescr[100];
     QString NoMenu[100];
+    QString NoCrashHandler[100];
     QString RunRoot[100];
     QString RunShell[100];
     QString MimeExt[100];

Modified: pbibuild/pbi-source/PBItext/main.cpp
===================================================================
--- pbibuild/pbi-source/PBItext/main.cpp	2009-05-14 20:40:57 UTC (rev 3931)
+++ pbibuild/pbi-source/PBItext/main.cpp	2009-05-14 20:53:40 UTC (rev 3932)
@@ -42,6 +42,7 @@
 QString ExeIcon[100];
 QString ExeDescr[100];
 QString NoMenu[100];
+QString NoCrashHandler[100];
 QString RunRoot[100];
 QString RunShell[100];
 QString MimeExt[100];
@@ -558,7 +559,7 @@
              stream2 << "#!/bin/sh\n";
              stream2 << "# Auto-Generated by PC-BSD\n";
              stream2 << "PROGDIR=\"/Programs/" + ProgDirName + "\" ; export PROGDIR\n";
-             stream2 << "PATH=\"${PROGDIR}/bin:$PATH\"; export PATH\n\n";     
+             stream2 << "PATH=\"${PROGDIR}/bin:${PROGDIR}/sbin:${PROGDIR}/libexec:$PATH\"; export PATH\n\n";     
 
              stream2 << "# Check locale setup\n";
 	     stream2 << "if [ -z \"${LANG}\" ]\n";
@@ -583,34 +584,41 @@
 
              if ( LibDir == "Auto")
              {
-                   stream2 << "\n#Setup our LD_LIBRARY_PATH variable with all found lib dirs\n";
-                   stream2 << "LD_LIBRARY_PATH=\"${PROGDIR}/lib/:${PROGDIR}/kde4/lib\"\n";
-                   stream2 << "for i in `ls \"${PROGDIR}/lib\"`\n";
-                   stream2 << "do\n";
-                   stream2 << "  if [ -d \"${PROGDIR}/lib/${i}\" ]\n";
-                   stream2 << "  then\n";
-                   stream2 << "     LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH}:${PROGDIR}/lib/${i}\"\n";
-                   stream2 << "  fi\n";
-                   stream2 << "done\n";
-                   stream2 << "export LD_LIBRARY_PATH\n\n";
-              } else if ( LibDir != "NONE" ) {
-                   stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n";
-              }
+                  stream2 << "# Check and parse any ldconfig entries\n";
+                  stream2 << "LDCONFIGDIRS=\"\"\n";
+                  stream2 << "if [ -d \"${PROGDIR}/libdata/ldconfig\" ]\n";
+                  stream2 << "then\n";
+                  stream2 << "  for i in `ls ${PROGDIR}/libdata/ldconfig`\n";
+                  stream2 << "  do\n";
+                  stream2 << "    TMP=`cat ${PBILOC}/libdata/ldconfig/${i}`\n";
+                  stream2 << "    echo $LDCONFIGDIRS | grep \"${TMP}:\" >/dev/null 2>/dev/null\n";
+                  stream2 << "    if [ \"$?\" != \"0\" ]\n";
+                  stream2 << "    then\n";
+                  stream2 << "      LDCONFIGDIRS=\"${TMP}:${LDCONFIGDIRS}\"\n";
+                  stream2 << "    fi\n";
+                  stream2 << "  done\n";
+                  stream2 << "fi\n";
 
+                  stream2 << "\n#Setup our LD_LIBRARY_PATH variable with all found lib dirs\n";
+                  stream2 << "LD_LIBRARY_PATH=\"${LDCONFIGDIRS}:${PROGDIR}/lib/:${PROGDIR}/kde4/lib:${PROGDIR}/lib/qt4\"\n";
+                  stream2 << "export LD_LIBRARY_PATH\n\n";
+
+             } else if ( LibDir != "NONE" ) {
+                  stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n";
+             }
+
 	     
-	 if ( RunShell[i] == "1" )
-	{
-	stream2 << "/Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\"";	 
-	} else {
-			 
-	stream2 << "STDLOG=\"${HOME}/.$$stdout\"\n";
-	stream2 << "STELOG=\"${HOME}/.$$stderr\"\n";
-	stream2 << "(((( /Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\" || /PCBSD/bin/CrashHandler \"" + ExePath[i] + "\" \"${STDLOG}\" \"${STELOG}\" ) | tee $STDLOG) 3>&1 1>&2 2>&3 | tee $STELOG) 3>&1 1>&2 2>&3)\n\n";
-	stream2 << "rm $STDLOG >/dev/null 2>/dev/null\n";
-	stream2 << "rm $STELOG >/dev/null 2>/dev/null\n";
-	
-            }
-	   
+	   if ( RunShell[i] == "1" || NoCrashHandler[i] == "1" )
+           {
+             stream2 << "/Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\"";
+           } else {
+             stream2 << "STDLOG=\"${HOME}/.$$stdout\"\n";
+             stream2 << "STELOG=\"${HOME}/.$$stderr\"\n";
+             stream2 << "(((( /Programs/" + ProgDirName + "/" + ExePath[i] + "  \"$@\" || /PCBSD/bin/CrashHandler \"" + ExePath[i] + "\" \"${STDLOG}\" \"${STELOG}\" ) | tee $STDLOG) 3>&1 1>&2 2>&3 | tee $STELOG) 3>&1 1>&2 2>&3)\n\n";
+             stream2 << "rm $STDLOG >/dev/null 2>/dev/null\n";
+             stream2 << "rm $STELOG >/dev/null 2>/dev/null\n";
+           }
+
            file2.close();
          }
 	



More information about the Commits mailing list