Commit 5aa78d68 authored by AlmAck's avatar AlmAck

Merge branch 'replace'

parents 37b839a6 97d4416d
......@@ -92,6 +92,6 @@ enum OperationName {
PrintFiles
};
typedef enum OperationName OperationName;
};
}
#endif
\ No newline at end of file
#endif
......@@ -377,13 +377,14 @@ int main(int argc, char **argv)
QByteArray("0.0.1"),
QObject::tr("Chakra's CLI package manager"),
AkabeiLicense::License_GPL_V2,
QObject::tr("(C) 2011 - 2015 The Akabei Developers"),
QObject::tr("<a href=\"mailto:boom1992@chakra-project.org\">boom1992@chakra-project.org</a>"),
"http://chakraos.org",
"http://chakraos.org/bugtracker/"
QObject::tr("(C) 2011 - 2016 The Akabei Developers"),
QObject::tr("<a href=\"mailto:boom1992@chakraos.org\">boom1992@chakraos.org</a>"),
"https://chakraos.org",
"https://chakraos.org/bugtracker/"
);
aboutData.addAuthor("Lukas Appelhans", QObject::tr("Maintainer"), "boom1992@chakra-project.org");
aboutData.addAuthor("Lisa Vitolo", QObject::tr("Maintainer"), "shainer@chakra-project.org");
aboutData.addAuthor("Lukas Appelhans", QObject::tr("Maintainer"), "boom1992@chakraos.org");
aboutData.addAuthor("Luca Giambonini", QObject::tr("Maintainer"), "almack@chakraos.org");
aboutData.addAuthor("Lisa Vitolo", QObject::tr("Contributor"), "");
CommandLineParser *parser = NULL;
QTextStream err(stderr);
......
......@@ -366,13 +366,15 @@ void QueryOperation::showOwner(const QStringList &queries)
foreach (const QString& query, queries) {
QString cleaned = QFileInfo(query).canonicalFilePath();
if (cleaned.isEmpty()) {
err << Akabei::errorPrefix << QObject::tr("File does not exists: %1").arg(query) << endl;
err << Akabei::errorPrefix << QObject::tr("File does not exist: %1").arg(query) << endl;
err.flush();
nextOperation();
return;
}
cleaned.remove(Akabei::Config::instance()->root());
// remove the first "/" (current root)
cleaned.remove(0,1);
//TODO: bash completition
qDebug() << "Cleaned is" << cleaned;
Akabei::Package::List result =
......
......@@ -179,7 +179,7 @@ void QueueOperation::transactionCreated(AkabeiClient::Transaction* t)
}
if (t->isValid()) {
out << QObject::tr("Validating transaction...") << "\r";
out << QObject::tr("Validating transaction...") << "\n";
AkabeiClient::Backend::instance()->transactionHandler()->validate();
} else {
err << Akabei::errorPrefix << QObject::tr("Invalid transaction, quitting...") << endl;
......@@ -270,7 +270,7 @@ void QueueOperation::validationFinished(bool valid)
installSize -= i->installedSize();
}
if (!m_transaction->toBeRemoved().isEmpty()) {
out << QObject::tr("The following packages are going to be removed: ");
out << '\n' << QObject::tr("The following packages are going to be removed:") << '\n';
foreach (Akabei::Package * pkg, m_transaction->toBeRemoved()) {
if (pkg != *(m_transaction->toBeRemoved().begin()))
out << QObject::tr(", ");
......@@ -279,7 +279,7 @@ void QueueOperation::validationFinished(bool valid)
out << endl;
}
if (!m_transaction->toBeInstalled().isEmpty()) {
out << QObject::tr("The following packages are going to be installed: ");
out << '\n' << QObject::tr("The following packages are going to be installed:") << '\n';
foreach (Akabei::Package * pkg, m_transaction->toBeInstalled()) {
if (pkg != *(m_transaction->toBeInstalled().begin()))
out << QObject::tr(", ");
......@@ -288,7 +288,7 @@ void QueueOperation::validationFinished(bool valid)
out << endl;
}
if (!m_transaction->toBeUpgraded().isEmpty()) {
out << QObject::tr("The following packages are going to be upgraded: ");
out << '\n' << QObject::tr("The following packages are going to be upgraded:") << '\n';
foreach (Akabei::Package* old, m_transaction->toBeUpgraded().keys()) {
if (old != *(m_transaction->toBeUpgraded().keys().begin()))
out << QObject::tr(", ");
......@@ -298,7 +298,7 @@ void QueueOperation::validationFinished(bool valid)
out << endl;
}
if (!m_transaction->toBeReinstalled().isEmpty()) {
out << QObject::tr("The following packages are going to be reinstalled: ");
out << '\n' << QObject::tr("The following packages are going to be reinstalled:") << '\n';
foreach (Akabei::Package * pkg, m_transaction->toBeReinstalled()) {
if (pkg != *(m_transaction->toBeReinstalled().begin()))
out << QObject::tr(", ");
......@@ -306,6 +306,19 @@ void QueueOperation::validationFinished(bool valid)
}
out << endl;
}
if (!m_transaction->toBeReplaced().isEmpty()) {
out << '\n' << QObject::tr("The following packages are going to be replaced:") << '\n';
foreach (Akabei::Package* pkg, m_transaction->toBeReplaced().keys()) {
QList<Akabei::Package*> older = m_transaction->toBeReplaced().value(pkg);
out << pkg->name() << " -> (";
foreach(Akabei::Package* replaced, older){
out << replaced->name();
out << QObject::tr(", ");
}
out << ")";
}
out << endl;
}
out << endl;
if (downloadSize > 0) {
out << QObject::tr("Download size: %1").arg(Akabei::Helpers::formatByteSize(downloadSize)) << endl;
......@@ -316,7 +329,7 @@ void QueueOperation::validationFinished(bool valid)
out << QObject::tr("Freed size after transaction: %1").arg(Akabei::Helpers::formatByteSize(installSize * (-1))) << endl;
}
out << QObject::tr("Continue with processing?[Y/n]");
out << QObject::tr("Continue with processing? [Y/n]");
out.flush();
if (!m_options.contains(APM::NoConfirm)) {
std::string input;
......
FILE(GLOB_RECURSE PO_FILES *.po)
FIND_PROGRAM(PO2TS_EXECUTABLE
NAMES po2ts
)
IF(NOT PO2TS_EXECUTABLE)
MESSAGE(FATAL_ERROR "Unable to find the ‘po2ts’ executable, from the Translation Toolkit project.")
ENDIF(NOT PO2TS_EXECUTABLE)
add_translations(akabei ${PO_FILES})
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
NAMES lrelease
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
IF(NOT QT_LRELEASE_EXECUTABLE)
MESSAGE(FATAL_ERROR "Qt4 lrelease not found. Make sure that it has been built and installed by the Qt4 package.")
ENDIF(NOT QT_LRELEASE_EXECUTABLE)
MACRO(GENERATE_TS_FILES_FROM_PO_FILES TS_FILES)
FOREACH(CURRENT_FILE ${ARGN})
GET_FILENAME_COMPONENT(PO_FILE ${CURRENT_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(PO_FILE_NAME ${CURRENT_FILE} NAME_WE)
SET(TS_FILE ${CMAKE_CURRENT_BINARY_DIR}/akabei_${PO_FILE_NAME}.ts)
ADD_CUSTOM_COMMAND(
OUTPUT ${TS_FILE}
COMMAND ${PO2TS_EXECUTABLE}
ARGS ${PO_FILE} ${TS_FILE}
DEPENDS ${PO_FILE}
)
SET(${TS_FILES} ${${TS_FILES}} ${TS_FILE})
ENDFOREACH(CURRENT_FILE)
ENDMACRO(GENERATE_TS_FILES_FROM_PO_FILES)
MACRO(GENERATE_QM_FILES_FROM_TS_FILES _sources)
FOREACH(_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_in ${_current_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(_basename ${_current_FILE} NAME_WE)
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.qm)
ADD_CUSTOM_COMMAND(
OUTPUT ${_out}
COMMAND ${QT_LRELEASE_EXECUTABLE}
ARGS -verbose ${_in} -qm ${_out}
DEPENDS ${_in}
)
SET(${_sources} ${${_sources}} ${_out})
ENDFOREACH(_current_FILE)
ENDMACRO(GENERATE_QM_FILES_FROM_TS_FILES)
FILE(GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
GENERATE_TS_FILES_FROM_PO_FILES(TS_FILES ${PO_FILES})
GENERATE_QM_FILES_FROM_TS_FILES(QM_FILES ${TS_FILES})
ADD_CUSTOM_TARGET(translations ALL DEPENDS ${QM_FILES})
INSTALL(CODE "MESSAGE(\"Installing Akabei i18n files...\")")
INSTALL(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/akabe/translations)
......@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-15 00:12+0200\n"
"POT-Creation-Date: 2016-01-19 23:23+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -287,12 +287,11 @@ msgid "Chakra's CLI package manager"
msgstr ""
#: QObject#68
msgid "(C) 2011 - 2015 The Akabei Developers"
msgid "(C) 2011 - 2016 The Akabei Developers"
msgstr ""
#: QObject#69
msgid ""
"<a href=\"mailto:boom1992@chakra-project.org\">boom1992@chakra-project.org</a>"
msgid "<a href=\"mailto:boom1992@chakraos.org\">boom1992@chakraos.org</a>"
msgstr ""
#: QObject#70
......@@ -300,157 +299,161 @@ msgid "Maintainer"
msgstr ""
#: QObject#71
msgid "Use \"%1 %2\" to display a help message."
msgid "Contributor"
msgstr ""
#: QObject#72
msgid "Perform type"
msgid "Use \"%1 %2\" to display a help message."
msgstr ""
#: QObject#73
msgid "Query type"
msgid "Perform type"
msgstr ""
#: QObject#74
msgid "Remove type"
msgid "Query type"
msgstr ""
#: QObject#75
msgid "Sync type"
msgid "Remove type"
msgstr ""
#: QObject#76
msgid "Upgrade type"
msgid "Sync type"
msgstr ""
#: QObject#77
msgid "No type"
msgid "Upgrade type"
msgstr ""
#: QObject#78
msgid "Usage: "
msgid "No type"
msgstr ""
#: QObject#79
msgid " operation [options] [arguments]."
msgid "Usage: "
msgstr ""
#: QObject#80
msgid "Akabei operations:"
msgid " operation [options] [arguments]."
msgstr ""
#: QObject#81
msgid "Akabei options:"
msgid "Akabei operations:"
msgstr ""
#: QObject#82
msgid " was written by"
msgid "Akabei options:"
msgstr ""
#: QObject#83
msgid "Please use "
msgid " was written by"
msgstr ""
#: QObject#84
msgid " to report bugs."
msgid "Please use "
msgstr ""
#: QObject#85
msgid "Invalid package argument supplied: %1"
msgid " to report bugs."
msgstr ""
#: QObject#86
msgid "| %1 remaining"
msgid "Invalid package argument supplied: %1"
msgstr ""
#: QObject#87
msgid "Operation not supported."
msgid "| %1 remaining"
msgstr ""
#: QObject#88
msgid "No package found!"
msgid "Operation not supported."
msgstr ""
#: QObject#89
msgid "Unknown group: %1"
msgid "No package found!"
msgstr ""
#: QObject#90
msgid "No changelog available!"
msgid "Unknown group: %1"
msgstr ""
#: QObject#91
msgid "%1: %2 overall files, %3 file(s) missing!"
msgid "No changelog available!"
msgstr ""
#: QObject#92
msgid "File does not exists: %1"
msgid "%1: %2 overall files, %3 file(s) missing!"
msgstr ""
#: QObject#93
msgid "No package owns %1"
msgid "File does not exist: %1"
msgstr ""
#: QObject#94
msgid "%1 is owned by %2 %3!"
msgid "No package owns %1"
msgstr ""
#: QObject#95
msgid "%1 is owned by %2 %3!"
msgstr ""
#: QObject#96
msgid ""
"Unable to find the requested package(s) among the installed ones. "
"Quitting..."
msgstr ""
#: QObject#96
#: QObject#97
msgid "Unable to find the requested package(s). Quitting..."
msgstr ""
#: QObject#97
#: QObject#98
msgid "Calculating dependencies..."
msgstr ""
#: QObject#98
#: QObject#99
msgid "An unresolveable error occurred!"
msgstr ""
#: QObject#99
#: QObject#100
msgid "/"
msgstr ""
#: QObject#100
#: QObject#101
msgid "Default:"
msgstr ""
#: QObject#101
#: QObject#102
msgid "]"
msgstr ""
#: QObject#102
#: QObject#103
msgid "Validating transaction..."
msgstr ""
#: QObject#103
#: QObject#104
msgid "Invalid transaction, quitting..."
msgstr ""
#: QObject#104
#: QObject#105
msgid "The transaction could not be validated:"
msgstr ""
#: QObject#105
#: QObject#106
msgid "The targets specified for the operation are not valid. Quitting..."
msgstr ""
#: QObject#106
#: QObject#107
msgid "System is up-to-date."
msgstr ""
#: QObject#107
#: QObject#108
msgid "Transaction validated successfully."
msgstr ""
# The queue could not be validated, the following packages have the package(s) marked to be removed as dependencies:
#: QObject#108
#: QObject#109
#, fuzzy
msgid ""
"The queue could not be validated, the following package has the package(s) "
......@@ -460,92 +463,96 @@ msgstr ""
" \n"
" "
#: QObject#109
#: QObject#110
msgid "The following packages are going to be removed: "
msgstr ""
#: QObject#110
#: QObject#111
msgid ", "
msgstr ""
#: QObject#111
#: QObject#112
msgid "The following packages are going to be installed: "
msgstr ""
#: QObject#112
#: QObject#113
msgid "The following packages are going to be upgraded: "
msgstr ""
#: QObject#113
#: QObject#114
msgid "The following packages are going to be reinstalled: "
msgstr ""
#: QObject#114
#: QObject#115
msgid "The following packages are going to be replaced: "
msgstr ""
#: QObject#116
msgid "Download size: %1"
msgstr ""
#: QObject#115
#: QObject#117
msgid "Install size: %1"
msgstr ""
#: QObject#116
#: QObject#118
msgid "Freed size after transaction: %1"
msgstr ""
#: QObject#117
msgid "Continue with processing?[Y/n]"
#: QObject#119
msgid "Continue with processing? [Y/n]"
msgstr ""
#: QObject#118
#: QObject#120
msgid "y"
msgstr ""
# (y)es, answer to a question
#: QObject#119
#: QObject#121
msgid "Y"
msgstr ""
#: QObject#120
#: QObject#122
msgid "Total progress:"
msgstr ""
#: QObject#121
#: QObject#123
msgid "Validating..."
msgstr ""
#: QObject#122
#: QObject#124
msgid "Running PreHooks..."
msgstr ""
#: QObject#123
#: QObject#125
msgid "Downloading..."
msgstr ""
#: QObject#124
#: QObject#126
msgid "Processing..."
msgstr ""
#: QObject#125
#: QObject#127
msgid "Running Scriplets..."
msgstr ""
#: QObject#126
#: QObject#128
msgid "Running PostHooks..."
msgstr ""
#: QObject#127
#: QObject#129
msgid "Cleaning..."
msgstr ""
#: QObject#128
#: QObject#130
msgid "Finished!"
msgstr ""
#: QObject#129
#: QObject#131
msgid "The transaction finished successfully!"
msgstr ""
#: QObject#130
#: QObject#132
#, fuzzy
msgid "%n error(s) occurred during the transaction: "
msgstr ""
......@@ -553,336 +560,340 @@ msgstr ""
" \n"
" "
#: QObject#131
#: QObject#133
msgid "Starting database update ..."
msgstr ""
#: QObject#132
#: QObject#134
msgid ":: System is up-to-date."
msgstr ""
#: QObject#133
#: QObject#135
msgid "No packages found!"
msgstr ""
#: QObject#134
#: QObject#136
msgid "[Installed]"
msgstr ""
#: QObject#135
#: QObject#137
msgid "[Upgradeable]"
msgstr ""
#: QObject#136
#: QObject#138
msgid "None"
msgstr ""
#: QObject#137
#: QObject#139
msgid "local"
msgstr ""
#: QObject#138
#: QObject#140
msgid "No repository found!"
msgstr ""
#: QObject#139
#: QObject#141
msgid "[Installed: %1]"
msgstr ""
#: QObject#140
#: QObject#142
msgid "No group found!"
msgstr ""
#: QObject#141
#: QObject#143
msgid "Updating all databases finished"
msgstr ""
#: QObject#142
#: QObject#144
msgid "There has been an error while updating %1:"
msgstr ""
#: QObject#143
#: QObject#145
msgid "%1 already up to date!"
msgstr ""
#: QObject#144
#: QObject#146
msgid "%1 could not be updated!"
msgstr ""
#: QObject#145
#: QObject#147
msgid "%1 updated!"
msgstr ""
#: QObject#146
#: QObject#148
msgid "[!!] Configuration file \"%1\" doesn't exist."
msgstr ""
#: QObject#147
#: QObject#149
msgid "Please create one before continuing."
msgstr ""
#: QObject#148
#: QObject#150
msgid ":: Akabei's cache cleaner tool"
msgstr ""
#: QObject#149
#: QObject#151
msgid "Sets cache directory"
msgstr ""
#: QObject#150
#: QObject#152
msgid "Sets database directory"
msgstr ""
#: QObject#151
#: QObject#153
msgid "Never delete <package> from cache"
msgstr ""
#: QObject#152
#: QObject#154
msgid "Clean the oldest packages in cache"
msgstr ""
#: QObject#153
#: QObject#155