[PC-BSD Commits] r4263 - in pbibuild/pbi-source: PBCsource PBIsource PBItext
svn at pcbsd.org
svn at pcbsd.org
Wed Jul 22 11:00:25 PDT 2009
Author: kris
Date: 2009-07-22 11:00:24 -0700 (Wed, 22 Jul 2009)
New Revision: 4263
Modified:
pbibuild/pbi-source/PBCsource/pbistart.c
pbibuild/pbi-source/PBIsource/main.cpp
pbibuild/pbi-source/PBIsource/pbi.cpp
pbibuild/pbi-source/PBIsource/pbi.h
pbibuild/pbi-source/PBIsource/pbi.ui
pbibuild/pbi-source/PBItext/main.cpp
Log:
Large update to the PBI installer for 8.0 again:
* Added debugging support to pbistart.c, so we can figure out failures
* Added support for installing 32bit PBIs on 64bit system
Modified: pbibuild/pbi-source/PBCsource/pbistart.c
===================================================================
--- pbibuild/pbi-source/PBCsource/pbistart.c 2009-07-22 13:26:31 UTC (rev 4262)
+++ pbibuild/pbi-source/PBCsource/pbistart.c 2009-07-22 18:00:24 UTC (rev 4263)
@@ -1,7 +1,7 @@
/* PBI Extraction Program
* Author: Kris Moore
- * Version: 2.0
- * Copyright 2007 PC-BSD Software
+ * Version: 2.5
+ * Copyright 2009 PC-BSD Software
********************************************************************/
#include <stdlib.h>
@@ -9,7 +9,16 @@
#include <string.h>
#include <errno.h>
+/* Define our arch types */
+#if defined(__i386__)
+ #define PBIARCH 32
+#endif
+#if defined(__amd64__)
+ #define PBIARCH 64
+#endif
+
+
int main(argc,argv)
int argc;
char *argv[];
@@ -28,6 +37,11 @@
char getuser[200];
char tmpdir[200];
char tmpfile[300];
+ char getarch[200];
+ char sysarch[20];
+ char pbiarch[20];
+ char *checkdebug;
+ int DEBUG = 0;
int file;
int charread;
@@ -35,18 +49,26 @@
int acceptlic;
int tarexit = 0;
int extractmode = 0;
+ int run32mode = 0;
textmode = 0;
acceptlic = 0;
+/* Lets figure out if debugging is turned on */
+checkdebug = getenv("PBIDEBUG");
+if ( checkdebug )
+{
+ DEBUG=1;
+}
-
/* Get the name of the file */
-
progname = argv[0];
-//printf("File: %s\n", progname);
+if (DEBUG) {
+ printf("File: %s\n", progname);
+}
+
if ( argc >= 2)
{
if ( strcmp(argv[1], "-text" ) == 0 )
@@ -67,7 +89,6 @@
}
/* Get Username of person running Script */
-
strcpy(getuser, "whoami");
FILE *namefile = popen(getuser, "r");
@@ -83,9 +104,27 @@
strcat(username, buffer);
username[strlen(username)-1] = '\0';
}
-
pclose(namefile);
+
+/* Get the architecture of this system */
+strcpy(getarch, "uname -m");
+
+FILE *archfile = popen(getarch, "r");
+fscanf(archfile, "%s", sysarch);
+pclose(archfile);
+
+if (DEBUG) {
+ printf( "system arch %s\n", sysarch);
+}
+
+if ( strcmp(sysarch, "amd64") == 0 && PBIARCH == 32 )
+{
+ /* We are running on amd64, and installing 32bit application
+ Set the flag to indicate this now */
+ run32mode=1;
+}
+
/* Find the users homedir */
if ( strcmp(username, "root") == 0)
{
@@ -97,10 +136,11 @@
}
+if (DEBUG) {
+ printf("Username: %s\n", username);
+ printf("Tmpdir: %s\n", tmpdir);
+}
-//printf("Username: %s\n", username);
-//printf("Tmpdir: %s\n", tmpdir);
-
/* Get the lines to skip in file */
strcpy(tmpfile, tmpdir);
@@ -111,7 +151,9 @@
strcat(awkcmd, "' >");
strcat(awkcmd, tmpfile);
-//printf("%s\n", awkcmd);
+if (DEBUG) {
+ printf("awk command: %s\n", awkcmd);
+}
system(awkcmd);
@@ -123,7 +165,9 @@
unlink(tmpfile);
-//printf("Lineskip=%sdone\n", lineskip);
+if (DEBUG) {
+ printf("Lineskip=%s\n", lineskip);
+}
/* Get the current directory */
@@ -145,46 +189,11 @@
unlink(tmpfile);
-//printf("pwd: %s\n", pwd);
-
-if ( textmode != 1)
-{
-
-char dialogpidfile[200];
-
-strcpy(dialogpidfile, tmpdir);
-strcat(dialogpidfile, ".pbidialog");
-
-
-/* Start the KDE Dialog */
-
-char dialogcmd[450];
-
-//strcpy(dialogcmd, "kdialog --passivepopup 'Please Wait.. Starting PBI Installer..' 200 & echo $! >");
-//strcat(dialogcmd, dialogpidfile);
-
-//printf("Pid Cmd: %s\n", dialogcmd);
-
-//system(dialogcmd);
-//system("kdialog --passivepopup 'Please Wait.. Extracting PC-BSD install wizard..' 200 & echo $! >.pbidialogpid");
-
-//if ((file = open(dialogpidfile, 0x0)) < 0 ) {
-// exit(2);
-//}
-
-//charread = read(file, dialogpid, 5);
-//dialogpid[charread]='\0';
-
-//unlink(dialogpidfile);
-
-//printf("dialogpid: %s \n", dialogpid);
-
-close(file);
-
+if (DEBUG) {
+ printf("pwd: %s\n", pwd);
}
-
/* Make the tmp dir */
char pbitmpdir[300];
@@ -193,7 +202,9 @@
mkdtemp(pbitmpdir);
-//printf("pbitmpdir: %s\n", pbitmpdir);
+if (DEBUG) {
+ printf("pbitmpdir: %s\n", pbitmpdir);
+}
/* Save username for PBI program */
char whoamicmd[200];
@@ -217,7 +228,9 @@
fscanf(pbiskipfile, "%s", pbiskip);
fclose(pbiskipfile);
-//printf("PBIskip=%sdone\n", pbiskip);
+if (DEBUG) {
+ printf("PBIskip=%sdone\n", pbiskip);
+}
// Get how many lines we want to read now
strcpy(whoamicmd, "expr ");
@@ -238,8 +251,9 @@
fscanf(pbiskipfile2, "%s", tardatalines);
fclose(pbiskipfile2);
-//printf("tardatalines=%sdone\n", tardatalines);
-//system("sleep 10");
+if (DEBUG) {
+ printf("tardatalines=%sdone\n", tardatalines);
+}
@@ -263,7 +277,9 @@
}
-//printf("%s\n", tmpfile);
+if (DEBUG) {
+ printf("tmpfile: %s\n", tmpfile);
+}
system(tmpfile);
/* Extract Tarball */
@@ -279,7 +295,9 @@
strcat(tarcmd, "/'");
strcat(tarcmd, " -f - 2>/dev/null");
strcat(tarcmd, " ; exit $?");
-//printf("tarcmd: %s\n", tarcmd);
+if (DEBUG) {
+ printf("tarcmd: %s\n", tarcmd);
+}
tarexit = system(tarcmd);
@@ -289,11 +307,6 @@
char dialogcmd[450];
- // Stop the extract notify
- //strcpy(killcmd, "kill -9 ");
- //strcat(killcmd, dialogpid);
- //system(killcmd);
-
// Remove the TMPDIR
char rmcmd[200];
strcpy(rmcmd, "rm -rf ");
@@ -303,6 +316,7 @@
// Display error message
strcpy(dialogcmd, "kdialog --error 'ERROR: PBI extraction failed. File is corrupt!'");
system(dialogcmd);
+ printf("ERROR: PBI extraction failed. File is corrupt!");
return 2;
}
@@ -312,29 +326,38 @@
if ( textmode != 1)
{
-/* Kill the dialog */
-//strcpy(killcmd, "kill -9 ");
-//strcat(killcmd, dialogpid);
-//system(killcmd);
-
-
char pbiscript[600];
strcpy(pbiscript, "echo \"#!/bin/sh\n\
. /PCBSD/LANGS/PCBSDLANG\n\
LD_LIBRARY_PATH=/Programs/.libs7/ ; export LD_LIBRARY_PATH\n\
cd ");
strcat(pbiscript, pbitmpdir);
-// Check if the user prompted to only extract the files
-if ( extractmode == 1 ) {
- strcat(pbiscript, "\n./PBI -extract\" > ");
+
+
+// If we are running on amd64 and installing 32bit PBI, use 64-native PBI
+if( run32mode )
+{
+ // Check if the user prompted to only extract the files
+ if ( extractmode == 1 ) {
+ strcat(pbiscript, "\n./PBI64 -extract\" > ");
+ } else {
+ strcat(pbiscript, "\n./PBI64 -32bitcompat\" > ");
+ }
} else {
- strcat(pbiscript, "\n./PBI\" > ");
+ // Check if the user prompted to only extract the files
+ if ( extractmode == 1 ) {
+ strcat(pbiscript, "\n./PBI -extract\" > ");
+ } else {
+ strcat(pbiscript, "\n./PBI\" > ");
+ }
}
strcat(pbiscript, pbitmpdir);
strcat(pbiscript, "/.pbistart");
-//printf("pbiscript: %s\n", pbiscript);
+if (DEBUG) {
+ printf("pbiscript: %s\n", pbiscript);
+}
system(pbiscript);
@@ -348,21 +371,23 @@
-//printf("%s", pwd);
-
// Check if the user prompted to only extract the files
if ( extractmode == 1 ) {
// Run extract mode only
strcpy(command, pbitmpdir);
strcat(command, "/.pbistart");
- //printf("command: %s\n", command);
+ if (DEBUG) {
+ printf("command: %s\n", command);
+ }
system(command);
} else {
// Run KDEsu as to switch to root
strcpy(command, "kdesu -d -c ");
strcat(command, pbitmpdir);
strcat(command, "/.pbistart");
- //printf("command: %s\n", command);
+ if (DEBUG) {
+ printf("command: %s\n", command);
+ }
system(command);
}
} else {
@@ -374,10 +399,20 @@
LD_LIBRARY_PATH=/Programs/.libs7/ ; export LD_LIBRARY_PATH\n\
cd ");
strcat(pbiscript, pbitmpdir);
-if ( acceptlic == 0 ) {
- strcat(pbiscript, "\n./PBItext\n\" > ");
+// If we are running on amd64 and installing 32bit PBI, use 64-native PBI
+if( run32mode )
+{
+ if ( acceptlic == 0 ) {
+ strcat(pbiscript, "\n./PBItext64 -32bitcompat\n\" > ");
+ } else {
+ strcat(pbiscript, "\n./PBItext64 -accept -32bitcompat\n\" > ");
+ }
} else {
- strcat(pbiscript, "\n./PBItext -accept\n\" > ");
+ if ( acceptlic == 0 ) {
+ strcat(pbiscript, "\n./PBItext\n\" > ");
+ } else {
+ strcat(pbiscript, "\n./PBItext -accept\n\" > ");
+ }
}
strcat(pbiscript, pbitmpdir);
strcat(pbiscript, "/.pbistart");
@@ -397,13 +432,17 @@
strcpy(command, "su root -c ");
strcat(command, pbitmpdir);
strcat(command, "/.pbistart");
- //printf("%s", command);
+ if (DEBUG) {
+ printf("command: %s", command);
+ }
system(command);
} else {
strcpy(command, pbitmpdir);
strcat(command, "/.pbistart");
- //printf("%s", command);
+ if (DEBUG) {
+ printf("command: %s", command);
+ }
system(command);
}
Modified: pbibuild/pbi-source/PBIsource/main.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/main.cpp 2009-07-22 13:26:31 UTC (rev 4262)
+++ pbibuild/pbi-source/PBIsource/main.cpp 2009-07-22 18:00:24 UTC (rev 4263)
@@ -24,6 +24,7 @@
options.add("", ki18n("Start the PBI Install"));
options.add("extract", ki18n("Extract the PBI files and create the .pbc configuration"));
+ options.add("32bitcompat", ki18n("Install a 32bit PBI on 64bit platform."));
// Tell which options are supported
@@ -52,6 +53,11 @@
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
}
+
+ if ( flag == "-32bitcompat" )
+ {
+ w.set32BitCompat();
+ }
}
Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp 2009-07-22 13:26:31 UTC (rev 4262)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp 2009-07-22 18:00:24 UTC (rev 4263)
@@ -37,10 +37,11 @@
ExtractStarted = 0;
// Set the fixed size
- setFixedSize(510,310);
- setMaximumWidth(490);
+ setFixedSize(510,315);
+ setMaximumWidth(510);
setContentsMargins(0,0,0,0);
gridLayout->setMargin(0);
+ gridLayout->setContentsMargins(0,0,0,0);
gridLayout->setSpacing(0);
gridLayout_2->setMargin(0);
gridLayout_2->setSpacing(0);
@@ -49,8 +50,8 @@
gridLayout_5->setSpacing(0);
gridLayout_6->setMargin(0);
gridLayout_6->setSpacing(0);
-
-
+ gridLayout->update();
+
ProgramDir = ProgDir;
OverWrote = 0;
@@ -87,7 +88,21 @@
}
+void PBI::set32BitCompat()
+{
+ switch( QMessageBox::warning( this, tr("32bit Warning!"), tr("This PBI is 32bit, while your system is 64bit. The PBI can be installed, however it will not receive online-update notifications. Also, the installed application may not perform optimally. Continue installing?"), tr("OK"), tr("Cancel"), 0, 0, 1 ) )
+ {
+ case 0: // The user clicked the OK button
+ Compat32PBI = TRUE;
+ break;
+ case 1: // The user clicked the cancel button
+ exit(1);
+ break;
+ }
+
+}
+
// Function which checks the ProgList if we already have this app installed
void PBI::slotCheckExistingProgram(void)
{
@@ -619,6 +634,15 @@
stream2 << "XDG_DATA_DIRS=\"${PROGDIR}/share:${PROGDIR}/kde4/share:${XDG_DATA_DIRS}\"; export XDG_DATA_DIRS\n";
+ QString LDLIBVAR;
+ // Change the LD_LIBRARY_PATH variable if we are doing a 32bit compat install
+ if ( Compat32PBI )
+ {
+ LDLIBVAR="LD_32_LIBRARY_PATH";
+ } else {
+ LDLIBVAR="LD_LIBRARY_PATH";
+ }
+
if ( LibDir == "Auto")
{
stream2 << "\n# Check and parse any ldconfig entries\n";
@@ -639,12 +663,11 @@
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";
-
+ stream2 << LDLIBVAR + "=\"${LDCONFIGDIRS}:${PROGDIR}/lib/:${PROGDIR}/kde4/lib:${PROGDIR}/lib/qt4\"\n";
+ stream2 << "export " + LDLIBVAR + "\n\n";
} else if ( LibDir != "NONE" ) {
- stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n";
+ stream2 << LDLIBVAR + "=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export " + LDLIBVAR + "\n";
}
if ( RunShell[i] == "1" || NoCrashHandler[i] == "1" )
@@ -1374,9 +1397,8 @@
stream3 << "#!/bin/sh\n\nPBIUpdateURL=\"" << ProgUpdateURL << "\" ; export PBIUpdateURL";
file3.close();
}
- }
-
-
+ }
+
// Make the install script now
QFile file4( "extract.sh" );
if ( file4.open( QIODevice::WriteOnly ) ) {
@@ -1404,6 +1426,12 @@
// Slot to get the exit status of the UnTar process
void PBI::slotUnTarFinished(int exitCode, QProcess::ExitStatus exitStatus)
{
+ // We are installing a 32bit compat PBI, make sure to remove the online update URL
+ if ( Compat32PBI )
+ {
+ system("rm /Programs/" + ProgDirName.toLatin1() + "/PBI.UpdateURL.sh");
+ }
+
SetupLibSlot();
}
Modified: pbibuild/pbi-source/PBIsource/pbi.h
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.h 2009-07-22 13:26:31 UTC (rev 4262)
+++ pbibuild/pbi-source/PBIsource/pbi.h 2009-07-22 18:00:24 UTC (rev 4263)
@@ -19,11 +19,13 @@
PBI() : QWizard()
{
setupUi(this);
+ Compat32PBI = FALSE;
}
void checkCustomGraphics();
void uninstall();
void extractOnly();
QString getLineFromCommandOutput(QString command);
+ void set32BitCompat();
public slots:
void ProgramInit( QString ProgDir );
@@ -120,6 +122,7 @@
int ChecksumPassed;
QStringList IconScript;
QStringList IconUnScript;
+ bool Compat32PBI;
signals:
Modified: pbibuild/pbi-source/PBIsource/pbi.ui
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.ui 2009-07-22 13:26:31 UTC (rev 4262)
+++ pbibuild/pbi-source/PBIsource/pbi.ui 2009-07-22 18:00:24 UTC (rev 4263)
@@ -204,7 +204,7 @@
<item>
<widget class="QLabel" name="textLabel2_2_2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -213,7 +213,7 @@
<string>Vendor:</string>
</property>
<property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -221,9 +221,25 @@
</widget>
</item>
<item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<widget class="QLabel" name="AuthorLabel">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -246,7 +262,7 @@
<item>
<widget class="QLabel" name="textLabel2_2_3">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@@ -261,7 +277,7 @@
<string>URL:</string>
</property>
<property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -269,12 +285,28 @@
</widget>
</item>
<item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
<widget class="QLabel" name="WebsiteLabel">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Modified: pbibuild/pbi-source/PBItext/main.cpp
===================================================================
--- pbibuild/pbi-source/PBItext/main.cpp 2009-07-22 13:26:31 UTC (rev 4262)
+++ pbibuild/pbi-source/PBItext/main.cpp 2009-07-22 18:00:24 UTC (rev 4263)
@@ -60,12 +60,15 @@
int acceptlic = 0;
QStringList IconScript;
QStringList IconUnScript;
+bool Compat32PBI;
int main( int argc, char ** argv )
{
QCoreApplication a( argc, argv);
+ Compat32PBI = FALSE;
+ QString tmp;
QString command = "whoami";
QString inputLine = getLineFromCommandOutput(command);
@@ -76,16 +79,20 @@
}
// Check if the -accept flag has been specified
- if ( argc == 2)
+ if ( argc > 1)
{
- QString tmp = argv[1];
- if ( tmp == "-accept" ) {
- acceptlic = 1;
+ for (int i = 1; i < argc; i++)
+ {
+ tmp = argv[i];
+ if ( tmp == "-accept" ) {
+ acceptlic = 1;
+ }
+ if ( tmp == "-32bitcompat" ) {
+ Compat32PBI = 1;
+ }
}
}
-
-
ProgramInit(a.applicationDirPath());
return 0;
@@ -211,8 +218,7 @@
file3.close();
}
}
-
-
+
// Make the install script now
QFile file4( "extract.sh" );
if ( file4.open( QIODevice::WriteOnly ) ) {
@@ -225,6 +231,13 @@
QString command = "sh extract.sh /Programs/" + ProgDirName + "/";
QString inputLine = getLineFromCommandOutput(command);
+ // We are installing a 32bit compat PBI, make sure to remove the online update URL
+ if ( Compat32PBI )
+ {
+ system("rm /Programs/" + ProgDirName.toLatin1() + "/PBI.UpdateURL.sh");
+ }
+
+
// Setup the libraries
SetupLibSlot();
@@ -586,36 +599,43 @@
stream2 << "fi\n\n";
stream2 << "XDG_DATA_DIRS=\"${PROGDIR}/share:${PROGDIR}/kde4/share:${XDG_DATA_DIRS}\"; export XDG_DATA_DIRS\n";
+
+ QString LDLIBVAR;
+ // Change the LD_LIBRARY_PATH variable if we are doing a 32bit compat install
+ if ( Compat32PBI )
+ {
+ LDLIBVAR="LD_32_LIBRARY_PATH";
+ } else {
+ LDLIBVAR="LD_LIBRARY_PATH";
+ }
-
if ( LibDir == "Auto")
- {
- stream2 << "\n# 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 << " while read TMP\n";
- stream2 << " do\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 < ${PROGDIR}/libdata/ldconfig/${i}\n";
- stream2 << " done\n";
- stream2 << "fi\n";
+ {
+ stream2 << "\n# 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 << " while read TMP\n";
+ stream2 << " do\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 < ${PROGDIR}/libdata/ldconfig/${i}\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";
+ stream2 << "\n#Setup our LD_LIBRARY_PATH variable with all found lib dirs\n";
+ stream2 << LDLIBVAR + "=\"${LDCONFIGDIRS}:${PROGDIR}/lib/:${PROGDIR}/kde4/lib:${PROGDIR}/lib/qt4\"\n";
+ stream2 << "export " + LDLIBVAR + "\n\n";
- } else if ( LibDir != "NONE" ) {
- stream2 << "LD_LIBRARY_PATH=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export LD_LIBRARY_PATH\n";
- }
+ } else if ( LibDir != "NONE" ) {
+ stream2 << LDLIBVAR + "=\"/Programs/" + ProgDirName + "/" + LibDir + "/\" ; export " + LDLIBVAR + "\n";
+ }
-
if ( RunShell[i] == "1" || NoCrashHandler[i] == "1" )
{
stream2 << "/Programs/" + ProgDirName + "/" + ExePath[i] + " \"$@\"";
More information about the Commits
mailing list