forked from qt-creator/qt-creator
Maemo: Use rpm for listing packages on Meego devices.
This commit is contained in:
@@ -81,7 +81,10 @@ void MaemoConfigTestDialog::startConfigTest()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_currentTest = GeneralTest;
|
m_currentTest = GeneralTest;
|
||||||
m_ui->testResultEdit->setPlainText(tr("Testing configuration..."));
|
const QString testingText = m_config->type() == MaemoDeviceConfig::Simulator
|
||||||
|
? tr("Testing configuration. This may take a while.")
|
||||||
|
: tr("Testing configuration...");
|
||||||
|
m_ui->testResultEdit->setPlainText(testingText);
|
||||||
m_closeButton->setText(tr("Stop Test"));
|
m_closeButton->setText(tr("Stop Test"));
|
||||||
m_testProcessRunner = SshRemoteProcessRunner::create(m_config->sshParameters());
|
m_testProcessRunner = SshRemoteProcessRunner::create(m_config->sshParameters());
|
||||||
connect(m_testProcessRunner.data(), SIGNAL(connectionError(Core::SshError)),
|
connect(m_testProcessRunner.data(), SIGNAL(connectionError(Core::SshError)),
|
||||||
@@ -91,9 +94,12 @@ void MaemoConfigTestDialog::startConfigTest()
|
|||||||
connect(m_testProcessRunner.data(),
|
connect(m_testProcessRunner.data(),
|
||||||
SIGNAL(processOutputAvailable(QByteArray)), this,
|
SIGNAL(processOutputAvailable(QByteArray)), this,
|
||||||
SLOT(processSshOutput(QByteArray)));
|
SLOT(processSshOutput(QByteArray)));
|
||||||
QLatin1String sysInfoCmd("uname -rsm");
|
const QLatin1String sysInfoCmd("uname -rsm");
|
||||||
QLatin1String qtInfoCmd("dpkg-query -W -f '${Package} ${Version} ${Status}\n' 'libqt*' "
|
const bool osUsesRpm = MaemoGlobal::packagingSystem(m_config->osVersion()) == MaemoGlobal::Rpm;
|
||||||
"|grep ' installed$'");
|
const QLatin1String qtInfoCmd(osUsesRpm
|
||||||
|
? "rpm -qa 'libqt*' --queryformat '%{NAME} %{VERSION}\\n'"
|
||||||
|
: "dpkg-query -W -f '${Package} ${Version} ${Status}\n' 'libqt*' "
|
||||||
|
"|grep ' installed$'");
|
||||||
QString command(sysInfoCmd + " && " + qtInfoCmd);
|
QString command(sysInfoCmd + " && " + qtInfoCmd);
|
||||||
m_testProcessRunner->run(command.toUtf8());
|
m_testProcessRunner->run(command.toUtf8());
|
||||||
}
|
}
|
||||||
@@ -229,8 +235,11 @@ QString MaemoConfigTestDialog::parseTestOutput()
|
|||||||
|
|
||||||
output = tr("Hardware architecture: %1\n").arg(unamePattern.cap(2));
|
output = tr("Hardware architecture: %1\n").arg(unamePattern.cap(2));
|
||||||
output.append(tr("Kernel version: %1\n").arg(unamePattern.cap(1)));
|
output.append(tr("Kernel version: %1\n").arg(unamePattern.cap(1)));
|
||||||
const QRegExp dkpgPattern(QLatin1String("(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+"));
|
const bool osUsesRpm = MaemoGlobal::packagingSystem(m_config->osVersion()) == MaemoGlobal::Rpm;
|
||||||
index = dkpgPattern.indexIn(m_deviceTestOutput);
|
const QRegExp packagePattern(QLatin1String(osUsesRpm
|
||||||
|
? "(libqt\\S+) ((\\d+)\\.(\\d+)\\.(\\d+))"
|
||||||
|
: "(\\S+) (\\S*(\\d+)\\.(\\d+)\\.(\\d+)\\S*) \\S+ \\S+ \\S+"));
|
||||||
|
index = packagePattern.indexIn(m_deviceTestOutput);
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
output.append(tr("No Qt packages installed."));
|
output.append(tr("No Qt packages installed."));
|
||||||
return output;
|
return output;
|
||||||
@@ -238,12 +247,12 @@ QString MaemoConfigTestDialog::parseTestOutput()
|
|||||||
|
|
||||||
output.append(tr("List of installed Qt packages:") + QLatin1Char('\n'));
|
output.append(tr("List of installed Qt packages:") + QLatin1Char('\n'));
|
||||||
do {
|
do {
|
||||||
output.append(QLatin1Char('\t') + dkpgPattern.cap(1) + QLatin1Char(' ')
|
output.append(QLatin1Char('\t') + packagePattern.cap(1) + QLatin1Char(' ')
|
||||||
+ dkpgPattern.cap(2) + QLatin1Char('\n'));
|
+ packagePattern.cap(2) + QLatin1Char('\n'));
|
||||||
index = dkpgPattern.indexIn(m_deviceTestOutput, index
|
index = packagePattern.indexIn(m_deviceTestOutput, index
|
||||||
+ dkpgPattern.cap(0).length());
|
+ packagePattern.cap(0).length());
|
||||||
if (!m_qtVersionOk && QT_VERSION_CHECK(dkpgPattern.cap(3).toInt(),
|
if (!m_qtVersionOk && QT_VERSION_CHECK(packagePattern.cap(3).toInt(),
|
||||||
dkpgPattern.cap(4).toInt(), dkpgPattern.cap(5).toInt()) >= 0x040602) {
|
packagePattern.cap(4).toInt(), packagePattern.cap(5).toInt()) >= 0x040602) {
|
||||||
m_qtVersionOk = true;
|
m_qtVersionOk = true;
|
||||||
}
|
}
|
||||||
} while (index != -1);
|
} while (index != -1);
|
||||||
|
|||||||
@@ -456,20 +456,36 @@ class MaemoDeviceConfigWizardFinalPage : public QWizardPage
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MaemoDeviceConfigWizardFinalPage(QWidget *parent) : QWizardPage(parent)
|
MaemoDeviceConfigWizardFinalPage(const WizardData &wizardData,
|
||||||
|
QWidget *parent)
|
||||||
|
: QWizardPage(parent),
|
||||||
|
m_infoLabel(new QLabel(this)),
|
||||||
|
m_wizardData(wizardData)
|
||||||
{
|
{
|
||||||
setTitle(tr("Setup Finished"));
|
setTitle(tr("Setup Finished"));
|
||||||
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
|
setSubTitle(QLatin1String(" ")); // For Qt bug (background color)
|
||||||
const QString infoText = tr("Setup is complete.\n"
|
m_infoLabel->setWordWrap(true);
|
||||||
"The new device configuration will now be created and a test "
|
|
||||||
"procedure will be run to check whether Qt Creator can "
|
|
||||||
"connect to the device and to provide some information "
|
|
||||||
"about its features.");
|
|
||||||
QLabel * const infoLabel = new QLabel(infoText, this);
|
|
||||||
infoLabel->setWordWrap(true);
|
|
||||||
QVBoxLayout * const layout = new QVBoxLayout(this);
|
QVBoxLayout * const layout = new QVBoxLayout(this);
|
||||||
layout->addWidget(infoLabel);
|
layout->addWidget(m_infoLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void initializePage()
|
||||||
|
{
|
||||||
|
QString infoText = tr("The new device configuration will now be "
|
||||||
|
"created and a test procedure will be run to check whether "
|
||||||
|
"Qt Creator can connect to the device and to provide some "
|
||||||
|
"information about its features.");
|
||||||
|
if (m_wizardData.deviceType == MaemoDeviceConfig::Simulator) {
|
||||||
|
infoText += QLatin1Char('\n')
|
||||||
|
+ tr("Please make sure that Qemu is running, otherwise "
|
||||||
|
"the test will fail.");
|
||||||
|
}
|
||||||
|
m_infoLabel->setText(infoText);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QLabel * const m_infoLabel;
|
||||||
|
const WizardData &m_wizardData;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
@@ -484,7 +500,7 @@ struct MaemoDeviceConfigWizardPrivate
|
|||||||
reuseKeysCheckPage(parent),
|
reuseKeysCheckPage(parent),
|
||||||
keyCreationPage(parent),
|
keyCreationPage(parent),
|
||||||
keyDeploymentPage(wizardData, parent),
|
keyDeploymentPage(wizardData, parent),
|
||||||
finalPage(parent)
|
finalPage(wizardData, parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>680</width>
|
<width>618</width>
|
||||||
<height>122</height>
|
<height>122</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="qemuButton">
|
<widget class="QRadioButton" name="qemuButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Emulator (Qemu, should be currently running)</string>
|
<string>Emulator (Qemu)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -300,6 +300,10 @@ QString MaemoGlobal::maemoVersionToString(MaemoVersion version)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MaemoGlobal::PackagingSystem MaemoGlobal::packagingSystem(MaemoVersion maemoVersion)
|
||||||
|
{
|
||||||
|
return maemoVersion == Meego ? Rpm : Dpkg;
|
||||||
|
}
|
||||||
|
|
||||||
MaemoGlobal::FileUpdate::FileUpdate(const QString &fileName)
|
MaemoGlobal::FileUpdate::FileUpdate(const QString &fileName)
|
||||||
: m_fileName(fileName)
|
: m_fileName(fileName)
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class MaemoGlobal
|
|||||||
Q_DECLARE_TR_FUNCTIONS(Qt4ProjectManager::Internal::MaemoGlobal)
|
Q_DECLARE_TR_FUNCTIONS(Qt4ProjectManager::Internal::MaemoGlobal)
|
||||||
public:
|
public:
|
||||||
enum MaemoVersion { Maemo5, Maemo6, Meego };
|
enum MaemoVersion { Maemo5, Maemo6, Meego };
|
||||||
|
enum PackagingSystem { Dpkg, Rpm };
|
||||||
|
|
||||||
class FileUpdate {
|
class FileUpdate {
|
||||||
public:
|
public:
|
||||||
@@ -99,6 +100,8 @@ public:
|
|||||||
|
|
||||||
static QString maemoVersionToString(MaemoVersion version);
|
static QString maemoVersionToString(MaemoVersion version);
|
||||||
|
|
||||||
|
static PackagingSystem packagingSystem(MaemoVersion maemoVersion);
|
||||||
|
|
||||||
static bool removeRecursively(const QString &filePath, QString &error);
|
static bool removeRecursively(const QString &filePath, QString &error);
|
||||||
|
|
||||||
template<class T> static T *buildStep(const ProjectExplorer::DeployConfiguration *dc)
|
template<class T> static T *buildStep(const ProjectExplorer::DeployConfiguration *dc)
|
||||||
|
|||||||
Reference in New Issue
Block a user