[PC-BSD Commits] r3293 - in pbibuild/pbi-source: PBIsource PBItext
svn at pcbsd.org
svn at pcbsd.org
Tue Jan 20 09:13:09 PST 2009
Author: kris
Date: 2009-01-20 09:13:08 -0800 (Tue, 20 Jan 2009)
New Revision: 3293
Modified:
pbibuild/pbi-source/PBIsource/pbi.cpp
pbibuild/pbi-source/PBItext/main.cpp
Log:
Updated the PBI installer, GUI and Text both. Fixed a few bugs:
* Now run kbuildsycoca4 after installing a PBI. This should help fix a bug where the newly installed program icons don't show up in the Kmenu right away
* Fixed a bug specifically in the text installer, that preventing typing "yes" when trying to accept a license agreement.
Modified: pbibuild/pbi-source/PBIsource/pbi.cpp
===================================================================
--- pbibuild/pbi-source/PBIsource/pbi.cpp 2009-01-20 15:39:41 UTC (rev 3292)
+++ pbibuild/pbi-source/PBIsource/pbi.cpp 2009-01-20 17:13:08 UTC (rev 3293)
@@ -2107,21 +2107,25 @@
void PBI::accept()
{
- // If the user indicated they wanted to launch the program, then do it before exiting
- if ( checkLaunch->isChecked() )
- {
+ QFile file( "postClose.sh" );
+ if ( file.open( IO_WriteOnly ) ) {
+ QTextStream stream( &file );
+ stream << "#!/bin/sh\n";
- QFile file( "postClose.sh" );
- if ( file.open( IO_WriteOnly ) ) {
- QTextStream stream( &file );
- stream << "#!/bin/sh\n";
- stream << "su " + RealUserName + " -c \"" + LaunchClose + "\" &";
- file.close();
- }
- system("chmod 755 postClose.sh" );
-
- }
+ // If the user indicated they wanted to launch the program, then do it before exiting
+ if ( checkLaunch->isChecked() )
+ {
+ stream << "(" + LaunchClose + ")& \n\n";
+ }
+ stream << "echo -e \"Rebuilding menu database...\\c\"\n";
+ stream << "kbuildsycoca4 >/dev/null 2>/dev/null\n";
+ stream << "echo -e \"Done!\"\n";
+
+ file.close();
+ }
+
+ system("chmod 755 postClose.sh" );
exit(0);
}
Modified: pbibuild/pbi-source/PBItext/main.cpp
===================================================================
--- pbibuild/pbi-source/PBItext/main.cpp 2009-01-20 15:39:41 UTC (rev 3292)
+++ pbibuild/pbi-source/PBItext/main.cpp 2009-01-20 17:13:08 UTC (rev 3293)
@@ -24,6 +24,7 @@
void acceptLicense(void);
void MassageGTKFiles(void);
void slotSetupCustomRemoveScript();
+void runKmenuRegen();
QString ProgramName;
QString ProgramVer;
@@ -118,10 +119,18 @@
readSettingsSlot();
StartInstall();
+ runKmenuRegen();
cout << "Installation complete!\n";
}
+void runKmenuRegen()
+{
+ system("echo -e \"Rebuilding Menu Database...\\c\"");
+ system("kbuildsycoca4 >/dev/null 2>/dev/null");
+ system("echo -e \"Done!\"");
+}
+
void StartInstall(void)
{
@@ -182,7 +191,7 @@
QFile file4( "extract.sh" );
if ( file4.open( QIODevice::WriteOnly ) ) {
QTextStream stream4( &file4 );
- stream4 << "#!/bin/sh\nSKIP=`cat pbiskip`\ntail +${SKIP} pbilink | ./lzma d -si -so | tar xpov -C \"${1}\" -f - >/dev/null 2>/dev/null";
+ stream4 << "#!/bin/sh\nSKIP=`cat pbiskip`\ntail +${SKIP} pbilink | ./lzma d -si -so 2>/dev/null | tar xpov -C \"${1}\" -f - >/dev/null 2>/dev/null";
file4.close();
}
@@ -380,8 +389,8 @@
{
if ( LibDir == "Auto")
{
- QString command = "cp -Rf autolibs /Programs/" + ProgDirName + "/";
- QString inputLine = getLineFromCommandOutput(command);
+ //QString command = "cp -Rf autolibs /Programs/" + ProgDirName + "/";
+ //QString inputLine = getLineFromCommandOutput(command);
CreateConfigSlot();
} else {
@@ -1289,33 +1298,23 @@
if ( file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
QString line;
- int i = 1;
while ( !stream.atEnd() ) {
line = stream.readLine(); // line of text excluding '\n'
cout << line.toStdString();
cout << "\n";
-
- i++;
-
- if ( i == 15)
- {
- cout << "\nPress ENTER for more..";
- getchar();
- i = 1;
- }
}
file.close();
}
- cout << "\nDo you agree to these license terms? (Type yes/no):";
- string input;
- getline(cin, input);
+ cout << "\nDo you agree to these license terms? (Enter y/n):";
+ char input;
+ input = getchar();
QString answer;
- answer.fromStdString(input);
-
- if (answer.toUpper() == "YES")
+ answer = input;
+ answer.simplified();
+ if ( answer.toUpper() == "Y")
{
cout << "\nContinuing with Install...\n";
} else {
More information about the Commits
mailing list