feat(files): confirm dropped files and refuse the ones already installed

A drop — or "Ouvrir avec PacManager" — answered nothing: a Flatpak
install walked off into the background and a plugin package landed
without a sound, so the gesture read as ignored. Both now open a
dialog saying what was taken and what it starts.

A file the machine already has is refused before anything runs, and
named. The application a file would install is read out of the file
itself (the [Flatpak Ref] section of a .flatpakref, the header of a
.flatpak bundle, the manifest of a .fwspacm) and compared with what
the provider has, so nothing is started to find out: Flatpak would
otherwise skip the install and report a success the user never got,
and a plugin package would silently replace the one in place.
This commit is contained in:
BlackAngelTV committed 2026-10-09 19:22:24 +02:00
1 parent f4aa661b54
commit 55718064a6
16 files changed
+557 -9

No files matched your search

+83 -1
View File
@@ -1070,14 +1070,36 @@ void MainWindow::dropEvent(QDropEvent* event) {
void MainWindow::installLocalFiles(const QStringList& paths) {
if (paths.isEmpty()) return;
QStringList files;
QStringList files; // handed to a provider, one at a time
QStringList plugins; // installed on the spot
QStringList installedPackages; // already on the machine: refused
QStringList installedPlugins;
QStringList rejected;
for (const QString& path : paths) {
// A file whose application is already there is refused before anything
// runs: flatpak would skip it and report a success the user did not
// get, and re-installing a plugin package would silently replace the
// one in place.
const AppCore::FileTarget target = m_core->fileTarget(path);
if (target.installed) {
(target.plugin ? installedPlugins : installedPackages) << target.name;
LogManager::instance().logEvent(
QStringLiteral("fichier"),
tr("%1 : déjà installé, rien à faire").arg(target.name));
continue;
}
// A plugin package is installed by the core straight away: it needs no
// provider, no password and no queue, and the registry is reloaded when
// it lands (see AppCore::installPluginPackage).
if (m_core->isPluginPackage(path)) {
m_core->installPluginPackage(path);
// Only announced when its manifest could be read: a package the
// reader refuses installs nothing and is reported by the Plugins
// screen, and the window must not promise an install that is not
// happening.
if (!target.name.isEmpty()) plugins << path;
continue;
}
if (m_core->canInstallFile(path)) files << path;
@@ -1094,6 +1116,11 @@ void MainWindow::installLocalFiles(const QStringList& paths) {
.arg(QFileInfo(rejected.first()).fileName()));
}
// Nothing else in the window would tell the user their gesture landed: a
// drop starts a background install, or a plugin goes in without a sound.
announceAcceptedFiles(files, plugins);
announceInstalledFiles(installedPackages, installedPlugins);
if (files.isEmpty()) return;
LogManager::instance().logEvent(
@@ -1103,6 +1130,61 @@ void MainWindow::installLocalFiles(const QStringList& paths) {
if (!m_fileInstallRunning) startNextFileInstall();
}
// What the window says about the files it just took. Without it, a drop that
// starts a background install — or a plugin that lands silently — reads as a
// gesture the application ignored.
void MainWindow::announceAcceptedFiles(const QStringList& installing,
const QStringList& plugins) {
if (installing.isEmpty() && plugins.isEmpty()) return;
QStringList lines;
for (const QString& path : installing) {
lines << tr("<b>%1</b> pris en compte : l'installation démarre, sa "
"progression s'affiche en bas de la fenêtre.")
.arg(QFileInfo(path).fileName());
}
for (const QString& path : plugins) {
lines << tr("<b>%1</b> pris en compte : le plugin est installé et "
"utilisable sans redémarrer.")
.arg(QFileInfo(path).fileName());
}
QMessageBox box(this);
box.setWindowTitle(tr("Fichiers pris en compte"));
box.setIcon(QMessageBox::Information);
box.setTextFormat(Qt::RichText);
box.setText(lines.join(QStringLiteral("<br>")));
box.setStandardButtons(QMessageBox::Ok);
box.exec();
}
// The other half of the answer: a file the machine already has is refused, and
// the user is told which one it is and what to do instead.
void MainWindow::announceInstalledFiles(const QStringList& packages,
const QStringList& plugins) {
if (packages.isEmpty() && plugins.isEmpty()) return;
QStringList lines;
for (const QString& name : packages) {
lines << tr("<b>%1</b> est déjà installé : il n'y a rien à installer. "
"Sa mise à jour se fait depuis l'écran des mises à jour.")
.arg(name);
}
for (const QString& name : plugins) {
lines << tr("<b>%1</b> : ce plugin est déjà installé. Supprimez-le "
"depuis l'écran Extensions pour en installer un autre.")
.arg(name);
}
QMessageBox box(this);
box.setWindowTitle(tr("Déjà installé"));
box.setIcon(QMessageBox::Information);
box.setTextFormat(Qt::RichText);
box.setText(lines.join(QStringLiteral("<br>")));
box.setStandardButtons(QMessageBox::Ok);
box.exec();
}
void MainWindow::startNextFileInstall() {
if (m_pendingFileInstalls.isEmpty()) {
m_fileInstallRunning = false;
+9 -1
View File
@@ -58,7 +58,9 @@ public:
// Installs the Flatpak files handed over by the desktop: dropped on the
// window, or opened from the file manager ("Ouvrir avec PacManager", which
// passes them on the command line). One install runs at a time; the rest
// wait in line. Paths the core does not recognise are reported and skipped.
// wait in line. Paths the core does not recognise are reported and skipped,
// a file the machine already has is refused, and both answers are told to
// the user in a dialog — the gesture is the only thing they see.
void installLocalFiles(const QStringList& paths);
protected:
@@ -174,6 +176,12 @@ private:
// Takes the next queued file and asks the core to install it. A core busy
// with another operation leaves it queued: onCoreActionFinished calls back.
void startNextFileInstall();
// What the user is told about the files just handed over: which ones were
// taken (and what each of them starts), and which ones were refused because
// the machine already has them. Two dialogs, since the two answers ask for
// different things from the user.
void announceAcceptedFiles(const QStringList& installing, const QStringList& plugins);
void announceInstalledFiles(const QStringList& packages, const QStringList& plugins);
// Logic layer: it owns the providers, the workers, the history, the
// credentials and the self-updater. The frame never talks to them directly.
+30
View File
@@ -544,6 +544,36 @@ bool AppCore::isPluginPackage(const QString& path) const {
return PluginPackage::isPackagePath(path);
}
AppCore::FileTarget AppCore::fileTarget(const QString& path) const {
FileTarget target;
const QString clean = path.trimmed();
if (clean.isEmpty()) return target;
// A plugin package names itself in its own manifest, and the registry knows
// whether that plugin is already there. Read only: nothing is written
// before the window has decided what to tell the user.
if (isPluginPackage(clean)) {
QString error;
const PluginPackage::Contents contents = PluginPackage::read(clean, &error);
if (!error.isEmpty()) return target; // unusable: nothing to announce
target.name = contents.manifest.id;
target.plugin = true;
target.installed = m_packages->isInstalled(target.name);
return target;
}
// A provider file: the provider owning the format names the application it
// would install, and answers whether it is already deployed.
for (IPackageManager* pm : availableProviders()) {
const std::string name = pm->fileTargetName(clean.toStdString());
if (name.empty()) continue;
target.name = QString::fromStdString(name);
target.installed = pm->isPackageInstalled(name);
return target;
}
return target;
}
AppCore::StartResult AppCore::removePackages(const std::vector<PackageInfo>& packages,
const QString& description) { Request request;
request.action = QStringLiteral("cleanup");
+17
View File
@@ -121,6 +121,23 @@ public:
// by a provider: they carry a plugin, they are not packages to install, so
// they never take the sudo gate and never enter the file install queue.
bool isPluginPackage(const QString& path) const;
// What a file the user drops (or opens with PacManager) would install, and
// whether that application is already on the machine. Read before anything
// runs, so the view can refuse a file the provider would only skip — or an
// install that would silently do nothing — and say why.
struct FileTarget {
// Application id for a provider file ("com.example.App"), plugin id for
// a .fwspacm. Empty when the file names no single application: a
// .flatpakrepo registers a remote, and an unreadable file names
// nothing at all.
QString name;
bool installed = false;
// A .fwspacm carries a plugin, not a package: the two are refused with
// different advice.
bool plugin = false;
};
FileTarget fileTarget(const QString& path) const;
// Bulk removal: one command per provider, run one provider at a time
// (pacman locks its database for the whole operation).
StartResult removePackages(const std::vector<PackageInfo>& packages,
+18
View File
@@ -64,6 +64,24 @@ d'un coup s'installent **un par un** (le core n'accepte qu'une opération à la
fois) ; un paquet `.fwspacm`, lui, s'installe immédiatement, sans mot de passe
ni file d'attente.
Un fichier accepté est **confirmé par une boîte de dialogue** : elle nomme ce qui
vient d'être pris en compte et ce que cela déclenche (l'installation démarre et
sa progression s'affiche en bas de la fenêtre, ou le plugin est installé et
utilisable tout de suite). Sans elle, un dépôt qui lance une installation en
arrière-plan — ou qui pose un plugin sans un bruit — se lit comme un geste
ignoré.
Le cadre refuse en revanche un fichier que la machine possède **déjà**. Le
fournisseur nomme l'application que le fichier installerait
(`fileTargetName()`) et répond s'il l'a déjà (`isPackageInstalled()`), sans rien
lancer : le nom est lu dans le fichier lui-même (section `[Flatpak Ref]` d'un
`.flatpakref`, en-tête d'un `.flatpak`, manifeste d'un `.fwspacm`) et comparé à
ce qui est installé. La boîte de dialogue dit alors quel fichier est déjà
installé et quoi faire à la place : mettre à jour depuis l'écran des mises à
jour, ou supprimer le plugin depuis l'écran Extensions. Sans ce contrôle,
Flatpak se contenterait de sauter l'installation et de renvoyer un succès que
l'utilisateur n'a pas eu.
Certains widgets refusent le dépôt (`setAcceptDrops(false)`) : un `.fwspacm`
lâché sur le champ de recherche ou sur celui des logs doit être traité par la
fenêtre, pas collé dans le filtre.
+1
View File
@@ -96,6 +96,7 @@ Copiez `providers/example-provider/example-provider.cpp` comme point de départ.
| `canListCleanup()`, `listCleanupCandidates()`, `canCleanCache()`, `cleanCache()` | non | Page Nettoyage. Un fournisseur qui ne les implémente pas est simplement ignoré. |
| `removePackages(names, callback)` | non | Suppression groupée en une commande. Le défaut (un `remove()` par entrée) convient aux `target` d'un paquet installé plusieurs fois (voir plus bas). |
| `canInstallFile(path)`, `installFile(path, callback)` | non | Installation depuis un fichier du bureau (glisser-déposer, « Ouvrir avec PacManager »). Le fournisseur ne revendique que **ses** formats : Flatpak accepte `.flatpakref`, `.flatpakrepo` et `.flatpak`, et ignore le reste. |
| `fileTargetName(path)`, `isPackageInstalled(name)` | non | L'application qu'un fichier installerait, et si elle est déjà là. Lue dans le fichier sans rien exécuter (section `[Flatpak Ref]` d'une référence, en-tête d'un bundle), pour refuser un fichier déjà installé au lieu de lancer une installation qui ne ferait rien. Une chaîne vide (dépôt, format inconnu, fichier illisible) signifie « rien à comparer » : le fichier s'installe normalement. |
`update("")` signifie **tout mettre à jour** : c'est ce que le worker appelle pour
l'opération globale.
+7 -5
View File
@@ -16,17 +16,17 @@ lance qu'une partie (`ctest -R progress`).
| Cible | Ce qu'elle couvre | Dépendances |
| --- | --- | --- |
| `pacman-manager-test` | Parsing de la sortie pacman : listes, mises à jour, orphelins/étrangers, commandes construites (`removePackagesCommand`, `cleanCacheCommand`) et détection des échecs (mot de passe, verrou). | Aucune (pas de pacman). |
| `flatpak-manager-test` | Parsing de la sortie Flatpak : recherche, listes, colonnes ; reconnaissance des formats de fichier (`.flatpakref`, `.flatpakrepo`, `.flatpak`, casse et URL) et commandes construites pour l'installation depuis un fichier (chemins entre guillemets compris) ; **installations multiples** : chaque copie nommée (`<installation>:<ref>`, version absente qui ne décale pas les colonnes), copies conservées après fusion des lignes, commandes de désinstallation et de mise à jour ciblant une copie. | Aucune. |
| `flatpak-manager-test` | Parsing de la sortie Flatpak : recherche, listes, colonnes ; reconnaissance des formats de fichier (`.flatpakref`, `.flatpakrepo`, `.flatpak`, casse et URL) et commandes construites pour l'installation depuis un fichier (chemins entre guillemets compris) ; **installations multiples** : chaque copie nommée (`<installation>:<ref>`, version absente qui ne décale pas les colonnes), copies conservées après fusion des lignes, commandes de désinstallation et de mise à jour ciblant une copie ; **ce qu'un fichier installerait** : application lue dans la section `[Flatpak Ref]` d'un `.flatpakref` et dans l'en-tête d'un `.flatpak` (octets réels d'un bundle), refus d'un nom absent, d'un identifiant non conforme (injection comprise), d'une magie absente ou d'un en-tête tronqué. | Aucune. |
| `flatpak-integration-test` | **Le vrai CLI flatpak** : installation et désinstallation d'une petite application, liste, recherche, mise à jour — donc aussi le `DownloadWatcher` en conditions réelles. | `flatpak` (le test se saute s'il est absent). |
| `aur-manager-test` | Parsing du helper AUR (yay/paru) et nettoyage des séquences ANSI. | Aucune. |
| `package-utils-test` | Logique partagée de `package-manager.h` : fusion des doublons entre fournisseurs, tri par fournisseur puis par nom. | Aucune. |
| `progress-tracker-test` | `ProgressTracker` : compteurs pacman/Flatpak, pourcentages seuls, phases pondérées, étapes non identifiables, monotonie, faux positifs ; exécution d'une commande (`/bin/sh` en une ligne) : suppression des séquences ANSI, remontage d'une sortie au fil de l'eau, dernière ligne sans retour à la ligne, jalons de progression d'une jauge « sur place ». | Aucune, **même pas Qt**. |
| `plugin-package-test` | Le format `.fwspacm` : lecture d'une archive valide, les deux méthodes de compression, refus d'un manifeste illisible / sans `id` / d'un format inconnu / d'une bibliothèque absente ou à nom dangereux, somme de contrôle non conforme, bibliothèque vide ; recherche de la bibliothèque par suffixe et ambiguïté ; installation, réinstallation, désinstallation, et le fait qu'une bibliothèque copiée à la main n'est jamais supprimée. | Qt Core + zlib, aucun accès réseau. |
| `app-core-test` | La couche logique : portes d'entrée (opération en cours, mot de passe, providers), file d'attente des listes, historique, mode d'identification, refus d'un fichier qu'aucun fournisseur ne sait installer ; **porte du mot de passe** : chaque chemin privilégié (install, suppression, mise à jour, globale, rafraîchissement, caches, nettoyage groupé, suppression d'une ou de plusieurs installations, libération du verrou) s'arrête là, sans lancer de commande, et sa demande reste rejouable. | Qt Core seulement — **pas** QtWidgets. |
| `app-core-test` | La couche logique : portes d'entrée (opération en cours, mot de passe, providers), file d'attente des listes, historique, mode d'identification, refus d'un fichier qu'aucun fournisseur ne sait installer, et `fileTarget()` — un fichier illisible ou qu'aucun fournisseur ne revendique ne nomme rien, donc n'est jamais refusé à tort ; **porte du mot de passe** : chaque chemin privilégié (install, suppression, mise à jour, globale, rafraîchissement, caches, nettoyage groupé, suppression d'une ou de plusieurs installations, libération du verrou) s'arrête là, sans lancer de commande, et sa demande reste rejouable. | Qt Core seulement — **pas** QtWidgets. |
| `update-manager-test` | Comparaison de versions, choix de la méthode de mise à jour, et le script d'installation, exécuté pour de vrai contre un binaire en cours d'exécution. | Qt Core + Network. |
| `startup-check-test` | La **vérification au démarrage** : parsing des deux formats (`checkupdates` puis le repli `pacman -Qu`), classement d'un paquet comme critique ou nécessitant un redémarrage, texte de la notification (dont le plafond des paquets cités), et l'unité systemd écrite **dans une arborescence temporaire** — installation, activation, suppression — jamais dans le `~/.config` de l'utilisateur. | Qt Core seulement. |
| `language-manager-test` | La langue : ce que le réglage résout (un code connu, un code inconnu, « système » suivant `LC_ALL`/`LC_MESSAGES`/`LANG` puis `/etc/locale.conf`, le suffixe `@mod` ignoré, une locale non couverte qui retombe sur la langue d'écriture) ; le catalogue JSON en'core (installé, chaîne traduite, chaîne inconnue qui retombe sur la source, une clé seule servie à tous les contextes) ; un catalogue cassé ou sans chaîne **refusé**, l'interface restant entière ; et la couverture : le catalogue anglais doit contenir **toute** chaîne que le code demande, sinon une chaîne se lirait en français dans une interface anglaise. | Qt Core + les ressources, aucun affichage. |
| `app-settings-test` | Les préférences : valeurs par défaut, valeurs refusées (dossier vide, langue inconnue, taille de journal aberrante), persistance après relecture, un réglage qui n'émet que s'il change, la politique de blocage des mises à jour (durée, expiration, indefini) et — pour de vrai — le **journal** : il atterrit dans le dossier choisi, accompagne un changement de dossier, tourne au plafond de taille et garde une version précédente. | Qt Core seulement. |
| `app-settings-test` | Les préférences : valeurs par défaut, valeurs refusées (dossier vide, langue inconnue, taille de journal aberrante), persistance après relecture, un réglage qui n'émet que s'il change, la politique de blocage des mises à jour (durée, expiration, indefini) et — pour de vrai — le **journal** : il atterrit dans le dossier choisi, accompagne un changement de dossier, tourne au plafond de taille et garde une version précédente ; le bavardage de la couche graphique de Qt (`qt.qpa.*`) reste sur la sortie standard au lieu de le remplir, alors que les alertes de l'application (et une `qCWarning` sans catégorie) y sont. | Qt Core seulement. |
| `cli-command-test` | La **grammaire de la ligne de commande** : ce qui demande la CLI plutôt que la fenêtre (mot-clé ou option, contre un chemin ou un fichier `.flatpak`/`.fwspacm`) et ce que chaque mot-clé donne — recherche à plusieurs mots, install/suppression de plusieurs paquets, `maj` avec ou sans nom, commandes de lecture sans argument, `-y` lu partout, `--help`/`--version` prioritaires, commande ou option inconnue. | Qt Core seulement, rien n'est lancé. |
### Pourquoi `app-core-test` ne lie pas QtWidgets
@@ -91,8 +91,10 @@ est donc autant une vérification de comportement qu'un garde-fou d'architecture
- L'interface, y compris le glisser-déposer sur la fenêtre (fichiers Flatpak et
paquets `.fwspacm`) : elle est vérifiée à la main (`./build/PacManager`). Le
reste du chemin est couvert (reconnaissance des formats, refus d'un fichier
inconnu, lecture d'un paquet, commandes construites) ; seul le geste de la
souris ne l'est pas. Un aperçu
inconnu, lecture d'un paquet, commandes construites, application visée par le
fichier et présence sur la machine) ; seul le geste de la souris et les deux
boîtes de dialogue qui y répondent (prise en compte, déjà installé) ne sont
pas automatisés. Un aperçu
hors écran reste possible en rendant la fenêtre avec
`QT_QPA_PLATFORM=offscreen`, ce qui est utile pour vérifier une feuille de style
(aucune alerte de parsing, couleurs attendues) sans écran.
+20
View File
@@ -236,6 +236,26 @@ public:
return false;
}
// The application a file would install, as this provider names it
// internally ("com.example.App" for flatpak): a reference file spells it
// out, a bundle embeds it. Empty when the format is not this provider's,
// when the file names no single application (a .flatpakrepo only defines a
// remote), or when nothing can be read from it. Read without running
// anything, so the app can tell the user a file is already installed
// instead of starting an install that would do nothing.
virtual std::string fileTargetName(const std::string& path) const {
(void)path;
return {};
}
// Whether the provider already has that application, in any of its
// installations. A single lookup through the provider's own tool, cheap
// enough to run while the user is dropping a file.
virtual bool isPackageInstalled(const std::string& packageName) const {
(void)packageName;
return false;
}
// Check if the package manager is available on the system
virtual bool isAvailable() const = 0;
+109 -1
View File
@@ -14,6 +14,7 @@
#include <algorithm>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <set>
#include <thread>
#include <utility>
@@ -363,6 +364,15 @@ static bool endsWith(const std::string& text, const std::string& suffix) {
&& text.compare(text.size() - suffix.size(), suffix.size(), suffix) == 0;
}
// Leading and trailing blanks removed, for the INI lines of a .flatpakref.
static std::string trimmed(const std::string& text) {
std::size_t begin = 0;
std::size_t end = text.size();
while (begin < end && std::isspace(static_cast<unsigned char>(text[begin]))) ++begin;
while (end > begin && std::isspace(static_cast<unsigned char>(text[end - 1]))) --end;
return text.substr(begin, end - begin);
}
// Quote one argument for the shell popen() runs, so a dropped file whose name
// contains spaces or quotes still reaches flatpak as a single argument.
static std::string shellQuote(const std::string& value) {
@@ -536,6 +546,88 @@ std::string FlatpakManager::repoNamespace(const std::string& path) {
return name.empty() ? "flatpak-repo" : name;
}
std::string FlatpakManager::appIdFromRef(const std::string& ref) {
const std::size_t typeEnd = ref.find('/');
if (typeEnd == std::string::npos) return {};
const std::size_t idEnd = ref.find('/', typeEnd + 1);
if (idEnd == std::string::npos) return {};
// A ref is "<kind>/<id>/<arch>/<branch>", and only the two kinds flatpak
// installs name an application here.
const std::string kind = ref.substr(0, typeEnd);
if (kind != "app" && kind != "runtime") return {};
const std::string id = ref.substr(typeEnd + 1, idEnd - typeEnd - 1);
return isAppId(id) ? id : std::string();
}
std::string FlatpakManager::appIdFromRefFile(const std::string& path) {
std::ifstream file(path);
if (!file) return {};
// A .flatpakref is an INI file whose [Flatpak Ref] section names the
// application flatpak will resolve (`Name=com.example.App`); the rest of it
// describes the remote. Only that section is read.
bool inRefSection = false;
std::string line;
while (std::getline(file, line)) {
const std::string text = trimmed(line);
if (text.empty() || text[0] == '#' || text[0] == ';') continue;
if (text[0] == '[') {
inRefSection = toLower(text) == "[flatpak ref]";
continue;
}
if (!inRefSection) continue;
const std::size_t equals = text.find('=');
if (equals == std::string::npos) continue;
if (toLower(trimmed(text.substr(0, equals))) != "name") continue;
// Refused rather than handed back when it is not an application id:
// this comes straight out of a file the user dropped, and the caller
// passes it to flatpak.
const std::string id = trimmed(text.substr(equals + 1));
return isAppId(id) ? id : std::string();
}
return {};
}
std::string FlatpakManager::appIdFromBundle(const std::string& path) {
// A bundle opens with a header of its own: the magic, then the exact ref it
// installs and the application metadata, both NUL-terminated. The header is
// all that is read — the payload behind it weighs tens of megabytes and
// nothing there would answer the question.
std::ifstream file(path, std::ios::binary);
if (!file) return {};
std::array<char, 8192> buffer{};
file.read(buffer.data(), static_cast<std::streamsize>(buffer.size()));
const std::string header(buffer.data(), static_cast<std::size_t>(file.gcount()));
const std::string magic("flatpak\0", 8);
if (header.size() <= magic.size() || header.compare(0, magic.size(), magic) != 0) {
// An OCI bundle, or a file that is not one: nothing is guessed at, so
// the caller installs it the ordinary way.
return {};
}
// The ref sits behind a "ref" key. Skipping the framing between the two —
// flatpak writes sizes there of its own choosing — is what keeps this
// readable across the versions of the format.
const std::string key("ref\0", 4);
for (std::size_t at = header.find(key, magic.size()); at != std::string::npos;
at = header.find(key, at + key.size())) {
std::size_t value = at + key.size();
while (value < header.size() && header[value] == '\0') ++value;
const std::size_t end = header.find('\0', value);
if (end == std::string::npos) break;
const std::string id = appIdFromRef(header.substr(value, end - value));
if (!id.empty()) return id;
}
return {};
}
std::string FlatpakManager::installFileCommand(FileKind kind, const std::string& path,
bool userScope) {
const std::string scope = userScope ? "--user " : "";
@@ -642,7 +734,7 @@ std::vector<PackageInfo> FlatpakManager::listUpdates() {
return results;
}
bool FlatpakManager::isInstalled(const std::string& appId) {
bool FlatpakManager::isInstalled(const std::string& appId) const {
std::string cmd = "flatpak info " + appId + " > /dev/null 2>&1";
return system(cmd.c_str()) == 0;
}
@@ -942,6 +1034,22 @@ bool FlatpakManager::canInstallFile(const std::string& path) const {
return classifyFile(path) != FileKind::None;
}
// What the user is about to install, named the way flatpak names it. A
// `.flatpakrepo` answers nothing: it registers a remote and installs no
// application, so there is nothing that could already be there.
std::string FlatpakManager::fileTargetName(const std::string& path) const {
switch (classifyFile(path)) {
case FileKind::Ref: return appIdFromRefFile(path);
case FileKind::Bundle: return appIdFromBundle(path);
default: return {};
}
}
bool FlatpakManager::isPackageInstalled(const std::string& packageName) const {
if (packageName.empty()) return false;
return isInstalled(packageName);
}
bool FlatpakManager::installFile(const std::string& path,
ProgressCallback progressCallback) {
m_lastError.clear();
+17 -1
View File
@@ -66,6 +66,18 @@ public:
// types in `flatpak install <name> <app>`.
static std::string repoNamespace(const std::string& path);
// Application a file would install. A `.flatpakref` spells it out in its
// `[Flatpak Ref]` section; a `.flatpak` bundle carries the exact ref it
// installs in its own header. Both are read without running flatpak — the
// file is already on disk — so the answer is available before anything is
// started. Empty when the file names no application or cannot be read, in
// which case the caller simply installs it.
static std::string appIdFromRefFile(const std::string& path);
static std::string appIdFromBundle(const std::string& path);
// The application id inside a ref ("app/com.example.App/x86_64/stable" ->
// "com.example.App"). Empty when the string is not a ref.
static std::string appIdFromRef(const std::string& ref);
std::vector<PackageInfo> search(const std::string& query) override;
bool install(const std::string& packageName,
ProgressCallback progressCallback) override;
@@ -88,6 +100,8 @@ public:
// URL, so flatpak resolves the remote itself.
bool canInstallFile(const std::string& path) const override;
bool installFile(const std::string& path, ProgressCallback progressCallback) override;
std::string fileTargetName(const std::string& path) const override;
bool isPackageInstalled(const std::string& packageName) const override;
// Make an app appear in the desktop's application launcher (wofi, GNOME,
// KDE, ...) regardless of XDG_DATA_DIRS, like a pacman install would: link
@@ -102,7 +116,9 @@ public:
void integrateAllInstalled();
private:
bool isInstalled(const std::string& appId);
// Whether that application is deployed, in any installation (flatpak info
// looks them all up). Exposed through isPackageInstalled().
bool isInstalled(const std::string& appId) const;
std::string m_lastError;
};
+31
View File
@@ -2,6 +2,7 @@
#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QStringList>
#include <QTemporaryDir>
@@ -252,6 +253,35 @@ void testDatabaseLockIsQueryable() {
}
}
// What a file the user drops would install. Only the half that needs no
// provider is asserted here (the Flatpak side is covered by that provider's own
// test, on the bytes a bundle really carries): an unreadable package names
// nothing, so the window installs it and lets the reader report the reason.
void testFileTargetAnswersNothingForWhatItCannotRead() {
AppCore core;
assert(core.fileTarget(QString()).name.isEmpty());
assert(!core.fileTarget(QString()).installed);
assert(!core.fileTarget(QStringLiteral(" ")).installed);
// No provider claims a text document, so there is nothing to name.
assert(core.fileTarget(QStringLiteral("/tmp/liste-de-courses.txt")).name.isEmpty());
QTemporaryDir dir;
assert(dir.isValid());
const QString broken = dir.filePath(QStringLiteral("casse.fwspacm"));
QFile file(broken);
assert(file.open(QIODevice::WriteOnly));
file.write("pas une archive");
file.close();
const AppCore::FileTarget target = core.fileTarget(broken);
assert(target.name.isEmpty());
assert(!target.installed);
// It is still a plugin package by its name, which is what the window asks
// next before handing it to the installer.
assert(core.isPluginPackage(broken));
}
} // namespace
int main(int argc, char* argv[]) {
@@ -282,6 +312,7 @@ int main(int argc, char* argv[]) {
testLogReadReportsItsFailure();
testUpdateStateIsReadableWithoutRunningAnything();
testDatabaseLockIsQueryable();
testFileTargetAnswersNothingForWhatItCannotRead();
std::cout << "app-core: all tests passed" << std::endl;
return 0;
+187
View File
@@ -1,6 +1,39 @@
#include "flatpak-manager.h"
#include <cassert>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <string>
// The parsers below read real files, so the tests write real bytes: a scratch
// directory of our own in the system temp tree, never the user's home.
static std::filesystem::path scratchDir() {
std::error_code ec;
const std::filesystem::path dir =
std::filesystem::temp_directory_path(ec) / "pacmanager-flatpak-manager-test";
std::filesystem::create_directories(dir, ec);
return dir;
}
static std::string writeScratch(const std::string& name, const std::string& bytes) {
const std::filesystem::path path = scratchDir() / name;
std::ofstream out(path, std::ios::binary | std::ios::trunc);
out.write(bytes.data(), static_cast<std::streamsize>(bytes.size()));
out.close();
return path.string();
}
// Bytes encoded the way a hex dump reads, so a fixture can be copied from the
// real file it came from.
static std::string fromHex(const std::string& hex) {
std::string bytes;
bytes.reserve(hex.size() / 2);
for (std::size_t i = 0; i + 1 < hex.size(); i += 2) {
bytes.push_back(static_cast<char>(std::stoi(hex.substr(i, 2), nullptr, 16)));
}
return bytes;
}
static void testParseSearchOutput_parsesAlignedRows() {
std::string output =
@@ -240,6 +273,153 @@ static void testUninstallCommand_stillAcceptsAnApplicationId() {
assert(plain.find("--user") == std::string::npos);
}
// ---- What a dropped file would install ----
//
// The window asks this before it runs anything, to refuse a file the machine
// already has. Both answers are read out of the file itself: no flatpak call,
// no network, and nothing guessed at.
static void testAppIdFromRefFile_readsTheNameField() {
const std::string ref = writeScratch("org.gnome.Dictionary.flatpakref",
"[Flatpak Ref]\n"
"Title=Dictionary\n"
"Name=org.gnome.Dictionary\n"
"Branch=stable\n"
"Url=https://dl.flathub.org/repo/\n"
"SuggestRemoteName=flathub\n"
"RuntimeRepo=https://dl.flathub.org/repo/flathub.flatpakrepo\n"
"IsRuntime=false\n");
assert(FlatpakManager::appIdFromRefFile(ref) == "org.gnome.Dictionary");
// A hand-written file: comments, blank lines, CRLF endings, spaces around
// the separator, a lower-case section, and another section behind it whose
// `Name` is not the application.
const std::string spoken = writeScratch("spaced.flatpakref",
"; written by hand\r\n"
"\r\n"
"[FLATPAK REF]\r\n"
" Name = org.gnome.Calculator \r\n"
"[Flatpak Repo]\n"
"Name=org.example.NotTheApp\n");
assert(FlatpakManager::appIdFromRefFile(spoken) == "org.gnome.Calculator");
}
static void testAppIdFromRefFile_refusesWhatNamesNoApplication() {
// The name is not in the ref section: a repository definition lists other
// keys there, and reading one of them as the application would refuse an
// install that has every right to run.
const std::string repo = writeScratch("flathub.flatpakref",
"[Flatpak Repo]\n"
"Name=org.example.NotTheApp\n"
"[Flatpak Ref]\n"
"Branch=stable\n");
assert(FlatpakManager::appIdFromRefFile(repo).empty());
// An id that is not one is refused rather than handed to flatpak: this came
// straight out of a file the user dropped.
const std::string injected = writeScratch("injected.flatpakref",
"[Flatpak Ref]\n"
"Name=org.example.App; rm -rf ~\n");
assert(FlatpakManager::appIdFromRefFile(injected).empty());
// A file that is not there, an empty one, and one that is not a ref file.
assert(FlatpakManager::appIdFromRefFile("/tmp/pacmgr-does-not-exist.flatpakref").empty());
assert(FlatpakManager::appIdFromRefFile(writeScratch("empty.flatpakref", "")).empty());
assert(FlatpakManager::appIdFromRefFile(writeScratch("junk.flatpakref", "garbage")).empty());
}
static void testAppIdFromRef_stripsKindArchAndBranch() {
assert(FlatpakManager::appIdFromRef("app/org.gnome.Calculator/x86_64/stable")
== "org.gnome.Calculator");
assert(FlatpakManager::appIdFromRef("runtime/org.freedesktop.Platform/x86_64/50")
== "org.freedesktop.Platform");
// A branch can carry a dash and a version, which is not part of the id.
assert(FlatpakManager::appIdFromRef("app/org.winehq.Wine/x86_64/stable-25.08")
== "org.winehq.Wine");
// Not a ref at all: a bare id, a kind alone, an empty string, a URL.
assert(FlatpakManager::appIdFromRef("com.example.App").empty());
assert(FlatpakManager::appIdFromRef("app/").empty());
assert(FlatpakManager::appIdFromRef("").empty());
assert(FlatpakManager::appIdFromRef("https://flathub.org/repo/app.flatpakref").empty());
// A kind flatpak does not install as an application.
assert(FlatpakManager::appIdFromRef("something/org.example.App/x86_64/stable").empty());
}
// The first bytes of a real bundle, hex-encoded exactly as `flatpak
// build-bundle` wrote them: the magic, the ref it installs, then the metadata.
static std::string bundleHeaderFixture() {
return fromHex(
"666c617470616b00010089e500750800"
"72656600000000006170702f636f6d2e"
"757365626f74746c65732e626f74746c"
"65732f7838365f36342f737461626c65"
"00007304000000006d65746164617461"
"00000000000000005b4170706c696361"
"74696f6e5d0a6e616d653d636f6d2e75"
"7365626f74746c65732e626f74746c65"
"730a72756e74696d653d6f72672e676e"
"6f6d652e506c6174666f726d2f783836"
"5f36342f35300a73");
}
static void testAppIdFromBundle_readsTheRefInTheHeader() {
const std::string bundle = writeScratch("bottles.flatpak", bundleHeaderFixture());
assert(FlatpakManager::appIdFromBundle(bundle) == "com.usebottles.bottles");
// A runtime bundle is named the same way, behind "runtime/" instead of
// "app/", and with the framing flatpak may put around the ref differing.
std::string runtime("flatpak\0", 8);
runtime += std::string("\x01\0\0\0\0\0\0\0", 8);
runtime += std::string("ref\0\0\0\0", 8);
runtime += "runtime/org.freedesktop.Platform/x86_64/50";
runtime += '\0';
runtime += "metadata";
assert(FlatpakManager::appIdFromBundle(writeScratch("platform.flatpak", runtime))
== "org.freedesktop.Platform");
}
static void testAppIdFromBundle_refusesWhatItCannotRead() {
assert(FlatpakManager::appIdFromBundle("/tmp/pacmgr-does-not-exist.flatpak").empty());
assert(FlatpakManager::appIdFromBundle(writeScratch("empty.flatpak", "")).empty());
assert(FlatpakManager::appIdFromBundle(writeScratch("plain.flatpak", "not a bundle")).empty());
// The magic alone, then a header that stops in the middle of the ref.
std::string truncated("flatpak\0", 8);
truncated += "ref\0";
assert(FlatpakManager::appIdFromBundle(writeScratch("truncated.flatpak", truncated)).empty());
// The right magic with something else behind the ref key.
std::string foreign("flatpak\0", 8);
foreign += std::string("ref\0\0\0\0\0", 9);
foreign += "garbage-not-a-ref";
foreign += '\0';
assert(FlatpakManager::appIdFromBundle(writeScratch("foreign.flatpak", foreign)).empty());
}
// A repository definition installs no application, so it answers nothing and
// is installed the ordinary way; the two other formats name what they install.
static void testFileTargetName_onlyNamesApplications() {
FlatpakManager manager;
const std::string repo = writeScratch("flathub.flatpakrepo",
"[Flatpak Repo]\n"
"Name=flathub\n"
"Url=https://dl.flathub.org/repo/\n");
assert(manager.fileTargetName(repo).empty());
const std::string ref = writeScratch("calculator.flatpakref",
"[Flatpak Ref]\n"
"Name=org.gnome.Calculator\n");
assert(manager.fileTargetName(ref) == "org.gnome.Calculator");
assert(manager.fileTargetName(writeScratch("app.flatpak", bundleHeaderFixture()))
== "com.usebottles.bottles");
// A file no format claims stays unknown rather than guessed at.
assert(manager.fileTargetName(writeScratch("documents.txt", "rien à voir")).empty());
}
int main() {
testParseSearchOutput_parsesAlignedRows();
testParseSearchOutput_keepsMultiWordDescriptions();
@@ -261,6 +441,13 @@ int main() {
testUninstallAndUpdateCommands_targetOneCopy();
testUninstallCommand_stillAcceptsAnApplicationId();
testAppIdFromRefFile_readsTheNameField();
testAppIdFromRefFile_refusesWhatNamesNoApplication();
testAppIdFromRef_stripsKindArchAndBranch();
testAppIdFromBundle_readsTheRefInTheHeader();
testAppIdFromBundle_refusesWhatItCannotRead();
testFileTargetName_onlyNamesApplications();
std::cout << "All flatpak-manager tests passed." << std::endl;
return 0;
}
+7
View File
@@ -5,6 +5,7 @@
" PacManager reprendra ensuite l'opération automatiquement.": " PacManager setzt den Vorgang anschließend automatisch fort.",
"%1 (jusqu'au %2)": "%1 (bis %2)",
"%1 : %2": "%1: %2",
"%1 : déjà installé, rien à faire": "%1: bereits installiert, nichts zu tun",
"%1 : format non reconnu (PacManager installe les fichiers .flatpakref, .flatpakrepo, .flatpak et les paquets de plugin .fwspacm).": "%1: Format nicht erkannt (PacManager installiert die Dateien .flatpakref, .flatpakrepo, .flatpak sowie .fwspacm-Plugin-Pakete).",
"%1 Ko": "%1 KB",
"%1 Mo": "%1 MB",
@@ -37,6 +38,10 @@
"5 Mo": "5 MB",
"7 jours": "7 Tage",
"<b>%1</b> utilise déjà la base pacman.": "<b>%1</b> verwendet die pacman-Datenbank bereits.",
"<b>%1</b> : ce plugin est déjà installé. Supprimez-le depuis l'écran Extensions pour en installer un autre.": "<b>%1</b>: Dieses Plugin ist bereits installiert. Entferne es im Bildschirm Erweiterungen, um ein anderes zu installieren.",
"<b>%1</b> est déjà installé : il n'y a rien à installer. Sa mise à jour se fait depuis l'écran des mises à jour.": "<b>%1</b> ist bereits installiert: es gibt nichts zu installieren. Aktualisiert wird es über den Bildschirm der Aktualisierungen.",
"<b>%1</b> pris en compte : le plugin est installé et utilisable sans redémarrer.": "<b>%1</b> berücksichtigt: das Plugin ist installiert und ohne Neustart nutzbar.",
"<b>%1</b> pris en compte : l'installation démarre, sa progression s'affiche en bas de la fenêtre.": "<b>%1</b> berücksichtigt: die Installation startet, ihr Fortschritt wird unten im Fenster angezeigt.",
"<h2>PacManager v%1</h2><p>Gestionnaire de paquets pour Arch Linux (pacman).</p>": "<h2>PacManager v%1</h2><p>Paketverwaltung für Arch Linux (pacman).</p>",
"<h3>PacManager a été mis à jour</h3><p>La nouvelle version sera active au prochain démarrage.</p><pre>%1</pre>": "<h3>PacManager wurde aktualisiert</h3><p>Die neue Version ist beim nächsten Start aktiv.</p><pre>%1</pre>",
"<h3>PacManager v%1 est disponible</h3><p>Vous utilisez actuellement la version %2.</p>": "<h3>PacManager v%1 ist verfügbar</h3><p>Du verwendest derzeit Version %2.</p>",
@@ -97,6 +102,7 @@
"Dossier du journal": "Journal-Ordner",
"Dossier du journal : %1": "Journal-Ordner: %1",
"Débloquer": "Entsperren",
"Déjà installé": "Bereits installiert",
"Dépend de": "Hängt ab von",
"Déposez un fichier <code>%1</code> n'importe où sur la fenêtre : son bibliothèque est extraite dans <code>%2</code>, sans mot de passe, et le plugin est chargé immédiatement, sans redémarrer. Le paquet contient un manifeste <code>plugin.json</code> et la bibliothèque ; il se crée avec <code>./make-plugin-package.py</code> (voir doc/plugins.md).": "Lege eine Datei <code>%1</code> irgendwo im Fenster ab: Ihre Bibliothek wird nach <code>%2</code> entpackt, ohne Passwort, und das Plugin wird sofort geladen, ohne Neustart. Das Paket enthält ein Manifest <code>plugin.json</code> und die Bibliothek; es wird mit <code>./make-plugin-package.py</code> erstellt (siehe doc/plugins.md).",
"Dépôt": "Repository",
@@ -123,6 +129,7 @@
"Fermer le gestionnaire": "Die Paketverwaltung schließen",
"Fichier": "Datei",
"Fichier installé": "Installierte Datei",
"Fichiers pris en compte": "Dateien berücksichtigt",
"Filtre local, instantané": "Lokaler Filter, sofort",
"Filtrer :": "Filtern:",
"Filtrer les logs (paquet, action, date)...": "Die Logs filtern (Paket, Aktion, Datum)...",
+7
View File
@@ -5,6 +5,7 @@
" PacManager reprendra ensuite l'opération automatiquement.": " PacManager will then resume the operation automatically.",
"%1 (jusqu'au %2)": "%1 (until %2)",
"%1 : %2": "%1: %2",
"%1 : déjà installé, rien à faire": "%1: already installed, nothing to do",
"%1 : format non reconnu (PacManager installe les fichiers .flatpakref, .flatpakrepo, .flatpak et les paquets de plugin .fwspacm).": "%1: unsupported format (PacManager installs the .flatpakref, .flatpakrepo and .flatpak files, and the .fwspacm plugin packages).",
"%1 Ko": "%1 KB",
"%1 Mo": "%1 MB",
@@ -37,6 +38,10 @@
"5 Mo": "5 MB",
"7 jours": "7 days",
"<b>%1</b> utilise déjà la base pacman.": "<b>%1</b> is already using the pacman database.",
"<b>%1</b> : ce plugin est déjà installé. Supprimez-le depuis l'écran Extensions pour en installer un autre.": "<b>%1</b>: this plugin is already installed. Remove it from the Extensions screen to install another one.",
"<b>%1</b> est déjà installé : il n'y a rien à installer. Sa mise à jour se fait depuis l'écran des mises à jour.": "<b>%1</b> is already installed: there is nothing to install. It is updated from the updates screen.",
"<b>%1</b> pris en compte : le plugin est installé et utilisable sans redémarrer.": "<b>%1</b> taken into account: the plugin is installed and usable without restarting.",
"<b>%1</b> pris en compte : l'installation démarre, sa progression s'affiche en bas de la fenêtre.": "<b>%1</b> taken into account: the installation starts, its progress is shown at the bottom of the window.",
"<h2>PacManager v%1</h2><p>Gestionnaire de paquets pour Arch Linux (pacman).</p>": "<h2>PacManager v%1</h2><p>Package manager for Arch Linux (pacman).</p>",
"<h3>PacManager a été mis à jour</h3><p>La nouvelle version sera active au prochain démarrage.</p><pre>%1</pre>": "<h3>PacManager has been updated</h3><p>The new version will be active on the next start.</p><pre>%1</pre>",
"<h3>PacManager v%1 est disponible</h3><p>Vous utilisez actuellement la version %2.</p>": "<h3>PacManager v%1 is available</h3><p>You are currently running version %2.</p>",
@@ -97,6 +102,7 @@
"Dossier du journal": "Journal folder",
"Dossier du journal : %1": "Journal folder: %1",
"Débloquer": "Unblock",
"Déjà installé": "Already installed",
"Dépend de": "Depends on",
"Déposez un fichier <code>%1</code> n'importe où sur la fenêtre : son bibliothèque est extraite dans <code>%2</code>, sans mot de passe, et le plugin est chargé immédiatement, sans redémarrer. Le paquet contient un manifeste <code>plugin.json</code> et la bibliothèque ; il se crée avec <code>./make-plugin-package.py</code> (voir doc/plugins.md).": "Drop a <code>%1</code> file anywhere on the window: its library is extracted into <code>%2</code>, without a password, and the plugin is loaded right away, with no restart. The package holds a <code>plugin.json</code> manifest and the library; it is built with <code>./make-plugin-package.py</code> (see doc/plugins.md).",
"Dépôt": "Repository",
@@ -123,6 +129,7 @@
"Fermer le gestionnaire": "Close the package manager",
"Fichier": "File",
"Fichier installé": "Installed file",
"Fichiers pris en compte": "Files taken into account",
"Filtre local, instantané": "Local filter, instant",
"Filtrer :": "Filter:",
"Filtrer les logs (paquet, action, date)...": "Filter the logs (package, action, date)...",
+7
View File
@@ -5,6 +5,7 @@
" PacManager reprendra ensuite l'opération automatiquement.": " PacManager reanudará la operación automáticamente.",
"%1 (jusqu'au %2)": "%1 (hasta %2)",
"%1 : %2": "%1: %2",
"%1 : déjà installé, rien à faire": "%1: ya instalado, nada que hacer",
"%1 : format non reconnu (PacManager installe les fichiers .flatpakref, .flatpakrepo, .flatpak et les paquets de plugin .fwspacm).": "%1: formato no reconocido (PacManager instala los archivos .flatpakref, .flatpakrepo, .flatpak y los paquetes de plugin .fwspacm).",
"%1 Ko": "%1 KB",
"%1 Mo": "%1 MB",
@@ -37,6 +38,10 @@
"5 Mo": "5 MB",
"7 jours": "7 días",
"<b>%1</b> utilise déjà la base pacman.": "<b>%1</b> ya está usando la base de datos de pacman.",
"<b>%1</b> : ce plugin est déjà installé. Supprimez-le depuis l'écran Extensions pour en installer un autre.": "<b>%1</b>: este plugin ya está instalado. Elimínalo desde la pantalla Extensiones para instalar otro.",
"<b>%1</b> est déjà installé : il n'y a rien à installer. Sa mise à jour se fait depuis l'écran des mises à jour.": "<b>%1</b> ya está instalado: no hay nada que instalar. Su actualización se hace desde la pantalla de actualizaciones.",
"<b>%1</b> pris en compte : le plugin est installé et utilisable sans redémarrer.": "<b>%1</b> tenido en cuenta: el plugin está instalado y se puede usar sin reiniciar.",
"<b>%1</b> pris en compte : l'installation démarre, sa progression s'affiche en bas de la fenêtre.": "<b>%1</b> tenido en cuenta: la instalación comienza y su progreso se muestra en la parte inferior de la ventana.",
"<h2>PacManager v%1</h2><p>Gestionnaire de paquets pour Arch Linux (pacman).</p>": "<h2>PacManager v%1</h2><p>Gestor de paquetes para Arch Linux (pacman).</p>",
"<h3>PacManager a été mis à jour</h3><p>La nouvelle version sera active au prochain démarrage.</p><pre>%1</pre>": "<h3>PacManager se ha actualizado</h3><p>La nueva versión estará activa en el próximo inicio.</p><pre>%1</pre>",
"<h3>PacManager v%1 est disponible</h3><p>Vous utilisez actuellement la version %2.</p>": "<h3>PacManager v%1 está disponible</h3><p>Actualmente usas la versión %2.</p>",
@@ -97,6 +102,7 @@
"Dossier du journal": "Carpeta del diario",
"Dossier du journal : %1": "Carpeta del diario: %1",
"Débloquer": "Desbloquear",
"Déjà installé": "Ya instalado",
"Dépend de": "Depende de",
"Déposez un fichier <code>%1</code> n'importe où sur la fenêtre : son bibliothèque est extraite dans <code>%2</code>, sans mot de passe, et le plugin est chargé immédiatement, sans redémarrer. Le paquet contient un manifeste <code>plugin.json</code> et la bibliothèque ; il se crée avec <code>./make-plugin-package.py</code> (voir doc/plugins.md).": "Suelta un archivo <code>%1</code> en cualquier parte de la ventana: su biblioteca se extrae en <code>%2</code>, sin contraseña, y el plugin se carga de inmediato, sin reiniciar. El paquete contiene un manifiesto <code>plugin.json</code> y la biblioteca; se crea con <code>./make-plugin-package.py</code> (ver doc/plugins.md).",
"Dépôt": "Repositorio",
@@ -123,6 +129,7 @@
"Fermer le gestionnaire": "Cerrar el gestor",
"Fichier": "Archivo",
"Fichier installé": "Archivo instalado",
"Fichiers pris en compte": "Archivos tenidos en cuenta",
"Filtre local, instantané": "Filtro local, instantáneo",
"Filtrer :": "Filtrar:",
"Filtrer les logs (paquet, action, date)...": "Filtrar los registros (paquete, acción, fecha)...",
+7
View File
@@ -5,6 +5,7 @@
" PacManager reprendra ensuite l'opération automatiquement.": " PacManager riprenderà poi l'operazione automaticamente.",
"%1 (jusqu'au %2)": "%1 (fino al %2)",
"%1 : %2": "%1: %2",
"%1 : déjà installé, rien à faire": "%1: già installato, nulla da fare",
"%1 : format non reconnu (PacManager installe les fichiers .flatpakref, .flatpakrepo, .flatpak et les paquets de plugin .fwspacm).": "%1: formato non riconosciuto (PacManager installa i file .flatpakref, .flatpakrepo, .flatpak e i pacchetti di plugin .fwspacm).",
"%1 Ko": "%1 KB",
"%1 Mo": "%1 MB",
@@ -37,6 +38,10 @@
"5 Mo": "5 MB",
"7 jours": "7 giorni",
"<b>%1</b> utilise déjà la base pacman.": "<b>%1</b> sta già usando il database di pacman.",
"<b>%1</b> : ce plugin est déjà installé. Supprimez-le depuis l'écran Extensions pour en installer un autre.": "<b>%1</b>: questo plugin è già installato. Rimuovilo dalla schermata Estensioni per installarne un altro.",
"<b>%1</b> est déjà installé : il n'y a rien à installer. Sa mise à jour se fait depuis l'écran des mises à jour.": "<b>%1</b> è già installato: non c'è nulla da installare. Il suo aggiornamento si fa dalla schermata degli aggiornamenti.",
"<b>%1</b> pris en compte : le plugin est installé et utilisable sans redémarrer.": "<b>%1</b> preso in carico: il plugin è installato e utilizzabile senza riavviare.",
"<b>%1</b> pris en compte : l'installation démarre, sa progression s'affiche en bas de la fenêtre.": "<b>%1</b> preso in carico: l'installazione inizia e il suo avanzamento è mostrato in fondo alla finestra.",
"<h2>PacManager v%1</h2><p>Gestionnaire de paquets pour Arch Linux (pacman).</p>": "<h2>PacManager v%1</h2><p>Gestore di pacchetti per Arch Linux (pacman).</p>",
"<h3>PacManager a été mis à jour</h3><p>La nouvelle version sera active au prochain démarrage.</p><pre>%1</pre>": "<h3>PacManager è stato aggiornato</h3><p>La nuova versione sarà attiva al prossimo avvio.</p><pre>%1</pre>",
"<h3>PacManager v%1 est disponible</h3><p>Vous utilisez actuellement la version %2.</p>": "<h3>PacManager v%1 è disponibile</h3><p>Al momento usi la versione %2.</p>",
@@ -97,6 +102,7 @@
"Dossier du journal": "Cartella del diario",
"Dossier du journal : %1": "Cartella del diario: %1",
"Débloquer": "Sblocca",
"Déjà installé": "Già installato",
"Dépend de": "Dipende da",
"Déposez un fichier <code>%1</code> n'importe où sur la fenêtre : son bibliothèque est extraite dans <code>%2</code>, sans mot de passe, et le plugin est chargé immédiatement, sans redémarrer. Le paquet contient un manifeste <code>plugin.json</code> et la bibliothèque ; il se crée avec <code>./make-plugin-package.py</code> (voir doc/plugins.md).": "Rilascia un file <code>%1</code> in qualsiasi punto della finestra: la sua libreria viene estratta in <code>%2</code>, senza password, e il plugin viene caricato subito, senza riavviare. Il pacchetto contiene un manifesto <code>plugin.json</code> e la libreria; si crea con <code>./make-plugin-package.py</code> (vedi doc/plugins.md).",
"Dépôt": "Repository",
@@ -123,6 +129,7 @@
"Fermer le gestionnaire": "Chiudi il gestore",
"Fichier": "File",
"Fichier installé": "File installato",
"Fichiers pris en compte": "File presi in carico",
"Filtre local, instantané": "Filtro locale, istantaneo",
"Filtrer :": "Filtra:",
"Filtrer les logs (paquet, action, date)...": "Filtra i log (pacchetto, azione, data)...",