Commit 0273f9a4 authored by Luca Giambonini's avatar Luca Giambonini

update the debian files to build against qt5

parent 07c8f730
......@@ -2,11 +2,11 @@ Source: akabeicore
Section: unknown
Priority: extra
Maintainer: Luca Giambonini <gluca86@gmail.com>
Build-Depends: debhelper (>= 8.0.0), cmake, libqt4-dev, libarchive-dev, libsqlite3-dev, libpolkit-qt-1-dev, translate-toolkit, pkg-config
Build-Depends: debhelper (>= 8.0.0), cmake, libarchive13, libsqlite3-dev, libpolkit-qt5-1-dev, translate-toolkit, pkg-config, libqt5core5a, libqt5dbus5, libqt5network5, libqt5concurrent5
Standards-Version: 3.9.3
Homepage: http://chakraos.org
Vcs-Git: git://gitorious.org/chakra/akabeicore.git
Vcs-Browser: https://git.gitorious.org/chakra/akabeicore.git
Homepage: https://chakralinux.org
Vcs-Git: git@code.chakralinux.org:tools/akabeicore.git
Vcs-Browser: https://code.chakralinux.org/tools/akabeicore
Package: akabeicore
Architecture: any
......
akabeicore-dbgsym_1.0.2-1_amd64.deb debug extra
akabeicore_1.0.2-1_amd64.buildinfo unknown extra
akabeicore_1.0.2-1_amd64.deb unknown extra
Description: <short summary of the patch>
TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.
.
akabeicore (1.0.1-1) unstable; urgency=low
.
* Fix scriptlet generation during add pkgs to the database
Author: Luca Giambonini <gluca86@gmail.com>
---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:
Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>
--- akabeicore-1.0.1.orig/lib/akabeihelpers.cpp
+++ akabeicore-1.0.1/lib/akabeihelpers.cpp
@@ -955,10 +955,6 @@ int QueryPerformer::insertFiles(Abstract
QString sqlQuery = "INSERT INTO files ('package', 'file', 'backup', 'ultimateowner') VALUES (:Package, :File, :Backup, :UltimateOwner);";
try {
- QVariantList packages;
- QVariantList files;
- QVariantList backup;
- QVariantList uoList;
QStringList dirs;
QStringList sortedFiles = p->retrieveFiles(Package::FilepathNoPrefix);
sortedFiles.sort();
@@ -974,40 +970,35 @@ int QueryPerformer::insertFiles(Abstract
dirs.removeAll(dir);
}
}
- packages.append(QVariant::fromValue<int>(p->databaseId()));
- files.append(QVariant::fromValue<QString>(file));
+ dbConnection.bind(":Package", p->databaseId());
+ dbConnection.bind(":File", file);
if (p->backupFiles().contains(file)) {
- backup.append(QVariant::fromValue<QString>(p->backupFiles()[file]));
+ dbConnection.bind(":Backup", p->backupFiles()[file]);
} else {
- backup.append(QVariant::fromValue<QString>(null));
+ dbConnection.bind(":Backup", QString());
}
if (p->ultimatelyOwnedFiles().contains(file)) {
- uoList.append(QVariant::fromValue<bool>(true));
+ dbConnection.bind(":UltimateOwner", 1);
} else {
- uoList.append(QVariant::fromValue<bool>(false));
+ dbConnection.bind(":UltimateOwner", 0);
}
+ dbConnection.query(sqlQuery);
}
foreach (const QString &dir, dirs) {
- packages.append(QVariant::fromValue<int>(p->databaseId()));
- files.append(QVariant::fromValue<QString>(dir));
+ dbConnection.bind(":Package", p->databaseId());
+ dbConnection.bind(":File", dir);
if (p->backupFiles().contains(dir)) {
- backup.append(QVariant::fromValue<QString>(p->backupFiles()[dir]));
+ dbConnection.bind(":Backup", p->backupFiles()[dir]);
} else {
- backup.append(QVariant::fromValue<QString>(null));
+ dbConnection.bind(":Backup", QString());
}
if (p->ultimatelyOwnedFiles().contains(dir)) {
- uoList.append(QVariant::fromValue<bool>(true));
+ dbConnection.bind(":UltimateOwner", 1);
} else {
- uoList.append(QVariant::fromValue<bool>(false));
+ dbConnection.bind(":UltimateOwner", 0);
}
+ dbConnection.query(sqlQuery);
}
-
- QVariantMap map;
- map.insert(":Package", QVariant(packages));
- map.insert(":File", QVariant(files));
- map.insert(":Backup", QVariant(backup));
- map.insert(":UltimateOwner", QVariant(uoList));
- dbConnection.query(sqlQuery, map);
} catch (SQLiteException& e) {
return SQLITE_ABORT;
}
@@ -1031,6 +1022,7 @@ int QueryPerformer::updateFiles(Abstract
return result;
}
+//TODO: Port away from multiquery!!!
int QueryPerformer::updateFiles(AbstractSQLiteConnection &dbConnection, Package* from, Package* to)
{
QString sqlQuery;
@@ -1072,36 +1064,24 @@ int QueryPerformer::updateFiles(Abstract
dbConnection.query(sqlQuery);
}
- //This query will most likely be executed a lot of times, so let's make it a multiple one
sqlQuery = "UPDATE files SET file=:File, package=:ToPackage, backup=:Backup, ultimateowner=:UltimateOwner WHERE package=:FromPackage AND file=:File;";
- QVariantList fromPackages;
- QVariantList toPackages;
- QVariantList files;
- QVariantList backup;
- QVariantList uoList;
foreach (const QString &file, update) {
- fromPackages.append(QVariant::fromValue<int>(from->databaseId()));
- toPackages.append(QVariant::fromValue<int>(to->databaseId()));
- files.append(QVariant::fromValue<QString>(file));
+ dbConnection.bind(":FromPackage", from->databaseId());
+ dbConnection.bind(":ToPackage", to->databaseId());
+ dbConnection.bind(":File", file);
if (backups.contains(file)) {
- backup.append(QVariant::fromValue<QString>(backups[file]));
+ dbConnection.bind(":Backup", backups[file]);
} else {
- backup.append(QVariant::fromValue<QString>(null));
+ dbConnection.bind(":Backup", QString());
}
if (to->ultimatelyOwnedFiles().contains(file)) {
- uoList.append(QVariant::fromValue<bool>(true));
+ dbConnection.bind(":UltimateOwner", 1);
} else {
- uoList.append(QVariant::fromValue<bool>(false));
+ dbConnection.bind(":UltimateOwner", 0);
}
+ dbConnection.query(sqlQuery);
}
- QVariantMap map;
- map.insert(":FromPackage", QVariant(fromPackages));
- map.insert(":ToPackage", QVariant(toPackages));
- map.insert(":File", QVariant(files));
- map.insert(":Backup", QVariant(backup));
- map.insert(":UltimateOwner", QVariant(uoList));
- dbConnection.query(sqlQuery, map);
} catch (SQLiteException& e) {
return SQLITE_ABORT;
}
--- akabeicore-1.0.1.orig/tools/akabei-create-db/createdb.cpp
+++ akabeicore-1.0.1/tools/akabei-create-db/createdb.cpp
@@ -8,7 +8,6 @@
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
*/
-
#include "createdb.h"
#include <akabeipackage.h>
#include <akabeibackend.h>
@@ -49,6 +48,8 @@ CreateDb::CreateDb(const QString& db, co
m_startDateTime = QDateTime::currentDateTime();
out << "------- Akabei Create Database - started at " << m_startDateTime.toString() << " -------" << endl << endl;
+
+ Akabei::Config::instance()->setDebug(true);
}
CreateDb::~CreateDb()
scriptlet.patch
query_speedup
......@@ -9,5 +9,8 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_TESTS=OFF
%:
dh $@
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment