├── ABOUT-NLS ├── COPYING ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README.md ├── acinclude.m4 ├── aclocal.m4 ├── app ├── Makefile.am.inc ├── flatpak-builtins-build-bundle.c ├── flatpak-builtins-build-commit-from.c ├── flatpak-builtins-build-export.c ├── flatpak-builtins-build-finish.c ├── flatpak-builtins-build-import-bundle.c ├── flatpak-builtins-build-init.c ├── flatpak-builtins-build-sign.c ├── flatpak-builtins-build-update-repo.c ├── flatpak-builtins-build.c ├── flatpak-builtins-config.c ├── flatpak-builtins-create-usb.c ├── flatpak-builtins-document-export.c ├── flatpak-builtins-document-info.c ├── flatpak-builtins-document-list.c ├── flatpak-builtins-document-unexport.c ├── flatpak-builtins-enter.c ├── flatpak-builtins-history.c ├── flatpak-builtins-info.c ├── flatpak-builtins-install.c ├── flatpak-builtins-kill.c ├── flatpak-builtins-list.c ├── flatpak-builtins-make-current.c ├── flatpak-builtins-mask.c ├── flatpak-builtins-override.c ├── flatpak-builtins-permission-list.c ├── flatpak-builtins-permission-remove.c ├── flatpak-builtins-permission-reset.c ├── flatpak-builtins-permission-set.c ├── flatpak-builtins-permission-show.c ├── flatpak-builtins-pin.c ├── flatpak-builtins-ps.c ├── flatpak-builtins-remote-add.c ├── flatpak-builtins-remote-delete.c ├── flatpak-builtins-remote-info.c ├── flatpak-builtins-remote-list.c ├── flatpak-builtins-remote-ls.c ├── flatpak-builtins-remote-modify.c ├── flatpak-builtins-repair.c ├── flatpak-builtins-repo.c ├── flatpak-builtins-run.c ├── flatpak-builtins-search.c ├── flatpak-builtins-uninstall.c ├── flatpak-builtins-update.c ├── flatpak-builtins-utils.c ├── flatpak-builtins-utils.h ├── flatpak-builtins.h ├── flatpak-cli-transaction.c ├── flatpak-cli-transaction.h ├── flatpak-complete.c ├── flatpak-complete.h ├── flatpak-main.c ├── flatpak-polkit-agent-text-listener.c ├── flatpak-polkit-agent-text-listener.h ├── flatpak-quiet-transaction.c ├── flatpak-quiet-transaction.h ├── flatpak-table-printer.c ├── flatpak-table-printer.h ├── parse-datetime.h └── parse-datetime.y ├── autogen.sh ├── buildutil ├── glib-tap.mk ├── tap-driver.sh └── tap-test ├── common ├── Makefile.am.inc ├── flatpak-appdata-private.h ├── flatpak-appdata.c ├── flatpak-auth-private.h ├── flatpak-auth.c ├── flatpak-bundle-ref.c ├── flatpak-bundle-ref.h ├── flatpak-bwrap-private.h ├── flatpak-bwrap.c ├── flatpak-chain-input-stream-private.h ├── flatpak-chain-input-stream.c ├── flatpak-common-types-private.h ├── flatpak-context-private.h ├── flatpak-context.c ├── flatpak-dir-private.h ├── flatpak-dir.c ├── flatpak-enum-types.c.template ├── flatpak-enum-types.h.template ├── flatpak-error.c ├── flatpak-error.h ├── flatpak-exports-private.h ├── flatpak-exports.c ├── flatpak-installation-private.h ├── flatpak-installation.c ├── flatpak-installation.h ├── flatpak-installed-ref-private.h ├── flatpak-installed-ref.c ├── flatpak-installed-ref.h ├── flatpak-instance-private.h ├── flatpak-instance.c ├── flatpak-instance.h ├── flatpak-json-oci-private.h ├── flatpak-json-oci.c ├── flatpak-json-private.h ├── flatpak-json.c ├── flatpak-oci-registry-private.h ├── flatpak-oci-registry.c ├── flatpak-parental-controls-private.h ├── flatpak-parental-controls.c ├── flatpak-portal-error.c ├── flatpak-portal-error.h ├── flatpak-progress-private.h ├── flatpak-progress.c ├── flatpak-prune-private.h ├── flatpak-prune.c ├── flatpak-ref-utils-private.h ├── flatpak-ref-utils.c ├── flatpak-ref.c ├── flatpak-ref.h ├── flatpak-related-ref-private.h ├── flatpak-related-ref.c ├── flatpak-related-ref.h ├── flatpak-remote-private.h ├── flatpak-remote-ref-private.h ├── flatpak-remote-ref.c ├── flatpak-remote-ref.h ├── flatpak-remote.c ├── flatpak-remote.h ├── flatpak-run-private.h ├── flatpak-run.c ├── flatpak-syscalls-private.h ├── flatpak-transaction-private.h ├── flatpak-transaction.c ├── flatpak-transaction.h ├── flatpak-uri-private.h ├── flatpak-uri.c ├── flatpak-utils-base-private.h ├── flatpak-utils-base.c ├── flatpak-utils-http-private.h ├── flatpak-utils-http.c ├── flatpak-utils-private.h ├── flatpak-utils.c ├── flatpak-version-macros.h ├── flatpak-version-macros.h.in ├── flatpak-zstd-decompressor-private.h ├── flatpak-zstd-decompressor.c ├── flatpak.c ├── flatpak.h ├── test-lib.c └── valgrind-private.h ├── compile ├── completion ├── _flatpak ├── flatpak └── flatpak.fish ├── config.guess ├── config.h.in ├── config.rpath ├── config.sub ├── configure ├── configure.ac ├── data ├── Makefile.am.inc ├── flatpak-docker-seccomp.json ├── flatpak-variants.gv ├── org.freedesktop.Flatpak.Authenticator.xml ├── org.freedesktop.Flatpak.xml ├── org.freedesktop.impl.portal.PermissionStore.xml ├── org.freedesktop.portal.Documents.xml ├── org.freedesktop.portal.Flatpak.xml ├── org.freedesktop.systemd1.xml └── tmpfiles.d │ └── flatpak.conf ├── debian ├── .gitattributes ├── .gitignore ├── NEWS ├── README.source ├── changelog ├── control ├── copyright ├── flatpak-tests.install ├── flatpak-tests.lintian-overrides ├── flatpak.README.Debian ├── flatpak.doc-base ├── flatpak.docs ├── flatpak.examples ├── flatpak.install ├── flatpak.lintian-overrides ├── flatpak.maintscript ├── flatpak.manpages ├── flatpak.postinst ├── flatpak.postrm ├── gbp.conf ├── gir1.2-flatpak-1.0.install ├── libflatpak-dev.install ├── libflatpak-doc.doc-base ├── libflatpak-doc.docs ├── libflatpak-doc.install ├── libflatpak-doc.links ├── libflatpak0.install ├── libflatpak0.symbols ├── org.freedesktop.Flatpak.pkla ├── rules ├── salsa-ci.yml ├── source │ └── format ├── test.sh ├── tests │ ├── build │ ├── control │ ├── flaky │ └── gnome-desktop-testing ├── upstream │ └── metadata └── watch ├── depcomp ├── doc ├── Makefile.am ├── Makefile.in ├── docbook.css ├── flatpak-build-bundle.xml ├── flatpak-build-commit-from.xml ├── flatpak-build-export.xml ├── flatpak-build-finish.xml ├── flatpak-build-import-bundle.xml ├── flatpak-build-init.xml ├── flatpak-build-sign.xml ├── flatpak-build-update-repo.xml ├── flatpak-build.xml ├── flatpak-config.xml ├── flatpak-create-usb.xml ├── flatpak-docs.xml.in ├── flatpak-document-export.xml ├── flatpak-document-info.xml ├── flatpak-document-unexport.xml ├── flatpak-documents.xml ├── flatpak-enter.xml ├── flatpak-flatpakref.xml ├── flatpak-flatpakrepo.xml ├── flatpak-history.xml ├── flatpak-info.xml ├── flatpak-install.xml ├── flatpak-installation.xml ├── flatpak-kill.xml ├── flatpak-list.xml ├── flatpak-make-current.xml ├── flatpak-mask.xml ├── flatpak-metadata.xml ├── flatpak-override.xml ├── flatpak-permission-remove.xml ├── flatpak-permission-reset.xml ├── flatpak-permission-set.xml ├── flatpak-permission-show.xml ├── flatpak-permissions.xml ├── flatpak-pin.xml ├── flatpak-ps.xml ├── flatpak-remote-add.xml ├── flatpak-remote-delete.xml ├── flatpak-remote-info.xml ├── flatpak-remote-ls.xml ├── flatpak-remote-modify.xml ├── flatpak-remote.xml ├── flatpak-remotes.xml ├── flatpak-repair.xml ├── flatpak-repo.xml ├── flatpak-run.xml ├── flatpak-search.xml ├── flatpak-spawn.xml ├── flatpak-uninstall.xml ├── flatpak-update.xml ├── flatpak.xml ├── reference │ ├── Makefile.am │ ├── Makefile.in │ ├── flatpak-overrides.txt │ ├── flatpak-sections.txt │ ├── flatpak.types │ ├── html │ │ ├── FlatpakBundleRef.html │ │ ├── FlatpakInstallation.html │ │ ├── FlatpakInstalledRef.html │ │ ├── FlatpakInstance.html │ │ ├── FlatpakRef.html │ │ ├── FlatpakRelatedRef.html │ │ ├── FlatpakRemote.html │ │ ├── FlatpakRemoteRef.html │ │ ├── FlatpakTransaction.html │ │ ├── FlatpakTransactionOperation.html │ │ ├── FlatpakTransactionProgress.html │ │ ├── annotation-glossary.html │ │ ├── ch01.html │ │ ├── ch02.html │ │ ├── flatpak-Error-codes.html │ │ ├── flatpak-Version-information.html │ │ ├── flatpak.devhelp2 │ │ ├── full-api-index.html │ │ ├── gdbus-org.freedesktop.Flatpak.Authenticator.html │ │ ├── gdbus-org.freedesktop.Flatpak.AuthenticatorRequest.html │ │ ├── gdbus-org.freedesktop.Flatpak.Development.html │ │ ├── gdbus-org.freedesktop.Flatpak.SessionHelper.html │ │ ├── gdbus-org.freedesktop.Flatpak.SystemHelper.html │ │ ├── gdbus-org.freedesktop.impl.portal.PermissionStore.html │ │ ├── gdbus-org.freedesktop.portal.Documents.html │ │ ├── gdbus-org.freedesktop.portal.Flatpak.UpdateMonitor.html │ │ ├── gdbus-org.freedesktop.portal.Flatpak.html │ │ ├── home.png │ │ ├── index.html │ │ ├── left-insensitive.png │ │ ├── left.png │ │ ├── object-tree.html │ │ ├── right-insensitive.png │ │ ├── right.png │ │ ├── style.css │ │ ├── up-insensitive.png │ │ └── up.png │ ├── libflatpak-docs.xml │ └── version.xml.in └── xmlto-config.xsl ├── env.d ├── 60-flatpak ├── 60-flatpak-system-only └── flatpak.env.in ├── flatpak.pc.in ├── flatpak.png ├── gtk-doc.make ├── icon-validator ├── Makefile.am.inc └── validate-icon.c ├── install-sh ├── ltmain.sh ├── m4 ├── attributes.m4 ├── gettext.m4 ├── glibtests.m4 ├── gtk-doc.m4 ├── iconv.m4 ├── intlmacosx.m4 ├── lib-ld.m4 ├── lib-link.m4 ├── lib-prefix.m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 ├── lt~obsolete.m4 ├── nls.m4 ├── po.m4 └── progtest.m4 ├── missing ├── oci-authenticator ├── Makefile.am.inc ├── flatpak-oci-authenticator.c ├── flatpak-oci-authenticator.service.in └── org.flatpak.Authenticator.Oci.service.in ├── po ├── LINGUAS ├── Makefile.in.in ├── Makevars ├── POTFILES.in ├── Rules-quot ├── boldquot.sed ├── cs.gmo ├── cs.po ├── da.gmo ├── da.po ├── de.gmo ├── de.po ├── en@boldquot.header ├── en@quot.header ├── en_GB.gmo ├── en_GB.po ├── es.gmo ├── es.po ├── flatpak.pot ├── fr.gmo ├── fr.po ├── gl.gmo ├── gl.po ├── hi.gmo ├── hi.po ├── hr.gmo ├── hr.po ├── hu.gmo ├── hu.po ├── id.gmo ├── id.po ├── insert-header.sin ├── oc.gmo ├── oc.po ├── pl.gmo ├── pl.po ├── pt.gmo ├── pt.po ├── pt_BR.gmo ├── pt_BR.po ├── quot.sed ├── remove-potcdate.sin ├── ro.gmo ├── ro.po ├── ru.gmo ├── ru.po ├── sk.gmo ├── sk.po ├── stamp-po ├── sv.gmo ├── sv.po ├── tr.gmo ├── tr.po ├── uk.gmo ├── uk.po ├── zh_CN.gmo ├── zh_CN.po ├── zh_TW.gmo └── zh_TW.po ├── portal ├── Makefile.am.inc ├── flatpak-portal-app-info.c ├── flatpak-portal-app-info.h ├── flatpak-portal.c ├── flatpak-portal.h ├── flatpak-portal.service.in ├── org.freedesktop.portal.Flatpak.service.in ├── portal-impl.c └── portal-impl.h ├── profile ├── flatpak.fish └── flatpak.sh ├── revokefs ├── Makefile.am.inc ├── demo.c ├── main.c ├── writer.c └── writer.h ├── scripts ├── flatpak-bisect └── flatpak-coredumpctl ├── selinux ├── Makefile.am.inc ├── build-selinux.sh ├── flatpak.fc ├── flatpak.if └── flatpak.te ├── session-helper ├── Makefile.am.inc ├── flatpak-session-helper.c ├── flatpak-session-helper.h ├── flatpak-session-helper.service.in └── org.freedesktop.Flatpak.service.in ├── sideload-repos-systemd ├── Makefile.am.inc ├── flatpak-create-sideload-symlinks.sh ├── flatpak-sideload-usb-repo.path.in ├── flatpak-sideload-usb-repo.service.in └── tmpfiles.d │ └── flatpak-sideload-repos.conf ├── subprojects ├── Makefile-bwrap.am.inc ├── Makefile-libglnx.am.inc ├── bubblewrap │ ├── bind-mount.c │ ├── bind-mount.h │ ├── bubblewrap.c │ ├── network.c │ ├── network.h │ ├── utils.c │ └── utils.h ├── dbus-proxy │ ├── backport-autoptr.h │ ├── dbus-proxy.c │ ├── flatpak-proxy.c │ └── flatpak-proxy.h ├── libglnx │ ├── COPYING │ ├── LICENSES │ │ ├── LGPL-2.0-or-later.txt │ │ └── LGPL-2.1-or-later.txt │ ├── README.md │ ├── glnx-backport-autocleanups.h │ ├── glnx-backport-autoptr.h │ ├── glnx-backports.c │ ├── glnx-backports.h │ ├── glnx-console.c │ ├── glnx-console.h │ ├── glnx-dirfd.c │ ├── glnx-dirfd.h │ ├── glnx-errors.c │ ├── glnx-errors.h │ ├── glnx-fdio.c │ ├── glnx-fdio.h │ ├── glnx-local-alloc.c │ ├── glnx-local-alloc.h │ ├── glnx-lockfile.c │ ├── glnx-lockfile.h │ ├── glnx-macros.h │ ├── glnx-missing-syscall.h │ ├── glnx-missing.h │ ├── glnx-shutil.c │ ├── glnx-shutil.h │ ├── glnx-xattrs.c │ ├── glnx-xattrs.h │ ├── libglnx.h │ ├── libglnx.m4 │ └── tests │ │ ├── libglnx-testlib.c │ │ ├── libglnx-testlib.h │ │ ├── test-libglnx-errors.c │ │ ├── test-libglnx-fdio.c │ │ ├── test-libglnx-macros.c │ │ ├── test-libglnx-shutil.c │ │ └── test-libglnx-xattrs.c └── variant-schema-compiler │ └── variant-schema-compiler ├── system-helper ├── Makefile.am.inc ├── flatpak-system-helper.c ├── flatpak-system-helper.h ├── flatpak-system-helper.service.in ├── flatpak.conf.in ├── org.freedesktop.Flatpak.SystemHelper.conf ├── org.freedesktop.Flatpak.SystemHelper.service.in ├── org.freedesktop.Flatpak.policy.in └── org.freedesktop.Flatpak.rules.in ├── test-driver ├── tests ├── Makefile-test-matrix.am.inc ├── Makefile.am.inc ├── can-use-fuse.c ├── can-use-fuse.h ├── expand-test-matrix.sh ├── flatpak.supp ├── glib.supp ├── hold-lock.c ├── http-utils-test-server.py ├── httpcache.c ├── libpreload.c ├── libtest.sh ├── list-unused.c ├── make-multi-collection-id-repo.sh ├── make-runtime-repos ├── make-test-app.sh ├── make-test-runtime.sh ├── mock-flatpak.c ├── oci-registry-client.py ├── oci-registry-server.py ├── org.flatpak.Authenticator.test.service.in ├── org.freedesktop.impl.portal.desktop.test.service.in ├── org.test.Hello.png ├── package_version.txt ├── session.conf.in ├── test-auth.sh ├── test-authenticator.c ├── test-basic.sh ├── test-build-update-repo.sh ├── test-bundle.sh ├── test-completion.sh ├── test-config.sh ├── test-context.c ├── test-default-remotes.sh ├── test-exports.c ├── test-extensions.sh ├── test-history.sh ├── test-http-utils.sh ├── test-info.sh ├── test-instance.c ├── test-keyring │ ├── README │ ├── pubring.gpg │ └── secring.gpg ├── test-keyring2 │ ├── README │ ├── pubring.gpg │ └── secring.gpg ├── test-metadata-validation.sh ├── test-oci-registry.sh ├── test-oci.sh ├── test-override.sh ├── test-portal-impl.c ├── test-portal.c ├── test-prune.sh ├── test-repair.sh ├── test-repo.sh ├── test-run.sh ├── test-seccomp.sh ├── test-sideload.sh ├── test-subset.sh ├── test-summaries.sh ├── test-unused.sh ├── test-update-portal.c ├── test-update-portal.sh ├── test-update-remote-configuration.sh ├── test-webserver.sh ├── test-wrapper.sh ├── test.filter ├── test.portal.in ├── testcommon.c ├── testlib.c ├── testlib.h ├── testlibrary.c ├── try-syscall.c ├── update-test-matrix └── web-server.py └── triggers ├── desktop-database.trigger ├── gtk-icon-cache.trigger └── mime-database.trigger /INSTALL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/INSTALL -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Flatpak icon 3 |

4 | 5 | Flatpak is a system for building, distributing, and running sandboxed 6 | desktop applications on Linux. 7 | 8 | See https://flatpak.org/ for more information. 9 | 10 | Community discussion happens in [#flatpak:matrix.org](https://matrix.to/#/#flatpak:matrix.org), on [the mailing list](https://lists.freedesktop.org/mailman/listinfo/flatpak), and on [the Flathub Discourse](https://discourse.flathub.org/). 11 | 12 | Read documentation for Flatpak [here](https://docs.flatpak.org/en/latest/index.html). 13 | 14 | # Contributing 15 | 16 | Flatpak welcomes contributions from anyone! Here are some ways you can help: 17 | * Fix [one of the issues](https://github.com/flatpak/flatpak/issues/) and submit a PR 18 | * Update flatpak's translations and submit a PR 19 | * Improve flatpak's documentation, hosted at http://docs.flatpak.org and developed over in [flatpak-docs](https://github.com/flatpak/flatpak-docs) 20 | * Find a bug and [submit a detailed report](https://github.com/flatpak/flatpak/issues/new) including your OS, flatpak version, and the steps to reproduce 21 | * Add your favorite application to [Flathub](https://flathub.org) by writing a flatpak-builder manifest and [submitting it](https://github.com/flathub/flathub/wiki/App-Submission) 22 | * Improve the [Flatpak support](https://github.com/flatpak/flatpak/wiki/Distribution) in your favorite Linux distribution 23 | 24 | # Hacking 25 | See [CONTRIBUTING.md](CONTRIBUTING.md) 26 | 27 | # Related Projects 28 | 29 | Here are some notable projects in the Flatpak ecosystem: 30 | * [Flatseal](https://github.com/tchx84/flatseal): An app for managing permissions of Flatpak apps without using the CLI 31 | * [Flat-manager](https://github.com/flatpak/flat-manager): A tool for managing Flatpak repositories 32 | -------------------------------------------------------------------------------- /app/flatpak-cli-transaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_CLI_TRANSACTION_H__ 22 | #define __FLATPAK_CLI_TRANSACTION_H__ 23 | 24 | #include "flatpak-transaction.h" 25 | #include "flatpak-dir-private.h" 26 | 27 | #define FLATPAK_TYPE_CLI_TRANSACTION flatpak_cli_transaction_get_type () 28 | G_DECLARE_FINAL_TYPE (FlatpakCliTransaction, flatpak_cli_transaction, FLATPAK, CLI_TRANSACTION, FlatpakTransaction) 29 | 30 | FlatpakTransaction * flatpak_cli_transaction_new (FlatpakDir * dir, 31 | gboolean disable_interaction, 32 | gboolean stop_on_first_error, 33 | gboolean non_default_arch, 34 | GError **error); 35 | 36 | #endif /* __FLATPAK_CLI_TRANSACTION_H__ */ 37 | -------------------------------------------------------------------------------- /app/flatpak-polkit-agent-text-listener.h: -------------------------------------------------------------------------------- 1 | #ifndef __FLATPAK_POLKIT_AGENT_TEXT_LISTENER_H 2 | #define __FLATPAK_POLKIT_AGENT_TEXT_LISTENER_H 3 | 4 | #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE 5 | #include 6 | #include 7 | 8 | G_BEGIN_DECLS 9 | 10 | typedef struct _FlatpakPolkitAgentTextListener FlatpakPolkitAgentTextListener; 11 | 12 | #define FLATPAK_POLKIT_AGENT_TYPE_TEXT_LISTENER (flatpak_polkit_agent_text_listener_get_type()) 13 | #define FLATPAK_POLKIT_AGENT_TEXT_LISTENER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), FLATPAK_POLKIT_AGENT_TYPE_TEXT_LISTENER, FlatpakPolkitAgentTextListener)) 14 | #define FLATPAK_POLKIT_AGENT_IS_TEXT_LISTENER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), FLATPAK_POLKIT_AGENT_TYPE_TEXT_LISTENER)) 15 | 16 | GType flatpak_polkit_agent_text_listener_get_type (void) G_GNUC_CONST; 17 | PolkitAgentListener *flatpak_polkit_agent_text_listener_new (GCancellable *cancellable, 18 | GError **error); 19 | 20 | 21 | G_END_DECLS 22 | 23 | #endif /* __FLATPAK_POLKIT_AGENT_TEXT_LISTENER_H */ 24 | 25 | -------------------------------------------------------------------------------- /app/flatpak-quiet-transaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2019 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Matthias Clasen 19 | */ 20 | 21 | #ifndef __FLATPAK_QUIET_TRANSACTION_H__ 22 | #define __FLATPAK_QUIET_TRANSACTION_H__ 23 | 24 | #include "flatpak-transaction.h" 25 | #include "flatpak-dir-private.h" 26 | 27 | #define FLATPAK_TYPE_QUIET_TRANSACTION flatpak_quiet_transaction_get_type () 28 | G_DECLARE_FINAL_TYPE (FlatpakQuietTransaction, flatpak_quiet_transaction, FLATPAK, QUIET_TRANSACTION, FlatpakTransaction) 29 | 30 | FlatpakTransaction * flatpak_quiet_transaction_new (FlatpakDir * dir, 31 | GError **error); 32 | 33 | #endif /* __FLATPAK_QUIET_TRANSACTION_H__ */ 34 | -------------------------------------------------------------------------------- /app/parse-datetime.h: -------------------------------------------------------------------------------- 1 | /* Parse a string into an internal time stamp. 2 | 3 | Copyright (C) 1995, 1997-1998, 2003-2004, 2007, 2009-2015 Free Software 4 | Foundation, Inc. 5 | 6 | This program is free software: you can redistribute it and/or modify it 7 | under the terms of the GNU Lesser General Public License as published 8 | by the Free Software Foundation; either version 2 of the License, or 9 | (at your option) any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program. If not, see . */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | bool parse_datetime (struct timespec *, 25 | char const *, 26 | struct timespec const *); 27 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | 4 | test -n "$srcdir" || srcdir=$(dirname "$0") 5 | test -n "$srcdir" || srcdir=. 6 | 7 | olddir=$(pwd) 8 | cd "$srcdir" 9 | 10 | if ! command -v autoreconf >/dev/null; then 11 | echo "*** No autoreconf found, please install it ***" 12 | exit 1 13 | fi 14 | 15 | # INSTALL are required by automake, but may be deleted by clean 16 | # up rules. to get automake to work, simply touch these here, they will be 17 | # regenerated from their corresponding *.in files by ./configure anyway. 18 | touch INSTALL 19 | 20 | if ! test -f subprojects/libglnx/README.md -a -f subprojects/bubblewrap/README.md -a -f subprojects/dbus-proxy/README.md; then 21 | git submodule update --init 22 | fi 23 | # Workaround automake bug with subdir-objects and computed paths 24 | sed -e 's,$(libglnx_srcpath),subprojects/libglnx,g' < subprojects/libglnx/Makefile-libglnx.am > subprojects/Makefile-libglnx.am.inc 25 | sed -e 's,$(bwrap_srcpath),subprojects/bubblewrap,g' < subprojects/bubblewrap/Makefile-bwrap.am > subprojects/Makefile-bwrap.am.inc 26 | 27 | if ! command -v gtkdocize >/dev/null; then 28 | echo "*** You don't have gtk-doc installed, and thus won't be able to generate the documentation. ***" 29 | rm -f gtk-doc.make 30 | cat > gtk-doc.make <. 16 | * 17 | * Authors: 18 | * Matthias Clasen 19 | */ 20 | 21 | #ifndef __FLATPAK_APPDATA_PRIVATE_H__ 22 | #define __FLATPAK_APPDATA_PRIVATE_H__ 23 | 24 | #include 25 | 26 | gboolean flatpak_parse_appdata (const char *appdata, 27 | const char *app_id, 28 | GHashTable **names, 29 | GHashTable **comments, 30 | char **version, 31 | char **license, 32 | char **content_rating_type, 33 | GHashTable **content_rating); 34 | 35 | #endif /* __FLATPAK_APPDATA_PRIVATE_H__ */ 36 | -------------------------------------------------------------------------------- /common/flatpak-bundle-ref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_BUNDLE_REF_H__ 26 | #define __FLATPAK_BUNDLE_REF_H__ 27 | 28 | typedef struct _FlatpakBundleRef FlatpakBundleRef; 29 | 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define FLATPAK_TYPE_BUNDLE_REF flatpak_bundle_ref_get_type () 36 | #define FLATPAK_BUNDLE_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_BUNDLE_REF, FlatpakBundleRef)) 37 | #define FLATPAK_IS_BUNDLE_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_BUNDLE_REF)) 38 | 39 | FLATPAK_EXTERN GType flatpak_bundle_ref_get_type (void); 40 | 41 | struct _FlatpakBundleRef 42 | { 43 | FlatpakRef parent; 44 | }; 45 | 46 | typedef struct 47 | { 48 | FlatpakRefClass parent_class; 49 | } FlatpakBundleRefClass; 50 | 51 | FLATPAK_EXTERN FlatpakBundleRef *flatpak_bundle_ref_new (GFile *file, 52 | GError **error); 53 | FLATPAK_EXTERN GFile *flatpak_bundle_ref_get_file (FlatpakBundleRef *self); 54 | FLATPAK_EXTERN GBytes *flatpak_bundle_ref_get_metadata (FlatpakBundleRef *self); 55 | FLATPAK_EXTERN GBytes *flatpak_bundle_ref_get_appstream (FlatpakBundleRef *self); 56 | FLATPAK_EXTERN GBytes *flatpak_bundle_ref_get_icon (FlatpakBundleRef *self, 57 | int size); 58 | FLATPAK_EXTERN char *flatpak_bundle_ref_get_origin (FlatpakBundleRef *self); 59 | FLATPAK_EXTERN guint64 flatpak_bundle_ref_get_installed_size (FlatpakBundleRef *self); 60 | FLATPAK_EXTERN char *flatpak_bundle_ref_get_runtime_repo_url (FlatpakBundleRef *self); 61 | 62 | 63 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 64 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakBundleRef, g_object_unref) 65 | #endif 66 | 67 | G_END_DECLS 68 | 69 | #endif /* __FLATPAK_BUNDLE_REF_H__ */ 70 | -------------------------------------------------------------------------------- /common/flatpak-chain-input-stream-private.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2011 Colin Walters 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General 16 | * Public License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #ifndef __GI_SCANNER__ 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define FLATPAK_TYPE_CHAIN_INPUT_STREAM (flatpak_chain_input_stream_get_type ()) 31 | #define FLATPAK_CHAIN_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), FLATPAK_TYPE_CHAIN_INPUT_STREAM, FlatpakChainInputStream)) 32 | #define FLATPAK_CHAIN_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), FLATPAK_TYPE_CHAIN_INPUT_STREAM, FlatpakChainInputStreamClass)) 33 | #define FLATPAK_IS_CHAIN_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), FLATPAK_TYPE_CHAIN_INPUT_STREAM)) 34 | #define FLATPAK_IS_CHAIN_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), FLATPAK_TYPE_CHAIN_INPUT_STREAM)) 35 | #define FLATPAK_CHAIN_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), FLATPAK_TYPE_CHAIN_INPUT_STREAM, FlatpakChainInputStreamClass)) 36 | 37 | typedef struct _FlatpakChainInputStream FlatpakChainInputStream; 38 | typedef struct _FlatpakChainInputStreamClass FlatpakChainInputStreamClass; 39 | typedef struct _FlatpakChainInputStreamPrivate FlatpakChainInputStreamPrivate; 40 | 41 | struct _FlatpakChainInputStream 42 | { 43 | GInputStream parent_instance; 44 | }; 45 | 46 | struct _FlatpakChainInputStreamClass 47 | { 48 | GInputStreamClass parent_class; 49 | 50 | /*< private >*/ 51 | /* Padding for future expansion */ 52 | void (*_g_reserved1) (void); 53 | void (*_g_reserved2) (void); 54 | void (*_g_reserved3) (void); 55 | void (*_g_reserved4) (void); 56 | void (*_g_reserved5) (void); 57 | }; 58 | 59 | GType flatpak_chain_input_stream_get_type (void) G_GNUC_CONST; 60 | 61 | FlatpakChainInputStream * flatpak_chain_input_stream_new (GPtrArray *streams); 62 | 63 | G_END_DECLS 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /common/flatpak-common-types-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_COMMON_TYPES_H__ 22 | #define __FLATPAK_COMMON_TYPES_H__ 23 | 24 | typedef enum { 25 | FLATPAK_KINDS_APP = 1 << 0, 26 | FLATPAK_KINDS_RUNTIME = 1 << 1, 27 | } FlatpakKinds; 28 | 29 | typedef enum { 30 | FLATPAK_RUN_FLAG_DEVEL = (1 << 0), 31 | FLATPAK_RUN_FLAG_BACKGROUND = (1 << 1), 32 | FLATPAK_RUN_FLAG_LOG_SESSION_BUS = (1 << 2), 33 | FLATPAK_RUN_FLAG_LOG_SYSTEM_BUS = (1 << 3), 34 | FLATPAK_RUN_FLAG_NO_SESSION_HELPER = (1 << 4), 35 | FLATPAK_RUN_FLAG_MULTIARCH = (1 << 5), 36 | FLATPAK_RUN_FLAG_WRITABLE_ETC = (1 << 6), 37 | FLATPAK_RUN_FLAG_NO_SESSION_BUS_PROXY = (1 << 7), 38 | FLATPAK_RUN_FLAG_NO_SYSTEM_BUS_PROXY = (1 << 8), 39 | FLATPAK_RUN_FLAG_SET_PERSONALITY = (1 << 9), 40 | FLATPAK_RUN_FLAG_FILE_FORWARDING = (1 << 10), 41 | FLATPAK_RUN_FLAG_DIE_WITH_PARENT = (1 << 11), 42 | FLATPAK_RUN_FLAG_LOG_A11Y_BUS = (1 << 12), 43 | FLATPAK_RUN_FLAG_NO_A11Y_BUS_PROXY = (1 << 13), 44 | FLATPAK_RUN_FLAG_SANDBOX = (1 << 14), 45 | FLATPAK_RUN_FLAG_NO_DOCUMENTS_PORTAL = (1 << 15), 46 | FLATPAK_RUN_FLAG_BLUETOOTH = (1 << 16), 47 | FLATPAK_RUN_FLAG_CANBUS = (1 << 17), 48 | FLATPAK_RUN_FLAG_DO_NOT_REAP = (1 << 18), 49 | FLATPAK_RUN_FLAG_NO_PROC = (1 << 19), 50 | FLATPAK_RUN_FLAG_PARENT_EXPOSE_PIDS = (1 << 20), 51 | FLATPAK_RUN_FLAG_PARENT_SHARE_PIDS = (1 << 21), 52 | } FlatpakRunFlags; 53 | 54 | typedef struct FlatpakDir FlatpakDir; 55 | typedef struct FlatpakDeploy FlatpakDeploy; 56 | typedef struct FlatpakOciRegistry FlatpakOciRegistry; 57 | typedef struct _FlatpakOciManifest FlatpakOciManifest; 58 | typedef struct _FlatpakOciImage FlatpakOciImage; 59 | 60 | #endif /* __FLATPAK_COMMON_TYPES_H__ */ 61 | -------------------------------------------------------------------------------- /common/flatpak-enum-types.c.template: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #include "config.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | /*** END file-header ***/ 9 | 10 | /*** BEGIN file-production ***/ 11 | /* enumerations from "@basename@" */ 12 | /*** END file-production ***/ 13 | 14 | /*** BEGIN value-header ***/ 15 | GType 16 | @enum_name@_get_type (void) 17 | { 18 | static gsize static_g_@type@_type_id = 0; 19 | 20 | if (g_once_init_enter (&static_g_@type@_type_id)) 21 | { 22 | static const G@Type@Value values[] = { 23 | /*** END value-header ***/ 24 | 25 | /*** BEGIN value-production ***/ 26 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 27 | /*** END value-production ***/ 28 | 29 | /*** BEGIN value-tail ***/ 30 | { 0, NULL, NULL } 31 | }; 32 | GType g_define_type_id = 33 | g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); 34 | g_once_init_leave (&static_g_@type@_type_id, g_define_type_id); 35 | } 36 | 37 | return static_g_@type@_type_id; 38 | } 39 | 40 | /*** END value-tail ***/ 41 | -------------------------------------------------------------------------------- /common/flatpak-enum-types.h.template: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | #ifndef __FLATPAK_ENUM_TYPES_H__ 3 | #define __FLATPAK_ENUM_TYPES_H__ 4 | 5 | #include 6 | 7 | G_BEGIN_DECLS 8 | /*** END file-header ***/ 9 | 10 | /*** BEGIN file-production ***/ 11 | 12 | /* enumerations from "@basename@" */ 13 | /*** END file-production ***/ 14 | 15 | /*** BEGIN value-header ***/ 16 | FLATPAK_EXTERN GType @enum_name@_get_type (void) G_GNUC_CONST; 17 | #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 18 | /*** END value-header ***/ 19 | 20 | /*** BEGIN file-tail ***/ 21 | G_END_DECLS 22 | 23 | #endif /* __GIO_ENUM_TYPES_H__ */ 24 | /*** END file-tail ***/ 25 | -------------------------------------------------------------------------------- /common/flatpak-error.c: -------------------------------------------------------------------------------- 1 | /* flatpak-error.c 2 | * 3 | * Copyright (C) 2015 Red Hat, Inc 4 | * 5 | * This file is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This file is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: 19 | * Alexander Larsson 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include "flatpak-error.h" 25 | 26 | #include 27 | 28 | /** 29 | * SECTION:flatpak-error 30 | * @Title: Error codes 31 | * 32 | * The FlatpakError and FlatpakPortalError enumerations contain error codes 33 | * for some common errors. 34 | */ 35 | 36 | /* This is actually defined in common/flatpak-utils.c so the common code can report errors */ 37 | -------------------------------------------------------------------------------- /common/flatpak-installation-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_INSTALLATION_PRIVATE_H__ 22 | #define __FLATPAK_INSTALLATION_PRIVATE_H__ 23 | 24 | #include "flatpak-installation.h" 25 | 26 | #include "flatpak-dir-private.h" 27 | 28 | FlatpakDir *flatpak_installation_clone_dir_noensure (FlatpakInstallation *self); 29 | 30 | FlatpakDir *flatpak_installation_get_dir (FlatpakInstallation *self, 31 | GError **error); 32 | FlatpakDir *flatpak_installation_clone_dir (FlatpakInstallation *self, 33 | GCancellable *cancellable, 34 | GError **error); 35 | 36 | FlatpakInstallation *flatpak_installation_new_for_dir (FlatpakDir *dir, 37 | GCancellable *cancellable, 38 | GError **error); 39 | 40 | #endif /* __FLATPAK_INSTALLATION_PRIVATE_H__ */ 41 | -------------------------------------------------------------------------------- /common/flatpak-installed-ref-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_INSTALLED_REF_PRIVATE_H__ 26 | #define __FLATPAK_INSTALLED_REF_PRIVATE_H__ 27 | 28 | #include 29 | #include 30 | 31 | FlatpakInstalledRef *flatpak_installed_ref_new (FlatpakDecomposed *ref, 32 | const char *commit, 33 | const char *latest_commit, 34 | const char *origin, 35 | const char *collection_id, 36 | const char **subpaths, 37 | const char *deploy_dir, 38 | guint64 installed_size, 39 | gboolean current, 40 | const char *eol, 41 | const char *eol_rebase, 42 | const char *appdata_name, 43 | const char *appdata_summary, 44 | const char *appdata_version, 45 | const char *appdata_license, 46 | const char *appdata_content_rating_type, 47 | GHashTable *appdata_content_rating); 48 | 49 | #endif /* __FLATPAK_INSTALLED_REF_PRIVATE_H__ */ 50 | -------------------------------------------------------------------------------- /common/flatpak-instance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Matthias Clasen 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_INSTANCE_H__ 26 | #define __FLATPAK_INSTANCE_H__ 27 | 28 | typedef struct _FlatpakInstance FlatpakInstance; 29 | 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define FLATPAK_TYPE_INSTANCE flatpak_instance_get_type () 35 | #define FLATPAK_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_INSTANCE, FlatpakInstance)) 36 | #define FLATPAK_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_INSTANCE)) 37 | 38 | FLATPAK_EXTERN GType flatpak_instance_get_type (void); 39 | 40 | struct _FlatpakInstance 41 | { 42 | GObject parent; 43 | }; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | } FlatpakInstanceClass; 49 | 50 | 51 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 52 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakInstance, g_object_unref) 53 | #endif 54 | 55 | FLATPAK_EXTERN GPtrArray * flatpak_instance_get_all (void); 56 | 57 | FLATPAK_EXTERN const char * flatpak_instance_get_id (FlatpakInstance *self); 58 | FLATPAK_EXTERN const char * flatpak_instance_get_app (FlatpakInstance *self); 59 | FLATPAK_EXTERN const char * flatpak_instance_get_arch (FlatpakInstance *self); 60 | FLATPAK_EXTERN const char * flatpak_instance_get_branch (FlatpakInstance *self); 61 | FLATPAK_EXTERN const char * flatpak_instance_get_commit (FlatpakInstance *self); 62 | FLATPAK_EXTERN const char * flatpak_instance_get_runtime (FlatpakInstance *self); 63 | FLATPAK_EXTERN const char * flatpak_instance_get_runtime_commit (FlatpakInstance *self); 64 | FLATPAK_EXTERN int flatpak_instance_get_pid (FlatpakInstance *self); 65 | FLATPAK_EXTERN int flatpak_instance_get_child_pid (FlatpakInstance *self); 66 | FLATPAK_EXTERN GKeyFile * flatpak_instance_get_info (FlatpakInstance *self); 67 | 68 | FLATPAK_EXTERN gboolean flatpak_instance_is_running (FlatpakInstance *self); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* __FLATPAK_INSTANCE_H__ */ 73 | -------------------------------------------------------------------------------- /common/flatpak-parental-controls-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Endless Mobile, Inc. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Philip Withnall 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_PARENTAL_CONTROLS_PRIVATE_H__ 26 | #define __FLATPAK_PARENTAL_CONTROLS_PRIVATE_H__ 27 | 28 | #include 29 | #include 30 | 31 | gboolean flatpak_oars_check_rating (GHashTable *content_rating, 32 | const gchar *content_rating_type, 33 | MctAppFilter *filter); 34 | 35 | #endif /* __FLATPAK_PARENTAL_CONTROLS_PRIVATE_H__ */ 36 | -------------------------------------------------------------------------------- /common/flatpak-portal-error.c: -------------------------------------------------------------------------------- 1 | /* flatpak-error.c 2 | * 3 | * Copyright (C) 2015 Red Hat, Inc 4 | * 5 | * This file is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This file is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: 19 | * Alexander Larsson 20 | */ 21 | 22 | #include "config.h" 23 | 24 | #include "flatpak-portal-error.h" 25 | 26 | #include 27 | 28 | static const GDBusErrorEntry flatpak_error_entries[] = { 29 | {FLATPAK_PORTAL_ERROR_FAILED, "org.freedesktop.portal.Error.Failed"}, 30 | {FLATPAK_PORTAL_ERROR_INVALID_ARGUMENT, "org.freedesktop.portal.Error.InvalidArgument"}, 31 | {FLATPAK_PORTAL_ERROR_NOT_FOUND, "org.freedesktop.portal.Error.NotFound"}, 32 | {FLATPAK_PORTAL_ERROR_EXISTS, "org.freedesktop.portal.Error.Exists"}, 33 | {FLATPAK_PORTAL_ERROR_NOT_ALLOWED, "org.freedesktop.portal.Error.NotAllowed"}, 34 | {FLATPAK_PORTAL_ERROR_CANCELLED, "org.freedesktop.portal.Error.Cancelled"}, 35 | {FLATPAK_PORTAL_ERROR_WINDOW_DESTROYED, "org.freedesktop.portal.Error.WindowDestroyed"}, 36 | }; 37 | 38 | GQuark 39 | flatpak_portal_error_quark (void) 40 | { 41 | static volatile gsize quark_volatile = 0; 42 | 43 | g_dbus_error_register_error_domain ("flatpak-portal-error-quark", 44 | &quark_volatile, 45 | flatpak_error_entries, 46 | G_N_ELEMENTS (flatpak_error_entries)); 47 | return (GQuark) quark_volatile; 48 | } 49 | -------------------------------------------------------------------------------- /common/flatpak-portal-error.h: -------------------------------------------------------------------------------- 1 | /* flatpak-portal-error.c 2 | * 3 | * Copyright (C) 2015 Red Hat, Inc 4 | * 5 | * This file is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * This file is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License 16 | * along with this program. If not, see . 17 | * 18 | * Authors: 19 | * Alexander Larsson 20 | */ 21 | 22 | #ifndef FLATPAK_PORTAL_ERROR_H 23 | #define FLATPAK_PORTAL_ERROR_H 24 | 25 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 26 | #error "Only can be included directly." 27 | #endif 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | /** 34 | * FlatpakPortalError: 35 | * @FLATPAK_PORTAL_ERROR_FAILED: General portal failure 36 | * @FLATPAK_PORTAL_ERROR_INVALID_ARGUMENT: An argument was invalid 37 | * @FLATPAK_PORTAL_ERROR_NOT_FOUND: The object was not found 38 | * @FLATPAK_PORTAL_ERROR_EXISTS: The object already exists 39 | * @FLATPAK_PORTAL_ERROR_NOT_ALLOWED: The call was not allowed 40 | * @FLATPAK_PORTAL_ERROR_CANCELLED: The call was cancelled by the user 41 | * @FLATPAK_PORTAL_ERROR_WINDOW_DESTROYED: The window was destroyed by the user 42 | * 43 | * Error codes returned by portal calls. 44 | */ 45 | typedef enum { 46 | FLATPAK_PORTAL_ERROR_FAILED = 0, 47 | FLATPAK_PORTAL_ERROR_INVALID_ARGUMENT, 48 | FLATPAK_PORTAL_ERROR_NOT_FOUND, 49 | FLATPAK_PORTAL_ERROR_EXISTS, 50 | FLATPAK_PORTAL_ERROR_NOT_ALLOWED, 51 | FLATPAK_PORTAL_ERROR_CANCELLED, 52 | FLATPAK_PORTAL_ERROR_WINDOW_DESTROYED, 53 | } FlatpakPortalError; 54 | 55 | 56 | /** 57 | * FLATPAK_PORTAL_ERROR: 58 | * 59 | * The error domain for #FlatpakPortalError errors. 60 | */ 61 | #define FLATPAK_PORTAL_ERROR flatpak_portal_error_quark () 62 | 63 | FLATPAK_EXTERN GQuark flatpak_portal_error_quark (void); 64 | 65 | G_END_DECLS 66 | 67 | #endif /* FLATPAK_PORTAL_ERROR_H */ 68 | -------------------------------------------------------------------------------- /common/flatpak-prune-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2021 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_PRUNE_H__ 22 | #define __FLATPAK_PRUNE_H__ 23 | 24 | #include "flatpak-utils-private.h" 25 | 26 | gboolean flatpak_repo_prune (OstreeRepo *repo, 27 | int depth, 28 | gboolean dry_run, 29 | int *out_objects_total, 30 | int *out_objects_pruned, 31 | guint64 *out_pruned_object_size_total, 32 | GCancellable *cancellable, 33 | GError **error); 34 | 35 | #endif /* __FLATPAK_PRUNE_H__ */ 36 | -------------------------------------------------------------------------------- /common/flatpak-ref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_REF_H__ 26 | #define __FLATPAK_REF_H__ 27 | 28 | typedef struct _FlatpakRef FlatpakRef; 29 | 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define FLATPAK_TYPE_REF flatpak_ref_get_type () 35 | #define FLATPAK_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_REF, FlatpakRef)) 36 | #define FLATPAK_IS_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_REF)) 37 | 38 | FLATPAK_EXTERN GType flatpak_ref_get_type (void); 39 | 40 | struct _FlatpakRef 41 | { 42 | GObject parent; 43 | }; 44 | 45 | typedef struct 46 | { 47 | GObjectClass parent_class; 48 | } FlatpakRefClass; 49 | 50 | 51 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 52 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRef, g_object_unref) 53 | #endif 54 | 55 | /** 56 | * FlatpakRefKind: 57 | * @FLATPAK_REF_KIND_APP: An application 58 | * @FLATPAK_REF_KIND_RUNTIME: A runtime that applications can use. 59 | * 60 | * The kind of artifact that a FlatpakRef refers to. 61 | */ 62 | typedef enum { 63 | FLATPAK_REF_KIND_APP, 64 | FLATPAK_REF_KIND_RUNTIME, 65 | } FlatpakRefKind; 66 | 67 | FLATPAK_EXTERN const char * flatpak_ref_get_name (FlatpakRef *self); 68 | FLATPAK_EXTERN const char * flatpak_ref_get_arch (FlatpakRef *self); 69 | FLATPAK_EXTERN const char * flatpak_ref_get_branch (FlatpakRef *self); 70 | FLATPAK_EXTERN const char * flatpak_ref_get_commit (FlatpakRef *self); 71 | FLATPAK_EXTERN FlatpakRefKind flatpak_ref_get_kind (FlatpakRef *self); 72 | FLATPAK_EXTERN char * flatpak_ref_format_ref (FlatpakRef *self); 73 | FLATPAK_EXTERN const char * flatpak_ref_format_ref_cached (FlatpakRef *self); 74 | FLATPAK_EXTERN FlatpakRef * flatpak_ref_parse (const char *ref, 75 | GError **error); 76 | FLATPAK_EXTERN const char * flatpak_ref_get_collection_id (FlatpakRef *self); 77 | 78 | G_END_DECLS 79 | 80 | #endif /* __FLATPAK_REF_H__ */ 81 | -------------------------------------------------------------------------------- /common/flatpak-related-ref-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_RELATED_REF_PRIVATE_H__ 26 | #define __FLATPAK_RELATED_REF_PRIVATE_H__ 27 | 28 | #include 29 | #include 30 | 31 | FlatpakRelatedRef *flatpak_related_ref_new (const char *full_ref, 32 | const char *commit, 33 | char **subpaths, 34 | gboolean download, 35 | gboolean delete); 36 | 37 | #endif /* __FLATPAK_RELATED_REF_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /common/flatpak-related-ref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_RELATED_REF_H__ 26 | #define __FLATPAK_RELATED_REF_H__ 27 | 28 | typedef struct _FlatpakRelatedRef FlatpakRelatedRef; 29 | 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define FLATPAK_TYPE_RELATED_REF flatpak_related_ref_get_type () 36 | #define FLATPAK_RELATED_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_RELATED_REF, FlatpakRelatedRef)) 37 | #define FLATPAK_IS_RELATED_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_RELATED_REF)) 38 | 39 | FLATPAK_EXTERN GType flatpak_related_ref_get_type (void); 40 | 41 | struct _FlatpakRelatedRef 42 | { 43 | FlatpakRef parent; 44 | }; 45 | 46 | typedef struct 47 | { 48 | FlatpakRefClass parent_class; 49 | } FlatpakRelatedRefClass; 50 | 51 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 52 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRelatedRef, g_object_unref) 53 | #endif 54 | 55 | FLATPAK_EXTERN const char * const *flatpak_related_ref_get_subpaths (FlatpakRelatedRef * self); 56 | FLATPAK_EXTERN gboolean flatpak_related_ref_should_download (FlatpakRelatedRef *self); 57 | FLATPAK_EXTERN gboolean flatpak_related_ref_should_delete (FlatpakRelatedRef *self); 58 | FLATPAK_EXTERN gboolean flatpak_related_ref_should_autoprune (FlatpakRelatedRef *self); 59 | 60 | G_END_DECLS 61 | 62 | #endif /* __FLATPAK_RELATED_REF_H__ */ 63 | -------------------------------------------------------------------------------- /common/flatpak-remote-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_REMOTE_PRIVATE_H__ 26 | #define __FLATPAK_REMOTE_PRIVATE_H__ 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | FlatpakRemote *flatpak_remote_new_with_dir (const char *name, 33 | FlatpakDir *dir); 34 | 35 | gboolean flatpak_remote_commit (FlatpakRemote *self, 36 | FlatpakDir *dir, 37 | GCancellable *cancellable, 38 | GError **error); 39 | gboolean flatpak_remote_commit_filter (FlatpakRemote *self, 40 | FlatpakDir *dir, 41 | GCancellable *cancellable, 42 | GError **error); 43 | 44 | #endif /* __FLATPAK_REMOTE_PRIVATE_H__ */ 45 | -------------------------------------------------------------------------------- /common/flatpak-remote-ref-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_REMOTE_REF_PRIVATE_H__ 26 | #define __FLATPAK_REMOTE_REF_PRIVATE_H__ 27 | 28 | #include 29 | #include 30 | 31 | FlatpakRemoteRef *flatpak_remote_ref_new (FlatpakDecomposed *ref, 32 | const char *commit, 33 | const char *remote_name, 34 | const char *collection_id, 35 | FlatpakRemoteState *remote_state); 36 | 37 | #endif /* __FLATPAK_REMOTE_REF_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /common/flatpak-remote-ref.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined(__FLATPAK_H_INSIDE__) && !defined(FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_REMOTE_REF_H__ 26 | #define __FLATPAK_REMOTE_REF_H__ 27 | 28 | typedef struct _FlatpakRemoteRef FlatpakRemoteRef; 29 | 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define FLATPAK_TYPE_REMOTE_REF flatpak_remote_ref_get_type () 36 | #define FLATPAK_REMOTE_REF(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), FLATPAK_TYPE_REMOTE_REF, FlatpakRemoteRef)) 37 | #define FLATPAK_IS_REMOTE_REF(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FLATPAK_TYPE_REMOTE_REF)) 38 | 39 | FLATPAK_EXTERN GType flatpak_remote_ref_get_type (void); 40 | 41 | struct _FlatpakRemoteRef 42 | { 43 | FlatpakRef parent; 44 | }; 45 | 46 | typedef struct 47 | { 48 | FlatpakRefClass parent_class; 49 | } FlatpakRemoteRefClass; 50 | 51 | FLATPAK_EXTERN const char * flatpak_remote_ref_get_remote_name (FlatpakRemoteRef *self); 52 | FLATPAK_EXTERN guint64 flatpak_remote_ref_get_installed_size (FlatpakRemoteRef *self); 53 | FLATPAK_EXTERN guint64 flatpak_remote_ref_get_download_size (FlatpakRemoteRef *self); 54 | FLATPAK_EXTERN GBytes * flatpak_remote_ref_get_metadata (FlatpakRemoteRef *self); 55 | FLATPAK_EXTERN const char * flatpak_remote_ref_get_eol (FlatpakRemoteRef *self); 56 | FLATPAK_EXTERN const char * flatpak_remote_ref_get_eol_rebase (FlatpakRemoteRef *self); 57 | 58 | #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC 59 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakRemoteRef, g_object_unref) 60 | #endif 61 | 62 | G_END_DECLS 63 | 64 | #endif /* __FLATPAK_REMOTE_REF_H__ */ 65 | -------------------------------------------------------------------------------- /common/flatpak-transaction-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_TRANSACTION_PRIVATE_H__ 22 | #define __FLATPAK_TRANSACTION_PRIVATE_H__ 23 | 24 | #include "flatpak-transaction.h" 25 | #include "flatpak-ref-utils-private.h" 26 | 27 | FlatpakRemoteState *flatpak_transaction_ensure_remote_state (FlatpakTransaction *self, 28 | FlatpakTransactionOperationType kind, 29 | const char *remote, 30 | const char *opt_arch, 31 | GError **error); 32 | 33 | FlatpakDecomposed * flatpak_transaction_operation_get_decomposed (FlatpakTransactionOperation *self); 34 | 35 | #include "flatpak-dir-private.h" 36 | 37 | #endif /* __FLATPAK_TRANSACTION_PRIVATE_H__ */ 38 | -------------------------------------------------------------------------------- /common/flatpak-utils-base-private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2019 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_UTILS_BASE_H__ 22 | #define __FLATPAK_UTILS_BASE_H__ 23 | 24 | #include 25 | #include 26 | 27 | #ifndef G_DBUS_METHOD_INVOCATION_HANDLED 28 | # define G_DBUS_METHOD_INVOCATION_HANDLED TRUE 29 | # define G_DBUS_METHOD_INVOCATION_UNHANDLED FALSE 30 | #endif 31 | 32 | char *flatpak_get_timezone (void); 33 | 34 | char * flatpak_readlink (const char *path, 35 | GError **error); 36 | char * flatpak_resolve_link (const char *path, 37 | GError **error); 38 | char * flatpak_canonicalize_filename (const char *path); 39 | void flatpak_close_fds_workaround (int start_fd); 40 | 41 | #endif /* __FLATPAK_UTILS_BASE_H__ */ 42 | -------------------------------------------------------------------------------- /common/flatpak-version-macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined (__FLATPAK_H_INSIDE__) && !defined (FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_VERSION_MACROS_H__ 26 | #define __FLATPAK_VERSION_MACROS_H__ 27 | 28 | 29 | /** 30 | * FLATPAK_MAJOR_VERSION: 31 | * 32 | * The major version. 33 | */ 34 | #define FLATPAK_MAJOR_VERSION (1) 35 | 36 | /** 37 | * FLATPAK_MINOR_VERSION: 38 | * 39 | * The minor version. 40 | */ 41 | #define FLATPAK_MINOR_VERSION (14) 42 | 43 | /** 44 | * FLATPAK_MICRO_VERSION: 45 | * 46 | * The micro version. 47 | */ 48 | #define FLATPAK_MICRO_VERSION (10) 49 | 50 | /** 51 | * FLATPAK_CHECK_VERSION: 52 | * @major: major version to compare against 53 | * @minor: minor version to compare against 54 | * @micro: micro version to compare against 55 | * 56 | * Check that the current version is at least @major.@minor.@micro. 57 | */ 58 | #define FLATPAK_CHECK_VERSION(major,minor,micro) \ 59 | (FLATPAK_MAJOR_VERSION > (major) || \ 60 | (FLATPAK_MAJOR_VERSION == (major) && FLATPAK_MINOR_VERSION > (minor)) || \ 61 | (FLATPAK_MAJOR_VERSION == (major) && FLATPAK_MINOR_VERSION == (minor) && \ 62 | FLATPAK_MICRO_VERSION >= (micro))) 63 | 64 | #ifndef FLATPAK_EXTERN 65 | #define FLATPAK_EXTERN extern 66 | #endif 67 | 68 | /** 69 | * SECTION:flatpak-version-macros 70 | * @Title: Version information 71 | * 72 | * These macros can be used to check the library version in use. 73 | */ 74 | 75 | #endif /* __FLATPAK_VERSION_MACROS_H__ */ 76 | -------------------------------------------------------------------------------- /common/flatpak-version-macros.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #if !defined (__FLATPAK_H_INSIDE__) && !defined (FLATPAK_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __FLATPAK_VERSION_MACROS_H__ 26 | #define __FLATPAK_VERSION_MACROS_H__ 27 | 28 | 29 | /** 30 | * FLATPAK_MAJOR_VERSION: 31 | * 32 | * The major version. 33 | */ 34 | #define FLATPAK_MAJOR_VERSION (@FLATPAK_MAJOR_VERSION@) 35 | 36 | /** 37 | * FLATPAK_MINOR_VERSION: 38 | * 39 | * The minor version. 40 | */ 41 | #define FLATPAK_MINOR_VERSION (@FLATPAK_MINOR_VERSION@) 42 | 43 | /** 44 | * FLATPAK_MICRO_VERSION: 45 | * 46 | * The micro version. 47 | */ 48 | #define FLATPAK_MICRO_VERSION (@FLATPAK_MICRO_VERSION@) 49 | 50 | /** 51 | * FLATPAK_CHECK_VERSION: 52 | * @major: major version to compare against 53 | * @minor: minor version to compare against 54 | * @micro: micro version to compare against 55 | * 56 | * Check that the current version is at least @major.@minor.@micro. 57 | */ 58 | #define FLATPAK_CHECK_VERSION(major,minor,micro) \ 59 | (FLATPAK_MAJOR_VERSION > (major) || \ 60 | (FLATPAK_MAJOR_VERSION == (major) && FLATPAK_MINOR_VERSION > (minor)) || \ 61 | (FLATPAK_MAJOR_VERSION == (major) && FLATPAK_MINOR_VERSION == (minor) && \ 62 | FLATPAK_MICRO_VERSION >= (micro))) 63 | 64 | #ifndef FLATPAK_EXTERN 65 | #define FLATPAK_EXTERN extern 66 | #endif 67 | 68 | /** 69 | * SECTION:flatpak-version-macros 70 | * @Title: Version information 71 | * 72 | * These macros can be used to check the library version in use. 73 | */ 74 | 75 | #endif /* __FLATPAK_VERSION_MACROS_H__ */ 76 | -------------------------------------------------------------------------------- /common/flatpak-zstd-decompressor-private.h: -------------------------------------------------------------------------------- 1 | #ifndef __FLATPAK_ZSTD_DECOMPRESSOR_H__ 2 | #define __FLATPAK_ZSTD_DECOMPRESSOR_H__ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | #define FLATPAK_TYPE_ZSTD_DECOMPRESSOR (flatpak_zstd_decompressor_get_type ()) 9 | #define FLATPAK_ZSTD_DECOMPRESSOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), FLATPAK_TYPE_ZSTD_DECOMPRESSOR, FlatpakZstdDecompressor)) 10 | #define FLATPAK_ZSTD_DECOMPRESSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), FLATPAK_TYPE_ZSTD_DECOMPRESSOR, FlatpakZstdDecompressorClass)) 11 | #define G_IS_ZSTD_DECOMPRESSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), FLATPAK_TYPE_ZSTD_DECOMPRESSOR)) 12 | #define G_IS_ZSTD_DECOMPRESSOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), FLATPAK_TYPE_ZSTD_DECOMPRESSOR)) 13 | #define FLATPAK_ZSTD_DECOMPRESSOR_GET_CLASS(o) (FLATPAK_TYPE_INSTANCE_GET_CLASS ((o), FLATPAK_TYPE_ZSTD_DECOMPRESSOR, FlatpakZstdDecompressorClass)) 14 | 15 | typedef struct _FlatpakZstdDecompressor FlatpakZstdDecompressor; 16 | typedef struct _FlatpakZstdDecompressorClass FlatpakZstdDecompressorClass; 17 | 18 | struct _FlatpakZstdDecompressorClass 19 | { 20 | GObjectClass parent_class; 21 | }; 22 | 23 | GLIB_AVAILABLE_IN_ALL 24 | GType flatpak_zstd_decompressor_get_type (void) G_GNUC_CONST; 25 | 26 | GLIB_AVAILABLE_IN_ALL 27 | FlatpakZstdDecompressor *flatpak_zstd_decompressor_new (void); 28 | 29 | G_END_DECLS 30 | 31 | #endif /* __FLATPAK_ZSTD_DECOMPRESSOR_H__ */ 32 | -------------------------------------------------------------------------------- /common/flatpak.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "flatpak-version-macros.h" 4 | -------------------------------------------------------------------------------- /common/flatpak.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_H__ 22 | #define __FLATPAK_H__ 23 | 24 | #define __FLATPAK_H_INSIDE__ 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #undef __FLATPAK_H_INSIDE__ 43 | 44 | #endif /* __FLATPAK_H__ */ 45 | -------------------------------------------------------------------------------- /completion/_flatpak: -------------------------------------------------------------------------------- 1 | #compdef flatpak 2 | 3 | emulate -L zsh 4 | 5 | local index 6 | (( index = ${(c)#words[0,CURRENT]} + $#PREFIX + 1 )) 7 | 8 | 9 | local resp=($(flatpak complete "$words" $index "$words[CURRENT]")) 10 | 11 | _description options opt_expl option 12 | _description arguments arg_expl argument 13 | 14 | local match 15 | for match in $resp; do 16 | case $match in 17 | __FLATPAK_FILE) _files;; 18 | __FLATPAK_BUNDLE_FILE) _path_files -g '*.flatpak';; 19 | __FLATPAK_BUNDLE_OR_REF_FILE) _path_files -g '*.flatpak(|ref)';; 20 | __FLATPAK_DIR) _path_files -/;; 21 | -*=) compadd $opt_expl[@] -S "" -- $match;; 22 | -*) compadd $opt_expl[@] -- $match;; 23 | *) compadd $arg_expl[@] $match;; 24 | esac 25 | done 26 | 27 | # vim: ft=zsh 28 | -------------------------------------------------------------------------------- /completion/flatpak: -------------------------------------------------------------------------------- 1 | # Check for bash 2 | [ -z "$BASH_VERSION" ] && return 3 | 4 | #################################################################################################### 5 | 6 | __flatpak() { 7 | local IFS=$'\n' 8 | local cur=`_get_cword :` 9 | RES=($(flatpak complete "${COMP_LINE}" "${COMP_POINT}" "${cur}")) 10 | 11 | COMPREPLY=() 12 | for i in "${!RES[@]}"; do 13 | if [[ "${RES[$i]}" = "__FLATPAK_FILE" ]]; then 14 | declare -a COMPGEN_OPTS=('-f') 15 | elif [[ "${RES[$i]}" = "__FLATPAK_BUNDLE_FILE" ]]; then 16 | declare -a COMPGEN_OPTS=('-f' '-X' '!*.flatpak') 17 | elif [[ "${RES[$i]}" = "__FLATPAK_BUNDLE_OR_REF_FILE" ]]; then 18 | declare -a COMPGEN_OPTS=('-f' '-X' '!*.flatpak@(|ref)') 19 | elif [[ "${RES[$i]}" = "__FLATPAK_DIR" ]]; then 20 | declare -a COMPGEN_OPTS=('-d') 21 | else 22 | declare -a COMPGEN_OPTS=() 23 | fi 24 | 25 | if [[ ${#COMPGEN_OPTS[@]} -ne 0 ]]; then 26 | if [[ "${cur}" = "=" ]]; then 27 | CUR="" 28 | else 29 | CUR="${cur}" 30 | fi 31 | COMPREPLY=("${COMPREPLY[@]}" $(compgen ${COMPGEN_OPTS[@]} -- "${CUR}") ) 32 | else 33 | COMPREPLY=("${COMPREPLY[@]}" "${RES[$i]}") 34 | fi 35 | done 36 | } 37 | 38 | #################################################################################################### 39 | 40 | complete -o nospace -F __flatpak flatpak 41 | -------------------------------------------------------------------------------- /completion/flatpak.fish: -------------------------------------------------------------------------------- 1 | function __fish_complete_flatpak 2 | set current_cmd (commandline -p) 3 | set current_position (commandline -C) 4 | set current_token (commandline -ct) 5 | command flatpak complete "$current_cmd" "$current_position" "$current_token" | while read fp_sugg 6 | set sugg (string trim -- "$fp_sugg") 7 | switch "$sugg" 8 | case __FLATPAK_FILE 9 | __fish_complete_path "$current_token" 10 | case __FLATPAK_BUNDLE_FILE 11 | __fish_complete_suffix "$current_token" '.flatpak' 12 | case __FLATPAK_BUNDLE_OR_REF_FILE 13 | __fish_complete_suffix "$current_token" '.flatpak' 14 | __fish_complete_suffix "$current_token" '.flatpakref' 15 | case __FLATPAK_DIR 16 | __fish_complete_directories "$current_token" 17 | case '*' 18 | # completing a value for option 19 | if string match -- "--*=" "$current_token" 20 | echo "$current_token$sugg" 21 | else 22 | echo "$sugg" 23 | end 24 | end 25 | end 26 | return 27 | end 28 | 29 | function __fish_flatpak_complete_files 30 | if __fish_seen_subcommand_from run build 31 | set pos_args 0 32 | for t in (commandline -co) 33 | if string match --invert -- "-*" "$t" 34 | set pos_args (math "$pos_args+1") 35 | end 36 | end 37 | if test $pos_args -gt 2 38 | return 0 39 | end 40 | end 41 | return 1 42 | end 43 | 44 | complete -c flatpak -f -n "not __fish_flatpak_complete_files" -a '(__fish_complete_flatpak)' 45 | complete -c flatpak -n "__fish_flatpak_complete_files" -a '(__fish_complete_flatpak)' 46 | -------------------------------------------------------------------------------- /data/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | introspectiondir = $(datadir)/dbus-1/interfaces 2 | introspection_DATA = \ 3 | data/org.freedesktop.Flatpak.xml \ 4 | data/org.freedesktop.Flatpak.Authenticator.xml \ 5 | data/org.freedesktop.portal.Flatpak.xml \ 6 | $(NULL) 7 | 8 | dist_tmpfiles_DATA += data/tmpfiles.d/flatpak.conf 9 | 10 | EXTRA_DIST += \ 11 | data/org.freedesktop.portal.Documents.xml \ 12 | data/org.freedesktop.impl.portal.PermissionStore.xml \ 13 | data/org.freedesktop.systemd1.xml \ 14 | data/org.freedesktop.Flatpak.xml \ 15 | data/org.freedesktop.Flatpak.Authenticator.xml \ 16 | data/org.freedesktop.portal.Flatpak.xml \ 17 | data/flatpak-docker-seccomp.json \ 18 | data/flatpak-variants.gv \ 19 | $(NULL) 20 | -------------------------------------------------------------------------------- /data/flatpak-variants.gv: -------------------------------------------------------------------------------- 1 | /* Commanly used, give a name */ 2 | type Metadata [string] variant; 3 | type Checksum []byte; 4 | 5 | type RefInfo { 6 | commit_size: uint64; 7 | checksum: Checksum; 8 | metadata: Metadata; 9 | }; 10 | 11 | /* Note: RefMaps are sorted by ref */ 12 | type RefMap [] 'RefMapEntry { 13 | ref: string; 14 | info: RefInfo; 15 | }; 16 | 17 | type Summary { 18 | ref_map: RefMap; 19 | metadata: Metadata; 20 | }; 21 | 22 | type CollectionMap [sorted string] RefMap; 23 | 24 | type Commit { 25 | metadata: Metadata; 26 | parent: Checksum; 27 | related: [] 'Related { 28 | ref: string; 29 | commit: Checksum; 30 | }; 31 | subject: string; 32 | body: string; 33 | timestamp: bigendian uint64; 34 | root_contents: Checksum; 35 | root_metadata: Checksum; 36 | }; 37 | 38 | type Cache [sorted string] 'CacheData { 39 | installed_size: bigendian uint64; 40 | download_size: bigendian uint64; 41 | metadata: string; 42 | }; 43 | 44 | type SparseCache [sorted string] Metadata; 45 | 46 | type CommitsCache []Checksum; 47 | 48 | type DeployData { 49 | origin: string; 50 | commit: string; 51 | subpaths: []string; 52 | installed_size: bigendian uint64; 53 | metadata: Metadata; 54 | }; 55 | 56 | type ContentRating { 57 | rating_type: string; 58 | ratings: 'Ratings [string] string; 59 | }; 60 | 61 | type ExtraDataSize { 62 | n_extra_data: littleendian uint32; 63 | total_size: littleendian uint64; 64 | }; 65 | 66 | type Subsummary { 67 | checksum: Checksum; 68 | history: []Checksum; 69 | metadata: Metadata; 70 | }; 71 | 72 | type SummaryIndex { 73 | subsummaries: [sorted string]Subsummary; 74 | metadata: Metadata; 75 | }; 76 | 77 | type ObjectListInfo { 78 | is_loose: boolean; 79 | packfiles: []string; 80 | }; 81 | 82 | type ObjectName { 83 | checksum: string; 84 | objtype: uint32; 85 | }; 86 | 87 | type ObjectNames []ObjectName; 88 | -------------------------------------------------------------------------------- /data/org.freedesktop.systemd1.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /data/tmpfiles.d/flatpak.conf: -------------------------------------------------------------------------------- 1 | # This is a systemd tmpfiles.d configuration file 2 | R! /var/tmp/flatpak-cache-* 3 | -------------------------------------------------------------------------------- /debian/.gitattributes: -------------------------------------------------------------------------------- 1 | changelog merge=merge-changelog -------------------------------------------------------------------------------- /debian/.gitignore: -------------------------------------------------------------------------------- 1 | /*.debhelper 2 | /*.substvars 3 | /flatpak-tests/ 4 | /flatpak/ 5 | /gir1.2-flatpak-1.0/ 6 | /libflatpak-dev/ 7 | /libflatpak-doc/ 8 | /libflatpak0/ 9 | -------------------------------------------------------------------------------- /debian/NEWS: -------------------------------------------------------------------------------- 1 | flatpak (1.3.4-1) experimental; urgency=medium 2 | 3 | This version of flatpak has an incompatible change to the way default 4 | remotes can be configured in /etc/flatpak/remotes.d. 5 | 6 | Previous versions would read *.conf files from that directory and 7 | treat them as preconfigured remotes for the system-wide installation 8 | in /var/lib/flatpak, which could not be reconfigured or removed in the 9 | usual way through UIs like flatpak(1). 10 | 11 | From this version, default remotes are instead configured by 12 | placing an ordinary .flatpakrepo file (see flatpak-flatpakrepo(5)) 13 | in /etc/flatpak/remotes.d. These are automatically imported into the 14 | system-wide installation as if via flatpak-remote-add(1) the first time 15 | flatpak is run. 16 | 17 | flatpak remembers which remotes were already added in this way, 18 | so sysadmins can delete them in the usual way, for instance using 19 | flatpak-remote-delete(1), and they will not be re-added. They can also 20 | be reconfigured with flatpak-remote-modify(1) as usual. 21 | 22 | -- Simon McVittie Fri, 10 May 2019 11:44:56 +0100 23 | -------------------------------------------------------------------------------- /debian/README.source: -------------------------------------------------------------------------------- 1 | Maintaining this backport 2 | ========================= 3 | 4 | You'll want the official Debian packaging as a git remote: 5 | 6 | git remote add salsa https://salsa.debian.org/debian/flatpak.git 7 | 8 | Ideally import new versions into Debian experimental, but directly into 9 | this repository is OK too. 10 | 11 | First, import/merge new versions into the branch corresponding to the newest 12 | Ubuntu branch, currently ppa/noble for Ubuntu 24.04. 13 | 14 | If you have merged updated packaging from Debian, you might need to adjust 15 | it for compatibility with noble. 16 | 17 | Then merge the ppa/noble branch into ppa/jammy, and adjust as necessary 18 | for compatibility with jammy. 19 | 20 | Next, merge the ppa/jammy branch into ppa/focal, and so on. 21 | 22 | The advantage of this approach is that the package in each branch is as 23 | modern as possible: changes that were necessary to be compatible with 24 | bionic will automatically disappear if we stop maintaining a backport 25 | to bionic, and so on. 26 | 27 | Version numbering 28 | ----------------- 29 | 30 | If the version has already been packaged in Debian, for example as 31 | 1.14.0-1, version it like 1.14.0-1flatpak1~24.04.1 in the PPA. 32 | 33 | If the version has not already been packaged in Debian, 34 | version it like 1.14.0-0flatpak1~24.04.1 in the PPA. 35 | -------------------------------------------------------------------------------- /debian/flatpak-tests.install: -------------------------------------------------------------------------------- 1 | usr/libexec/installed-tests 2 | usr/share/installed-tests/Flatpak 3 | -------------------------------------------------------------------------------- /debian/flatpak-tests.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Test data, and documentation about the directory it's in 2 | flatpak-tests: package-contains-documentation-outside-usr-share-doc [usr/libexec/installed-tests/*] 3 | -------------------------------------------------------------------------------- /debian/flatpak.README.Debian: -------------------------------------------------------------------------------- 1 | Flatpak in Debian 2 | ================= 3 | 4 | Flathub 5 | ------- 6 | 7 | Flathub is a reference app-store for Flatpak apps. It is not enabled by 8 | default in Debian, in order to keep the Debian distribution self-contained 9 | and entirely Free Software. See https://flatpak.org/setup/Debian/ for 10 | more information on how to add Flathub as a source of apps and runtimes. 11 | 12 | Note that Flathub includes both Free Software and non-Free apps. 13 | 14 | Adding Flatpak apps to search paths 15 | ----------------------------------- 16 | 17 | This is mostly done automatically on systems that implement 18 | environment.d(5), and in particular systems that use systemd. It is also 19 | done automatically on systems that source /etc/profile.d. 20 | 21 | On systems that do not implement environment.d(5) or source 22 | /etc/profile.d, you will need to amend the XDG_DATA_DIRS environment 23 | variable so that desktop environments will find Flatpak apps. Add the 24 | following paths: 25 | 26 | - $XDG_DATA_HOME/flatpak/exports/share, for Flatpak apps installed in the 27 | user's home directory (the default for $XDG_DATA_HOME is ~/.local/share) 28 | 29 | - /var/lib/flatpak/export/share, for Flatpak apps installed system-wide 30 | 31 | - The exports/share subdirectory of any extra installations configured in 32 | /etc/flatpak/installations.d/ (see flatpak-installation(5) for details) 33 | 34 | If XDG_DATA_HOME is set to a non-default value, you might need to add 35 | $XDG_DATA_HOME/flatpak/exports/share to the search path yourself, or be 36 | careful with the order in which environment variables are set. Using the 37 | default is encouraged. 38 | 39 | On systems using GNOME's gdm display manager (the gdm3 Debian 40 | package), adding /usr/share/doc/flatpak/examples/etc/gdm3/flatpak.env 41 | to /etc/gdm3/env.d/ might be helpful. However, if you use other app 42 | frameworks that also need to amend the search path (such as Canonical's 43 | Snap), due to limitations in gdm's env.d mechanism, it will be necessary 44 | to construct a single search path that combines the search paths for 45 | Flatpak and the other app framework(s). environment.d(5) does not have 46 | these limitations, and is recommended. 47 | -------------------------------------------------------------------------------- /debian/flatpak.doc-base: -------------------------------------------------------------------------------- 1 | Document: flatpak-commands 2 | Title: Flatpak Command Reference 3 | Author: Alexander Larsson et al. 4 | Section: System/Package Management 5 | 6 | Format: HTML 7 | Index: /usr/share/doc/flatpak/flatpak-docs.html 8 | Files: /usr/share/doc/flatpak/flatpak-docs.html /usr/share/doc/flatpak/docbook.css 9 | -------------------------------------------------------------------------------- /debian/flatpak.docs: -------------------------------------------------------------------------------- 1 | NEWS 2 | README.md 3 | usr/share/doc/flatpak/docbook.css 4 | usr/share/doc/flatpak/flatpak-docs.html 5 | -------------------------------------------------------------------------------- /debian/flatpak.examples: -------------------------------------------------------------------------------- 1 | data/flatpak-docker-seccomp.json 2 | -------------------------------------------------------------------------------- /debian/flatpak.install: -------------------------------------------------------------------------------- 1 | debian/org.freedesktop.Flatpak.pkla var/lib/polkit-1/localauthority/10-vendor.d/ 2 | etc/X11/Xsession.d 3 | etc/profile.d/ 4 | lib/systemd/system/flatpak-system-helper.service 5 | usr/bin/flatpak 6 | usr/lib/systemd/system-environment-generators 7 | usr/lib/systemd/user-environment-generators 8 | usr/lib/systemd/user/flatpak-oci-authenticator.service 9 | usr/lib/systemd/user/flatpak-portal.service 10 | usr/lib/systemd/user/flatpak-session-helper.service 11 | usr/lib/sysusers.d 12 | usr/lib/tmpfiles.d 13 | usr/libexec/flatpak-bwrap 14 | usr/libexec/flatpak-dbus-proxy 15 | usr/libexec/flatpak-oci-authenticator 16 | usr/libexec/flatpak-portal 17 | usr/libexec/flatpak-session-helper 18 | usr/libexec/flatpak-system-helper 19 | usr/libexec/flatpak-validate-icon 20 | usr/libexec/revokefs-fuse 21 | usr/share/bash-completion 22 | usr/share/dbus-1/services 23 | usr/share/dbus-1/system-services 24 | usr/share/dbus-1/system.d 25 | usr/share/fish/vendor_completions.d 26 | usr/share/fish/vendor_conf.d 27 | usr/share/flatpak 28 | usr/share/gdm/env.d/* usr/share/doc/flatpak/examples/etc/gdm3/env.d 29 | usr/share/locale/*/LC_MESSAGES/flatpak.mo 30 | usr/share/polkit-1/actions 31 | usr/share/polkit-1/rules.d 32 | usr/share/zsh/site-functions/_flatpak usr/share/zsh/vendor-completions 33 | -------------------------------------------------------------------------------- /debian/flatpak.lintian-overrides: -------------------------------------------------------------------------------- 1 | # This is intended to be started by D-Bus activation, not on boot 2 | package-supports-alternative-init-but-no-init.d-script [*lib/systemd/system/flatpak-system-helper.service] 3 | systemd-service-file-missing-install-key [*lib/systemd/system/flatpak-system-helper.service] 4 | -------------------------------------------------------------------------------- /debian/flatpak.maintscript: -------------------------------------------------------------------------------- 1 | rm_conffile /etc/dbus-1/system.d/org.freedesktop.Flatpak.SystemHelper.conf 1.1.1-1~ flatpak 2 | -------------------------------------------------------------------------------- /debian/flatpak.manpages: -------------------------------------------------------------------------------- 1 | usr/share/man/man1/* 2 | usr/share/man/man5/* 3 | -------------------------------------------------------------------------------- /debian/flatpak.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #DEBHELPER# 6 | 7 | if [ "$1" = configure ]; then 8 | adduser \ 9 | --force-badname \ 10 | --gecos "Flatpak system-wide installation helper" \ 11 | --group \ 12 | --home /nonexistent \ 13 | --no-create-home \ 14 | --quiet \ 15 | --system \ 16 | _flatpak 17 | 18 | # Run a do-nothing command (it just lists configured remotes) for 19 | # its side-effect of initializing the shared system-wide repository. 20 | flatpak remote-list --system >/dev/null || : 21 | fi 22 | 23 | exit 0 24 | 25 | # vim:set sw=4 sts=4 et: 26 | -------------------------------------------------------------------------------- /debian/flatpak.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | #DEBHELPER# 6 | 7 | if [ "$1" = "purge" ] && [ -e /var/lib/flatpak ]; then 8 | rm -fr /var/lib/flatpak/repo 9 | rm -f /var/lib/flatpak/.changed 10 | rmdir --ignore-fail-on-non-empty /var/lib/flatpak 11 | fi 12 | 13 | exit 0 14 | 15 | # vim:set sw=4 sts=4 et: 16 | -------------------------------------------------------------------------------- /debian/gbp.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | pristine-tar = True 3 | compression = xz 4 | debian-branch = ppa/stable/focal 5 | debian-tag = ppa/%(version)s 6 | upstream-branch = upstream/1.14.x 7 | patch-numbers = False 8 | upstream-vcs-tag = %(version)s 9 | -------------------------------------------------------------------------------- /debian/gir1.2-flatpak-1.0.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/girepository-1.0 2 | -------------------------------------------------------------------------------- /debian/libflatpak-dev.install: -------------------------------------------------------------------------------- 1 | usr/bin/flatpak-bisect 2 | usr/bin/flatpak-coredumpctl 3 | usr/include/* 4 | usr/lib/*/libflatpak.so 5 | usr/lib/*/pkgconfig 6 | usr/share/dbus-1/interfaces 7 | usr/share/gir-1.0/* 8 | -------------------------------------------------------------------------------- /debian/libflatpak-doc.doc-base: -------------------------------------------------------------------------------- 1 | Document: flatpak 2 | Title: Flatpak Reference Manual 3 | Abstract: This manual provides API documentation for the Flatpak application sandboxing framework. 4 | Section: Programming/C 5 | 6 | Format: HTML 7 | Index: /usr/share/doc/libflatpak-doc/flatpak/index.html 8 | Files: /usr/share/doc/libflatpak-doc/flatpak/*.html 9 | -------------------------------------------------------------------------------- /debian/libflatpak-doc.docs: -------------------------------------------------------------------------------- 1 | NEWS 2 | README.md 3 | -------------------------------------------------------------------------------- /debian/libflatpak-doc.install: -------------------------------------------------------------------------------- 1 | usr/share/gtk-doc/html/flatpak 2 | -------------------------------------------------------------------------------- /debian/libflatpak-doc.links: -------------------------------------------------------------------------------- 1 | usr/share/gtk-doc/html/flatpak usr/share/doc/libflatpak-doc/flatpak 2 | -------------------------------------------------------------------------------- /debian/libflatpak0.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libflatpak.so.* 2 | -------------------------------------------------------------------------------- /debian/org.freedesktop.Flatpak.pkla: -------------------------------------------------------------------------------- 1 | [Install Flatpak apps and runtimes] 2 | Identity=unix-group:sudo 3 | Action=org.freedesktop.Flatpak.app-install;org.freedesktop.Flatpak.runtime-install;org.freedesktop.Flatpak.app-uninstall;org.freedesktop.Flatpak.runtime-uninstall;org.freedesktop.Flatpak.modify-repo; 4 | ResultActive=yes 5 | 6 | [Override parental controls for Flatpak apps] 7 | Identity=unix-user:* 8 | Action=org.freedesktop.Flatpak.override-parental-controls 9 | ResultAny=auth_admin 10 | ResultActive=auth_admin 11 | ResultInactive=auth_admin 12 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all 4 | 5 | include /usr/share/dpkg/default.mk 6 | 7 | binaries := $(shell dh_listpackages) 8 | 9 | %: 10 | dh $@ --with=gir 11 | 12 | override_dh_clean: 13 | dh_clean 14 | rm -fr debian/HOME 15 | rm -fr debian/XDG_RUNTIME_DIR 16 | 17 | override_dh_autoreconf: 18 | NOCONFIGURE=1 \ 19 | dh_autoreconf \ 20 | --as-needed \ 21 | ./autogen.sh \ 22 | -- \ 23 | $(NULL) 24 | 25 | configure_options = 26 | 27 | ifneq ($(filter nodoc,$(DEB_BUILD_OPTIONS)),) 28 | configure_options += --disable-docbook-docs 29 | configure_options += --disable-documentation 30 | else 31 | configure_options += --enable-docbook-docs 32 | configure_options += --enable-documentation 33 | endif 34 | 35 | ifneq ($(filter libflatpak-doc,$(binaries)),) 36 | configure_options += --enable-gtk-doc 37 | else 38 | configure_options += --disable-gtk-doc 39 | endif 40 | 41 | override_dh_auto_configure: 42 | rm -f app/parse-datetime.c 43 | dh_auto_configure -- \ 44 | --disable-auto-sideloading \ 45 | --disable-selinux-module \ 46 | --enable-gdm-env-file \ 47 | --enable-installed-tests \ 48 | --with-curl=yes \ 49 | --with-dbus-config-dir=/usr/share/dbus-1/system.d \ 50 | --with-priv-mode=none \ 51 | --with-privileged-group=sudo \ 52 | --with-run-media-dir=/media \ 53 | --with-systemdsystemunitdir=/lib/systemd/system \ 54 | --with-system-helper-user=_flatpak \ 55 | $(configure_options) 56 | 57 | override_dh_install: 58 | install -d debian/tmp/etc/X11/Xsession.d 59 | install -m644 debian/tmp/etc/profile.d/flatpak.sh \ 60 | debian/tmp/etc/X11/Xsession.d/20flatpak 61 | find debian/tmp -name '*.la' -print -delete 62 | dh_install 63 | 64 | override_dh_missing: 65 | dh_missing --fail-missing 66 | 67 | override_dh_installsystemd: 68 | dh_installsystemd --no-start 69 | 70 | override_dh_auto_test-arch: 71 | ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) 72 | debian/test.sh 73 | endif 74 | 75 | override_dh_auto_test-indep: 76 | @: 77 | -------------------------------------------------------------------------------- /debian/salsa-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml 3 | - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml 4 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | 4 | export HOME="$(pwd)/debian/HOME" 5 | # Put these back to their defaults if we are not running with a clean 6 | # environment, so that they are based on the temporary $HOME above. 7 | unset XDG_CACHE_HOME 8 | unset XDG_CONFIG_DIRS 9 | unset XDG_CONFIG_HOME 10 | unset XDG_DATA_HOME 11 | unset XDG_DATA_DIRS 12 | # dconf assumes this directory exists and is writable 13 | export XDG_RUNTIME_DIR="$(pwd)/debian/XDG_RUNTIME_DIR" 14 | 15 | # Some build/test infrastructure provides internet access via a proxy. 16 | # libostree doesn't always support no_proxy (and in any case 17 | # reproducible-builds.org doesn't set it), so tests will try to use the 18 | # proxy for localhost, and fail to reach the test server. 19 | unset ftp_proxy 20 | unset http_proxy 21 | unset https_proxy 22 | unset no_proxy 23 | 24 | adverb= 25 | 26 | if [ "$DEB_HOST_ARCH_BITS" = 64 ]; then 27 | # reprotest sometimes uses linux32 even for x86_64 builds, and 28 | # Flatpak's tests don't support this. 29 | adverb=linux64 30 | fi 31 | 32 | e=0 33 | $adverb dh_auto_test || e=$? 34 | 35 | find . -name 'test*.log' \ 36 | -not -name test-suite.log \ 37 | -print0 | xargs -0 tail -v -c1M 38 | 39 | echo "Killing gpg-agent processes:" 40 | pgrep --list-full --full "gpg-agent --homedir /var/tmp/test-flatpak-.*" >&2 || : 41 | pgrep --list-full --full "gpg-agent --homedir /var/tmp/flatpak-test-.*" >&2 || : 42 | pkill --full "gpg-agent --homedir /var/tmp/test-flatpak-.*" >&2 || : 43 | pkill --full "gpg-agent --homedir /var/tmp/flatpak-test-.*" >&2 || : 44 | exit "$e" 45 | -------------------------------------------------------------------------------- /debian/tests/build: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | exec 2>&1 5 | set -x 6 | 7 | cd "$AUTOPKGTEST_TMP" 8 | 9 | 10 | if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then 11 | CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" 12 | else 13 | CROSS_COMPILE= 14 | fi 15 | 16 | echo "1..1" 17 | 18 | cat > trivial.c <<'EOF' 19 | #include 20 | 21 | #include 22 | 23 | int main (void) 24 | { 25 | flatpak_error_quark (); 26 | g_print ("ok 1\n"); 27 | return 0; 28 | } 29 | EOF 30 | 31 | # Deliberately word-splitting, that's how pkg-config works: 32 | # shellcheck disable=SC2046 33 | "${CROSS_COMPILE}gcc" -o trivial trivial.c $("${CROSS_COMPILE}pkg-config" --cflags --libs flatpak) 34 | test -x trivial 35 | ./trivial 36 | -------------------------------------------------------------------------------- /debian/tests/control: -------------------------------------------------------------------------------- 1 | Tests: build 2 | Restrictions: superficial 3 | Depends: 4 | build-essential, 5 | libflatpak-dev, 6 | 7 | Tests: gnome-desktop-testing 8 | Restrictions: isolation-machine 9 | Depends: 10 | flatpak-tests, 11 | gettext, 12 | gnome-desktop-testing, 13 | python3, 14 | 15 | Tests: flaky 16 | Restrictions: isolation-machine, flaky 17 | Depends: 18 | flatpak-tests, 19 | gettext, 20 | gnome-desktop-testing, 21 | python3, 22 | -------------------------------------------------------------------------------- /debian/tests/flaky: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | exec 2>&1 5 | 6 | # Ubuntu provides internet access via a proxy, but libostree doesn't need 7 | # that. However, libostree also doesn't support no_proxy, so it will try 8 | # to use Ubuntu's proxy for localhost, and fail to reach itself. 9 | unset ftp_proxy 10 | unset http_proxy 11 | unset https_proxy 12 | unset no_proxy 13 | 14 | # Don't pollute the home directory unless this looks like a dedicated 15 | # autopkgtest environment 16 | case "$(id -nu)@$(hostname)" in 17 | (adt@*|debci@*|user@host) 18 | install -d ~/.flatpak-tests/ 19 | ;; 20 | esac 21 | 22 | exec gnome-desktop-testing-runner \ 23 | Flatpak/test-oci \ 24 | Flatpak/test-update-portal \ 25 | ${NULL+} 26 | -------------------------------------------------------------------------------- /debian/tests/gnome-desktop-testing: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | exec 2>&1 5 | 6 | # Ubuntu provides internet access via a proxy, but libostree doesn't need 7 | # that. However, libostree also doesn't support no_proxy, so it will try 8 | # to use Ubuntu's proxy for localhost, and fail to reach itself. 9 | unset ftp_proxy 10 | unset http_proxy 11 | unset https_proxy 12 | unset no_proxy 13 | 14 | # Don't pollute the home directory unless this looks like a dedicated 15 | # autopkgtest environment 16 | case "$(id -nu)@$(hostname)" in 17 | (adt@*|debci@*|user@host) 18 | install -d ~/.flatpak-tests/ 19 | ;; 20 | esac 21 | 22 | # Deliberately word-splitting list of tests: 23 | # shellcheck disable=SC2046 24 | exec gnome-desktop-testing-runner $( 25 | # d (the directory) is deliberately ignored: 26 | # shellcheck disable=SC2034 27 | gnome-desktop-testing-runner -l Flatpak | while read -r t d; do 28 | case "$t" in 29 | (Flatpak/test-oci*) 30 | ;; 31 | (Flatpak/test-update-portal*) 32 | ;; 33 | (*) 34 | echo "$t" 35 | ;; 36 | esac 37 | done 38 | ) 39 | -------------------------------------------------------------------------------- /debian/upstream/metadata: -------------------------------------------------------------------------------- 1 | --- 2 | Repository: https://github.com/flatpak/flatpak.git 3 | Repository-Browse: https://github.com/flatpak/flatpak 4 | Bug-Database: https://github.com/flatpak/flatpak/issues 5 | Bug-Submit: https://github.com/flatpak/flatpak/issues/new 6 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | version=4 2 | # Upstream releases official Autotools 'make dist' tarballs, so we use 3 | # those in preference to git tags 4 | opts="\ 5 | compression=xz, \ 6 | dversionmangle=s/\+(?:git)?[0-9]*(?:\+g[0-9a-f]*)//, \ 7 | downloadurlmangle=s#/tag/#/download/#;s#(v?@ANY_VERSION@)$#$1/@PACKAGE@-$2.tar.xz#, \ 8 | filenamemangle=s#v?@ANY_VERSION@#@PACKAGE@-$1.tar.xz#" \ 9 | https://github.com/@PACKAGE@/@PACKAGE@/tags .*/releases/tag/v?(\d+\.\d*[02468]\.\d+) 10 | -------------------------------------------------------------------------------- /doc/docbook.css: -------------------------------------------------------------------------------- 1 | body 2 | { 3 | font-family: sans-serif; 4 | } 5 | h1.title 6 | { 7 | } 8 | .permission 9 | { 10 | color: #ee0000; 11 | text-decoration: underline; 12 | } 13 | .synopsis, .classsynopsis 14 | { 15 | background: #eeeeee; 16 | border: solid 1px #aaaaaa; 17 | padding: 0.5em; 18 | } 19 | .programlisting 20 | { 21 | background: #eeeeff; 22 | border: solid 1px #aaaaff; 23 | padding: 0.5em; 24 | } 25 | .variablelist 26 | { 27 | padding: 4px; 28 | margin-left: 3em; 29 | } 30 | .variablelist td:first-child 31 | { 32 | vertical-align: top; 33 | } 34 | td.shortcuts 35 | { 36 | color: #770000; 37 | font-size: 80%; 38 | } 39 | div.refnamediv 40 | { 41 | margin-top: 2em; 42 | } 43 | div.toc 44 | { 45 | border: 2em; 46 | } 47 | a 48 | { 49 | text-decoration: none; 50 | } 51 | a:hover 52 | { 53 | text-decoration: underline; 54 | color: #FF0000; 55 | } 56 | 57 | div.table table 58 | { 59 | border-collapse: collapse; 60 | border-spacing: 0px; 61 | border-style: solid; 62 | border-color: #777777; 63 | border-width: 1px; 64 | } 65 | 66 | div.table table td, div.table table th 67 | { 68 | border-style: solid; 69 | border-color: #777777; 70 | border-width: 1px; 71 | padding: 3px; 72 | vertical-align: top; 73 | } 74 | 75 | div.table table th 76 | { 77 | background-color: #eeeeee; 78 | } 79 | -------------------------------------------------------------------------------- /doc/reference/flatpak-overrides.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/flatpak-overrides.txt -------------------------------------------------------------------------------- /doc/reference/flatpak.types: -------------------------------------------------------------------------------- 1 | flatpak_bundle_ref_get_type 2 | flatpak_installation_get_type 3 | flatpak_installed_ref_get_type 4 | flatpak_instance_get_type 5 | flatpak_ref_get_type 6 | flatpak_related_ref_get_type 7 | flatpak_remote_get_type 8 | flatpak_remote_ref_get_type 9 | flatpak_transaction_get_type 10 | flatpak_transaction_operation_get_type 11 | flatpak_transaction_progress_get_type 12 | -------------------------------------------------------------------------------- /doc/reference/html/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/home.png -------------------------------------------------------------------------------- /doc/reference/html/left-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/left-insensitive.png -------------------------------------------------------------------------------- /doc/reference/html/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/left.png -------------------------------------------------------------------------------- /doc/reference/html/right-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/right-insensitive.png -------------------------------------------------------------------------------- /doc/reference/html/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/right.png -------------------------------------------------------------------------------- /doc/reference/html/up-insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/up-insensitive.png -------------------------------------------------------------------------------- /doc/reference/html/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/doc/reference/html/up.png -------------------------------------------------------------------------------- /doc/reference/libflatpak-docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | ]> 8 | 9 | 10 | Flatpak Library Reference Manual 11 | 12 | For flatpak &version; 13 | 14 | 15 | 16 | 17 | Flatpak 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | D-Bus APIs 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | Object Hierarchy 48 | 49 | 50 | 51 | 52 | API Index 53 | 54 | 55 | 56 | 57 | Index of deprecated API 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /doc/reference/version.xml.in: -------------------------------------------------------------------------------- 1 | @FLATPAK_MAJOR_VERSION@.@FLATPAK_MINOR_VERSION@.@FLATPAK_MICRO_VERSION@ 2 | -------------------------------------------------------------------------------- /doc/xmlto-config.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | # 8 | 9 | 10 | -------------------------------------------------------------------------------- /env.d/60-flatpak: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export GIO_USE_VFS=local 3 | exec flatpak --print-updated-env 4 | -------------------------------------------------------------------------------- /env.d/60-flatpak-system-only: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export GIO_USE_VFS=local 3 | exec flatpak --print-updated-env --print-system-only 4 | -------------------------------------------------------------------------------- /env.d/flatpak.env.in: -------------------------------------------------------------------------------- 1 | XDG_DATA_DIRS=$HOME/.local/share/flatpak/exports/share/:@localstatedir@/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/ 2 | -------------------------------------------------------------------------------- /flatpak.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | datarootdir=@datarootdir@ 5 | includedir=@includedir@ 6 | datadir=@datadir@ 7 | 8 | interfaces_dir=${datadir}/dbus-1/interfaces/ 9 | 10 | # This will either be 'soup' for libsoup-2.x or 'curl' for libcurl. 11 | httpbackend=@http_backend@ 12 | 13 | Name: flatpak 14 | Description: Application sandboxing framework 15 | Version: @VERSION@ 16 | Requires: glib-2.0 gio-2.0 ostree-1 17 | Requires.private: gio-unix-2.0 18 | Libs: -L${libdir} -lflatpak 19 | Cflags: -I${includedir}/flatpak 20 | -------------------------------------------------------------------------------- /flatpak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/flatpak.png -------------------------------------------------------------------------------- /icon-validator/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | libexec_PROGRAMS += \ 2 | flatpak-validate-icon \ 3 | $(NULL) 4 | 5 | flatpak_validate_icon_SOURCES = icon-validator/validate-icon.c 6 | flatpak_validate_icon_LDADD = $(GDK_PIXBUF_LIBS) 7 | flatpak_validate_icon_CFLAGS = $(AM_CFLAGS) $(GDK_PIXBUF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" 8 | -------------------------------------------------------------------------------- /m4/glibtests.m4: -------------------------------------------------------------------------------- 1 | dnl GLIB_TESTS 2 | dnl 3 | 4 | AC_DEFUN([GLIB_TESTS], 5 | [ 6 | AC_ARG_ENABLE(installed-tests, 7 | AS_HELP_STRING([--enable-installed-tests], 8 | [Enable installation of some test cases]), 9 | [case ${enableval} in 10 | yes) ENABLE_INSTALLED_TESTS="1" ;; 11 | no) ENABLE_INSTALLED_TESTS="" ;; 12 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;; 13 | esac]) 14 | AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1") 15 | AC_ARG_ENABLE(always-build-tests, 16 | AS_HELP_STRING([--enable-always-build-tests], 17 | [Enable always building tests during 'make all']), 18 | [case ${enableval} in 19 | yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;; 20 | no) ENABLE_ALWAYS_BUILD_TESTS="" ;; 21 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;; 22 | esac]) 23 | AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1") 24 | if test "$ENABLE_INSTALLED_TESTS" = "1"; then 25 | AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME) 26 | AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME) 27 | fi 28 | ]) 29 | -------------------------------------------------------------------------------- /m4/intlmacosx.m4: -------------------------------------------------------------------------------- 1 | # intlmacosx.m4 serial 5 (gettext-0.18.2) 2 | dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | dnl 7 | dnl This file can can be used in projects which are not available under 8 | dnl the GNU General Public License or the GNU Library General Public 9 | dnl License but which still want to provide support for the GNU gettext 10 | dnl functionality. 11 | dnl Please note that the actual code of the GNU gettext library is covered 12 | dnl by the GNU Library General Public License, and the rest of the GNU 13 | dnl gettext package package is covered by the GNU General Public License. 14 | dnl They are *not* in the public domain. 15 | 16 | dnl Checks for special options needed on Mac OS X. 17 | dnl Defines INTL_MACOSX_LIBS. 18 | AC_DEFUN([gt_INTL_MACOSX], 19 | [ 20 | dnl Check for API introduced in Mac OS X 10.2. 21 | AC_CACHE_CHECK([for CFPreferencesCopyAppValue], 22 | [gt_cv_func_CFPreferencesCopyAppValue], 23 | [gt_save_LIBS="$LIBS" 24 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 25 | AC_LINK_IFELSE( 26 | [AC_LANG_PROGRAM( 27 | [[#include ]], 28 | [[CFPreferencesCopyAppValue(NULL, NULL)]])], 29 | [gt_cv_func_CFPreferencesCopyAppValue=yes], 30 | [gt_cv_func_CFPreferencesCopyAppValue=no]) 31 | LIBS="$gt_save_LIBS"]) 32 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then 33 | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], 34 | [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) 35 | fi 36 | dnl Check for API introduced in Mac OS X 10.3. 37 | AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], 38 | [gt_save_LIBS="$LIBS" 39 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 40 | AC_LINK_IFELSE( 41 | [AC_LANG_PROGRAM( 42 | [[#include ]], 43 | [[CFLocaleCopyCurrent();]])], 44 | [gt_cv_func_CFLocaleCopyCurrent=yes], 45 | [gt_cv_func_CFLocaleCopyCurrent=no]) 46 | LIBS="$gt_save_LIBS"]) 47 | if test $gt_cv_func_CFLocaleCopyCurrent = yes; then 48 | AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], 49 | [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) 50 | fi 51 | INTL_MACOSX_LIBS= 52 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then 53 | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" 54 | fi 55 | AC_SUBST([INTL_MACOSX_LIBS]) 56 | ]) 57 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, 4 | # Inc. 5 | # Written by Scott James Remnant, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # @configure_input@ 12 | 13 | # serial 4245 ltversion.m4 14 | # This file is part of GNU Libtool 15 | 16 | m4_define([LT_PACKAGE_VERSION], [2.4.7]) 17 | m4_define([LT_PACKAGE_REVISION], [2.4.7]) 18 | 19 | AC_DEFUN([LTVERSION_VERSION], 20 | [macro_version='2.4.7' 21 | macro_revision='2.4.7' 22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 23 | _LT_DECL(, macro_revision, 0) 24 | ]) 25 | -------------------------------------------------------------------------------- /m4/nls.m4: -------------------------------------------------------------------------------- 1 | # nls.m4 serial 5 (gettext-0.18) 2 | dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation, 3 | dnl Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | dnl 8 | dnl This file can can be used in projects which are not available under 9 | dnl the GNU General Public License or the GNU Library General Public 10 | dnl License but which still want to provide support for the GNU gettext 11 | dnl functionality. 12 | dnl Please note that the actual code of the GNU gettext library is covered 13 | dnl by the GNU Library General Public License, and the rest of the GNU 14 | dnl gettext package package is covered by the GNU General Public License. 15 | dnl They are *not* in the public domain. 16 | 17 | dnl Authors: 18 | dnl Ulrich Drepper , 1995-2000. 19 | dnl Bruno Haible , 2000-2003. 20 | 21 | AC_PREREQ([2.50]) 22 | 23 | AC_DEFUN([AM_NLS], 24 | [ 25 | AC_MSG_CHECKING([whether NLS is requested]) 26 | dnl Default is enabled NLS 27 | AC_ARG_ENABLE([nls], 28 | [ --disable-nls do not use Native Language Support], 29 | USE_NLS=$enableval, USE_NLS=yes) 30 | AC_MSG_RESULT([$USE_NLS]) 31 | AC_SUBST([USE_NLS]) 32 | ]) 33 | -------------------------------------------------------------------------------- /oci-authenticator/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | libexec_PROGRAMS += \ 2 | flatpak-oci-authenticator \ 3 | $(NULL) 4 | 5 | service_in_files += oci-authenticator/flatpak-oci-authenticator.service.in 6 | systemduserunit_DATA += oci-authenticator/flatpak-oci-authenticator.service 7 | 8 | service_in_files += oci-authenticator/org.flatpak.Authenticator.Oci.service.in 9 | dbus_service_DATA += oci-authenticator/org.flatpak.Authenticator.Oci.service 10 | 11 | flatpak_oci_authenticator_SOURCES = \ 12 | oci-authenticator/flatpak-oci-authenticator.c \ 13 | $(NULL) 14 | 15 | BUILT_SOURCES += $(nodist_flatpak_oci_authenticator_SOURCES) 16 | CLEANFILES += $(nodist_flatpak_oci_authenticator_SOURCES) 17 | 18 | flatpak_oci_authenticator_LDADD = $(AM_LDADD) $(BASE_LIBS) $(OSTREE_LIBS) libflatpak-common.la libflatpak-common-base.la libglnx.la 19 | flatpak_oci_authenticator_CFLAGS = \ 20 | $(AM_CFLAGS) \ 21 | $(BASE_CFLAGS) \ 22 | $(OSTREE_CFLAGS) \ 23 | $(SOUP_CFLAGS) \ 24 | $(JSON_CFLAGS) \ 25 | -DFLATPAK_COMPILATION \ 26 | -DDATADIR=\"$(datadir)\" \ 27 | $(NULL) 28 | flatpak_oci_authenticator_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/oci-authenticator 29 | -------------------------------------------------------------------------------- /oci-authenticator/flatpak-oci-authenticator.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=flatpak oci authenticator 3 | 4 | [Service] 5 | BusName=org.flatpak.Authenticator.Oci 6 | ExecStart=@libexecdir@/flatpak-oci-authenticator 7 | Type=dbus 8 | -------------------------------------------------------------------------------- /oci-authenticator/org.flatpak.Authenticator.Oci.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.flatpak.Authenticator.Oci 3 | Exec=@libexecdir@/flatpak-oci-authenticator 4 | SystemdService=flatpak-oci-authenticator.service 5 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | cs 2 | da 3 | de 4 | en_GB 5 | es 6 | fr 7 | gl 8 | hi 9 | hr 10 | hu 11 | id 12 | oc 13 | pl 14 | pt 15 | pt_BR 16 | ro 17 | ru 18 | sk 19 | sv 20 | tr 21 | uk 22 | zh_CN 23 | zh_TW 24 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files containing translatable strings. 2 | # Please keep this file sorted alphabetically. 3 | app/flatpak-builtins-build-bundle.c 4 | app/flatpak-builtins-build.c 5 | app/flatpak-builtins-build-commit-from.c 6 | app/flatpak-builtins-build-export.c 7 | app/flatpak-builtins-build-finish.c 8 | app/flatpak-builtins-build-import-bundle.c 9 | app/flatpak-builtins-build-init.c 10 | app/flatpak-builtins-build-sign.c 11 | app/flatpak-builtins-build-update-repo.c 12 | app/flatpak-builtins-config.c 13 | app/flatpak-builtins-create-usb.c 14 | app/flatpak-builtins-document-export.c 15 | app/flatpak-builtins-document-info.c 16 | app/flatpak-builtins-document-list.c 17 | app/flatpak-builtins-document-unexport.c 18 | app/flatpak-builtins-enter.c 19 | app/flatpak-builtins-history.c 20 | app/flatpak-builtins-info.c 21 | app/flatpak-builtins-install.c 22 | app/flatpak-builtins-kill.c 23 | app/flatpak-builtins-list.c 24 | app/flatpak-builtins-make-current.c 25 | app/flatpak-builtins-mask.c 26 | app/flatpak-builtins-override.c 27 | app/flatpak-builtins-permission-list.c 28 | app/flatpak-builtins-permission-remove.c 29 | app/flatpak-builtins-permission-reset.c 30 | app/flatpak-builtins-permission-set.c 31 | app/flatpak-builtins-permission-show.c 32 | app/flatpak-builtins-pin.c 33 | app/flatpak-builtins-ps.c 34 | app/flatpak-builtins-remote-add.c 35 | app/flatpak-builtins-remote-delete.c 36 | app/flatpak-builtins-remote-info.c 37 | app/flatpak-builtins-remote-list.c 38 | app/flatpak-builtins-remote-ls.c 39 | app/flatpak-builtins-remote-modify.c 40 | app/flatpak-builtins-repair.c 41 | app/flatpak-builtins-repo.c 42 | app/flatpak-builtins-run.c 43 | app/flatpak-builtins-search.c 44 | app/flatpak-builtins-uninstall.c 45 | app/flatpak-builtins-update.c 46 | app/flatpak-builtins-utils.c 47 | app/flatpak-cli-transaction.c 48 | app/flatpak-main.c 49 | app/flatpak-quiet-transaction.c 50 | common/flatpak-auth.c 51 | common/flatpak-context.c 52 | common/flatpak-dir.c 53 | common/flatpak-exports.c 54 | common/flatpak-installation.c 55 | common/flatpak-instance.c 56 | common/flatpak-oci-registry.c 57 | common/flatpak-progress.c 58 | common/flatpak-ref-utils.c 59 | common/flatpak-remote.c 60 | common/flatpak-run.c 61 | common/flatpak-transaction.c 62 | common/flatpak-uri.c 63 | common/flatpak-utils.c 64 | oci-authenticator/flatpak-oci-authenticator.c 65 | portal/flatpak-portal.c 66 | system-helper/flatpak-system-helper.service.in 67 | system-helper/org.freedesktop.Flatpak.policy.in 68 | -------------------------------------------------------------------------------- /po/Rules-quot: -------------------------------------------------------------------------------- 1 | # Special Makefile rules for English message catalogs with quotation marks. 2 | 3 | DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 4 | 5 | .SUFFIXES: .insert-header .po-update-en 6 | 7 | en@quot.po-create: 8 | $(MAKE) en@quot.po-update 9 | en@boldquot.po-create: 10 | $(MAKE) en@boldquot.po-update 11 | 12 | en@quot.po-update: en@quot.po-update-en 13 | en@boldquot.po-update: en@boldquot.po-update-en 14 | 15 | .insert-header.po-update-en: 16 | @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 17 | if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 18 | tmpdir=`pwd`; \ 19 | echo "$$lang:"; \ 20 | ll=`echo $$lang | sed -e 's/@.*//'`; \ 21 | LC_ALL=C; export LC_ALL; \ 22 | cd $(srcdir); \ 23 | if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ 24 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 25 | rm -f $$tmpdir/$$lang.new.po; \ 26 | else \ 27 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 28 | :; \ 29 | else \ 30 | echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 31 | exit 1; \ 32 | fi; \ 33 | fi; \ 34 | else \ 35 | echo "creation of $$lang.po failed!" 1>&2; \ 36 | rm -f $$tmpdir/$$lang.new.po; \ 37 | fi 38 | 39 | en@quot.insert-header: insert-header.sin 40 | sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 41 | 42 | en@boldquot.insert-header: insert-header.sin 43 | sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 44 | 45 | mostlyclean: mostlyclean-quot 46 | mostlyclean-quot: 47 | rm -f *.insert-header 48 | -------------------------------------------------------------------------------- /po/boldquot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | s/“/“/g 8 | s/”/”/g 9 | s/‘/‘/g 10 | s/’/’/g 11 | -------------------------------------------------------------------------------- /po/cs.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/cs.gmo -------------------------------------------------------------------------------- /po/da.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/da.gmo -------------------------------------------------------------------------------- /po/de.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/de.gmo -------------------------------------------------------------------------------- /po/en@boldquot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | # This catalog furthermore displays the text between the quotation marks in 24 | # bold face, assuming the VT100/XTerm escape sequences. 25 | # 26 | -------------------------------------------------------------------------------- /po/en@quot.header: -------------------------------------------------------------------------------- 1 | # All this catalog "translates" are quotation characters. 2 | # The msgids must be ASCII and therefore cannot contain real quotation 3 | # characters, only substitutes like grave accent (0x60), apostrophe (0x27) 4 | # and double quote (0x22). These substitutes look strange; see 5 | # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html 6 | # 7 | # This catalog translates grave accent (0x60) and apostrophe (0x27) to 8 | # left single quotation mark (U+2018) and right single quotation mark (U+2019). 9 | # It also translates pairs of apostrophe (0x27) to 10 | # left single quotation mark (U+2018) and right single quotation mark (U+2019) 11 | # and pairs of quotation mark (0x22) to 12 | # left double quotation mark (U+201C) and right double quotation mark (U+201D). 13 | # 14 | # When output to an UTF-8 terminal, the quotation characters appear perfectly. 15 | # When output to an ISO-8859-1 terminal, the single quotation marks are 16 | # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to 17 | # grave/acute accent (by libiconv), and the double quotation marks are 18 | # transliterated to 0x22. 19 | # When output to an ASCII terminal, the single quotation marks are 20 | # transliterated to apostrophes, and the double quotation marks are 21 | # transliterated to 0x22. 22 | # 23 | -------------------------------------------------------------------------------- /po/en_GB.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/en_GB.gmo -------------------------------------------------------------------------------- /po/es.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/es.gmo -------------------------------------------------------------------------------- /po/fr.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/fr.gmo -------------------------------------------------------------------------------- /po/gl.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/gl.gmo -------------------------------------------------------------------------------- /po/hi.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/hi.gmo -------------------------------------------------------------------------------- /po/hr.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/hr.gmo -------------------------------------------------------------------------------- /po/hu.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/hu.gmo -------------------------------------------------------------------------------- /po/id.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/id.gmo -------------------------------------------------------------------------------- /po/insert-header.sin: -------------------------------------------------------------------------------- 1 | # Sed script that inserts the file called HEADER before the header entry. 2 | # 3 | # At each occurrence of a line starting with "msgid ", we execute the following 4 | # commands. At the first occurrence, insert the file. At the following 5 | # occurrences, do nothing. The distinction between the first and the following 6 | # occurrences is achieved by looking at the hold space. 7 | /^msgid /{ 8 | x 9 | # Test if the hold space is empty. 10 | s/m/m/ 11 | ta 12 | # Yes it was empty. First occurrence. Read the file. 13 | r HEADER 14 | # Output the file's contents by reading the next line. But don't lose the 15 | # current line while doing this. 16 | g 17 | N 18 | bb 19 | :a 20 | # The hold space was nonempty. Following occurrences. Do nothing. 21 | x 22 | :b 23 | } 24 | -------------------------------------------------------------------------------- /po/oc.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/oc.gmo -------------------------------------------------------------------------------- /po/pl.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/pl.gmo -------------------------------------------------------------------------------- /po/pt.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/pt.gmo -------------------------------------------------------------------------------- /po/pt_BR.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/pt_BR.gmo -------------------------------------------------------------------------------- /po/quot.sed: -------------------------------------------------------------------------------- 1 | s/"\([^"]*\)"/“\1”/g 2 | s/`\([^`']*\)'/‘\1’/g 3 | s/ '\([^`']*\)' / ‘\1’ /g 4 | s/ '\([^`']*\)'$/ ‘\1’/g 5 | s/^'\([^`']*\)' /‘\1’ /g 6 | s/“”/""/g 7 | -------------------------------------------------------------------------------- /po/remove-potcdate.sin: -------------------------------------------------------------------------------- 1 | # Sed script that remove the POT-Creation-Date line in the header entry 2 | # from a POT file. 3 | # 4 | # The distinction between the first and the following occurrences of the 5 | # pattern is achieved by looking at the hold space. 6 | /^"POT-Creation-Date: .*"$/{ 7 | x 8 | # Test if the hold space is empty. 9 | s/P/P/ 10 | ta 11 | # Yes it was empty. First occurrence. Remove the line. 12 | g 13 | d 14 | bb 15 | :a 16 | # The hold space was nonempty. Following occurrences. Do nothing. 17 | x 18 | :b 19 | } 20 | -------------------------------------------------------------------------------- /po/ro.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/ro.gmo -------------------------------------------------------------------------------- /po/ru.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/ru.gmo -------------------------------------------------------------------------------- /po/sk.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/sk.gmo -------------------------------------------------------------------------------- /po/stamp-po: -------------------------------------------------------------------------------- 1 | timestamp 2 | -------------------------------------------------------------------------------- /po/sv.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/sv.gmo -------------------------------------------------------------------------------- /po/tr.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/tr.gmo -------------------------------------------------------------------------------- /po/uk.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/uk.gmo -------------------------------------------------------------------------------- /po/zh_CN.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/zh_CN.gmo -------------------------------------------------------------------------------- /po/zh_TW.gmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/po/zh_TW.gmo -------------------------------------------------------------------------------- /portal/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | libexec_PROGRAMS += \ 2 | flatpak-portal \ 3 | $(NULL) 4 | 5 | service_in_files += portal/flatpak-portal.service.in 6 | systemduserunit_DATA += portal/flatpak-portal.service 7 | 8 | service_in_files += portal/org.freedesktop.portal.Flatpak.service.in 9 | dbus_service_DATA += portal/org.freedesktop.portal.Flatpak.service 10 | 11 | nodist_flatpak_portal_SOURCES = \ 12 | portal/flatpak-permission-dbus.c \ 13 | portal/flatpak-permission-dbus.h \ 14 | portal/flatpak-portal-dbus.c \ 15 | portal/flatpak-portal-dbus.h \ 16 | $(NULL) 17 | 18 | portal/flatpak-permission-dbus.c: data/org.freedesktop.impl.portal.PermissionStore.xml Makefile 19 | mkdir -p $(builddir)/portal 20 | $(AM_V_GEN) $(GDBUS_CODEGEN) \ 21 | --interface-prefix org.freedesktop.impl.portal \ 22 | --c-namespace XdpDbus \ 23 | --generate-c-code $(builddir)/portal/flatpak-permission-dbus \ 24 | $(srcdir)/data/org.freedesktop.impl.portal.PermissionStore.xml \ 25 | $(NULL) 26 | 27 | 28 | portal/flatpak-portal-dbus.c: data/org.freedesktop.portal.Flatpak.xml Makefile 29 | mkdir -p $(builddir)/portal 30 | $(AM_V_GEN) $(GDBUS_CODEGEN) \ 31 | --interface-prefix org.freedesktop.portal \ 32 | --c-namespace Portal \ 33 | --generate-c-code $(builddir)/portal/flatpak-portal-dbus \ 34 | $(srcdir)/data/org.freedesktop.portal.Flatpak.xml \ 35 | $(NULL) 36 | 37 | portal/%-dbus.h: portal/%-dbus.c 38 | @true # Built as a side-effect of the rules for the .c 39 | 40 | flatpak_portal_SOURCES = \ 41 | portal/flatpak-portal.c \ 42 | portal/flatpak-portal.h \ 43 | portal/flatpak-portal-app-info.c \ 44 | portal/flatpak-portal-app-info.h \ 45 | portal/portal-impl.c \ 46 | portal/portal-impl.h \ 47 | common/flatpak-portal-error.c \ 48 | common/flatpak-portal-error.h \ 49 | $(NULL) 50 | 51 | BUILT_SOURCES += $(nodist_flatpak_portal_SOURCES) 52 | CLEANFILES += $(nodist_flatpak_portal_SOURCES) 53 | 54 | flatpak_portal_LDADD = $(AM_LDADD) $(BASE_LIBS) $(OSTREE_LIBS) libflatpak-common.la libflatpak-common-base.la libglnx.la 55 | flatpak_portal_CFLAGS = \ 56 | $(AM_CFLAGS) \ 57 | $(BASE_CFLAGS) \ 58 | $(OSTREE_CFLAGS) \ 59 | $(SOUP_CFLAGS) \ 60 | $(JSON_CFLAGS) \ 61 | -DFLATPAK_COMPILATION \ 62 | -DDATADIR=\"$(datadir)\" \ 63 | $(NULL) 64 | flatpak_portal_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/portal 65 | -------------------------------------------------------------------------------- /portal/flatpak-portal-app-info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | */ 20 | 21 | #ifndef __FLATPAK_PORTAL_APP_INFO_H__ 22 | #define __FLATPAK_PORTAL_APP_INFO_H__ 23 | 24 | #define FLATPAK_METADATA_GROUP_APPLICATION "Application" 25 | #define FLATPAK_METADATA_GROUP_RUNTIME "Runtime" 26 | #define FLATPAK_METADATA_GROUP_INSTANCE "Instance" 27 | #define FLATPAK_METADATA_GROUP_CONTEXT "Context" 28 | #define FLATPAK_METADATA_KEY_NAME "name" 29 | #define FLATPAK_METADATA_KEY_ARCH "arch" 30 | #define FLATPAK_METADATA_KEY_RUNTIME "runtime" 31 | #define FLATPAK_METADATA_KEY_BRANCH "branch" 32 | #define FLATPAK_METADATA_KEY_EXTRA_ARGS "extra-args" 33 | #define FLATPAK_METADATA_KEY_APP_COMMIT "app-commit" 34 | #define FLATPAK_METADATA_KEY_RUNTIME_COMMIT "runtime-commit" 35 | #define FLATPAK_METADATA_KEY_SHARED "shared" 36 | #define FLATPAK_METADATA_KEY_SOCKETS "sockets" 37 | #define FLATPAK_METADATA_KEY_DEVICES "devices" 38 | #define FLATPAK_METADATA_KEY_DEVEL "devel" 39 | #define FLATPAK_METADATA_KEY_INSTANCE_PATH "instance-path" 40 | #define FLATPAK_METADATA_KEY_INSTANCE_ID "instance-id" 41 | 42 | GKeyFile * flatpak_invocation_lookup_app_info (GDBusMethodInvocation *invocation, 43 | GCancellable *cancellable, 44 | GError **error); 45 | 46 | void flatpak_connection_track_name_owners (GDBusConnection *connection); 47 | 48 | #endif /* __FLATPAK_PORTAL_APP_INFO_H__ */ 49 | -------------------------------------------------------------------------------- /portal/flatpak-portal.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=flatpak portal 3 | PartOf=graphical-session.target 4 | 5 | [Service] 6 | BusName=org.freedesktop.portal.Flatpak 7 | ExecStart=@libexecdir@/flatpak-portal 8 | Type=dbus 9 | -------------------------------------------------------------------------------- /portal/org.freedesktop.portal.Flatpak.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.freedesktop.portal.Flatpak 3 | Exec=@libexecdir@/flatpak-portal@extraargs@ 4 | SystemdService=flatpak-portal.service 5 | -------------------------------------------------------------------------------- /portal/portal-impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Red Hat, Inc 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | * 17 | * Authors: 18 | * Alexander Larsson 19 | * Matthias Clasen 20 | */ 21 | 22 | #ifndef __PORTAL_IMPL_H__ 23 | #define __PORTAL_IMPL_H__ 24 | 25 | #include 26 | 27 | typedef struct { 28 | char *source; 29 | char *dbus_name; 30 | char **interfaces; 31 | char **use_in; 32 | int priority; 33 | } PortalImplementation; 34 | 35 | void load_installed_portals (gboolean opt_verbose); 36 | PortalImplementation *find_portal_implementation (const char *interface); 37 | 38 | #endif /* __PORTAL_IMPL_H__ */ 39 | -------------------------------------------------------------------------------- /profile/flatpak.fish: -------------------------------------------------------------------------------- 1 | if type -q flatpak 2 | # Set XDG_DATA_DIRS to include Flatpak installations 3 | 4 | set -x --path XDG_DATA_DIRS $XDG_DATA_DIRS 5 | 6 | set -q XDG_DATA_DIRS[1]; or set XDG_DATA_DIRS /usr/local/share /usr/share 7 | set -q XDG_DATA_HOME; or set -l XDG_DATA_HOME $HOME/.local/share 8 | 9 | set -l installations $XDG_DATA_HOME/flatpak 10 | begin 11 | set -le G_MESSAGES_DEBUG 12 | set -lx GIO_USE_VFS local 13 | set installations $installations (flatpak --installations) 14 | end 15 | 16 | for dir in {$installations[-1..1]}/exports/share 17 | if not contains $dir $XDG_DATA_DIRS 18 | set -p XDG_DATA_DIRS $dir 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /profile/flatpak.sh: -------------------------------------------------------------------------------- 1 | if command -v flatpak > /dev/null; then 2 | # set XDG_DATA_DIRS to include Flatpak installations 3 | 4 | new_dirs=$( 5 | ( 6 | unset G_MESSAGES_DEBUG 7 | echo "${XDG_DATA_HOME:-"$HOME/.local/share"}/flatpak" 8 | GIO_USE_VFS=local flatpak --installations 9 | ) | ( 10 | new_dirs= 11 | while read -r install_path 12 | do 13 | share_path=$install_path/exports/share 14 | case ":$XDG_DATA_DIRS:" in 15 | (*":$share_path:"*) :;; 16 | (*":$share_path/:"*) :;; 17 | (*) new_dirs=${new_dirs:+${new_dirs}:}$share_path;; 18 | esac 19 | done 20 | echo "$new_dirs" 21 | ) 22 | ) 23 | 24 | export XDG_DATA_DIRS 25 | XDG_DATA_DIRS="${new_dirs:+${new_dirs}:}${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" 26 | 27 | unset new_dirs 28 | fi 29 | -------------------------------------------------------------------------------- /revokefs/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Colin Walters 2 | # Copyright (C) 2018 Alexander Larsson 3 | # 4 | # SPDX-License-Identifier: LGPL-2.0+ 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the 18 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | # Boston, MA 02111-1307, USA. 20 | 21 | libexec_PROGRAMS += revokefs-fuse 22 | 23 | noinst_PROGRAMS += revokefs-demo 24 | 25 | revokefs_fuse_SOURCES = revokefs/main.c revokefs/writer.c revokefs/writer.h 26 | 27 | revokefs_fuse_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(FUSE_CFLAGS) 28 | revokefs_fuse_LDADD = libglnx.la $(BASE_LIBS) $(FUSE_LIBS) 29 | 30 | revokefs_demo_SOURCES = revokefs/demo.c 31 | revokefs_demo_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) 32 | revokefs_demo_LDADD = $(BASE_LIBS) 33 | -------------------------------------------------------------------------------- /revokefs/demo.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int 9 | main (int argc, char *argv[]) 10 | { 11 | int sockets[2]; 12 | g_autofree char *socket_0 = NULL; 13 | g_autofree char *socket_1 = NULL; 14 | GError *error = NULL; 15 | char buf[20]; 16 | GPid backend_pid, fuse_pid; 17 | 18 | if (argc != 3) 19 | { 20 | g_printerr ("Usage: revokefs-demo basepath targetpath\n"); 21 | exit (EXIT_FAILURE); 22 | } 23 | 24 | if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sockets)) 25 | { 26 | perror ("Failed to create socket pair"); 27 | exit (EXIT_FAILURE); 28 | } 29 | 30 | socket_0 = g_strdup_printf ("--socket=%d", sockets[0]); 31 | socket_1 = g_strdup_printf ("--socket=%d", sockets[1]); 32 | 33 | char *backend_argv[] = 34 | { 35 | "./revokefs-fuse", 36 | "--backend", 37 | socket_0, 38 | argv[1], 39 | NULL 40 | }; 41 | 42 | /* Don't inherit fuse socket in backend */ 43 | fcntl (sockets[1], F_SETFD, FD_CLOEXEC); 44 | if (!g_spawn_async (NULL, 45 | backend_argv, 46 | NULL, 47 | G_SPAWN_LEAVE_DESCRIPTORS_OPEN, 48 | NULL, NULL, 49 | &backend_pid, &error)) 50 | { 51 | g_printerr ("Failed to launch backend: %s", error->message); 52 | exit (EXIT_FAILURE); 53 | } 54 | close (sockets[0]); /* Close backend side now so it doesn't get into the fuse child */ 55 | 56 | char *fuse_argv[] = 57 | { 58 | "./revokefs-fuse", 59 | socket_1, 60 | argv[1], 61 | argv[2], 62 | NULL 63 | }; 64 | 65 | if (!g_spawn_async (NULL, 66 | fuse_argv, 67 | NULL, 68 | G_SPAWN_LEAVE_DESCRIPTORS_OPEN, 69 | NULL, NULL, 70 | &fuse_pid, &error)) 71 | { 72 | g_printerr ("Failed to launch backend: %s", error->message); 73 | exit (EXIT_FAILURE); 74 | } 75 | 76 | g_print ("Started revokefs, press enter to revoke"); 77 | if (!fgets(buf, sizeof(buf), stdin)) 78 | { 79 | perror ("fgets"); 80 | } 81 | 82 | g_print ("Revoking write permissions"); 83 | shutdown (sockets[1], SHUT_RDWR); 84 | } 85 | -------------------------------------------------------------------------------- /selinux/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if BUILD_SELINUX_MODULE 2 | selinux_moduledir = ${datadir}/selinux/packages 3 | selinux_module_DATA = $(NULL) 4 | 5 | selinux_develdir = ${datadir}/selinux/devel/include/contrib 6 | selinux_devel_DATA = $(NULL) 7 | 8 | flatpak.pp.bz2: selinux/flatpak.te selinux/flatpak.fc selinux/build-selinux.sh 9 | $(srcdir)/selinux/build-selinux.sh . $^ 10 | 11 | selinux_module_DATA += flatpak.pp.bz2 12 | selinux_devel_DATA += selinux/flatpak.if 13 | endif 14 | 15 | EXTRA_DIST += \ 16 | selinux/build-selinux.sh \ 17 | selinux/flatpak.te \ 18 | selinux/flatpak.fc \ 19 | selinux/flatpak.if \ 20 | $(NULL) 21 | 22 | DISTCLEANFILES += flatpak.pp.bz2 23 | -------------------------------------------------------------------------------- /selinux/build-selinux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2019 Red Hat Inc. 3 | # Copyright 2022 Collabora Ltd. 4 | # SPDX-License-Identifier: LGPL-2.1-or-later 5 | 6 | set -eu 7 | 8 | TMP=$(mktemp -d selinux-build-XXXXXX) 9 | output="$1" 10 | shift 11 | cp -- "$@" "$TMP/" 12 | 13 | make -C "$TMP" -f /usr/share/selinux/devel/Makefile flatpak.pp 14 | bzip2 -9 "$TMP/flatpak.pp" 15 | cp "$TMP/flatpak.pp.bz2" "$output" 16 | rm -fr "$TMP" 17 | -------------------------------------------------------------------------------- /selinux/flatpak.fc: -------------------------------------------------------------------------------- 1 | /usr/libexec/flatpak-system-helper -- gen_context(system_u:object_r:flatpak_helper_exec_t,s0) 2 | -------------------------------------------------------------------------------- /selinux/flatpak.if: -------------------------------------------------------------------------------- 1 | ## 2 | -------------------------------------------------------------------------------- /selinux/flatpak.te: -------------------------------------------------------------------------------- 1 | policy_module(flatpak, 0.0.1) 2 | 3 | # The flatpak-system helper used to be a regular unconfined_service_t 4 | # but this failed because it was not allowed to pass a unix socket fd 5 | # over dbus-daemon. This module fixes that by creating an unconfined 6 | # domain with some additional dbus permissions. 7 | 8 | # I did try to make the domain confined, but it needs a lot of 9 | # permissions and my selinux-foo just isn't good enough. 10 | 11 | type flatpak_helper_t; 12 | type flatpak_helper_exec_t; 13 | init_daemon_domain(flatpak_helper_t, flatpak_helper_exec_t) 14 | 15 | auth_read_passwd(flatpak_helper_t) 16 | files_list_var_lib(flatpak_helper_t) 17 | files_read_var_lib_files(flatpak_helper_t) 18 | files_read_var_lib_symlinks(flatpak_helper_t) 19 | 20 | ifdef(`corecmd_watch_bin_dirs',` 21 | corecmd_watch_bin_dirs(flatpak_helper_t) 22 | ') 23 | 24 | optional_policy(` 25 | dbus_stub() 26 | dbus_system_domain(flatpak_helper_t, flatpak_helper_exec_t) 27 | 28 | # Allow passing the revokefs socket over dbus 29 | allow system_dbusd_t flatpak_helper_t:unix_stream_socket rw_stream_socket_perms; 30 | ') 31 | 32 | optional_policy(` 33 | policykit_dbus_chat(flatpak_helper_t) 34 | ') 35 | 36 | optional_policy(` 37 | systemd_userdbd_stream_connect(flatpak_helper_t) 38 | ') 39 | 40 | optional_policy(` 41 | unconfined_domain(flatpak_helper_t) 42 | ') 43 | -------------------------------------------------------------------------------- /session-helper/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | libexec_PROGRAMS += \ 2 | flatpak-session-helper \ 3 | $(NULL) 4 | 5 | service_in_files += session-helper/flatpak-session-helper.service.in 6 | systemduserunit_DATA += session-helper/flatpak-session-helper.service 7 | 8 | service_in_files += session-helper/org.freedesktop.Flatpak.service.in 9 | dbus_service_DATA += session-helper/org.freedesktop.Flatpak.service 10 | 11 | flatpak_session_helper_SOURCES = \ 12 | session-helper/flatpak-session-helper.c \ 13 | session-helper/flatpak-session-helper.h \ 14 | $(NULL) 15 | 16 | flatpak_session_helper_LDADD = $(AM_LDADD) $(BASE_LIBS) libflatpak-common-base.la libglnx.la 17 | flatpak_session_helper_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) -DFLATPAK_COMPILATION 18 | -------------------------------------------------------------------------------- /session-helper/flatpak-session-helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2021 Collabora Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef __FLATPAK_SESSION_HELPER_H__ 19 | #define __FLATPAK_SESSION_HELPER_H__ 20 | 21 | #define FLATPAK_SESSION_HELPER_BUS_NAME "org.freedesktop.Flatpak" 22 | 23 | #define FLATPAK_SESSION_HELPER_PATH "/org/freedesktop/Flatpak/SessionHelper" 24 | #define FLATPAK_SESSION_HELPER_INTERFACE "org.freedesktop.Flatpak.SessionHelper" 25 | 26 | #define FLATPAK_SESSION_HELPER_PATH_DEVELOPMENT "/org/freedesktop/Flatpak/Development" 27 | #define FLATPAK_SESSION_HELPER_INTERFACE_DEVELOPMENT "org.freedesktop.Flatpak.Development" 28 | 29 | typedef enum { 30 | FLATPAK_HOST_COMMAND_FLAGS_CLEAR_ENV = 1 << 0, 31 | FLATPAK_HOST_COMMAND_FLAGS_WATCH_BUS = 1 << 1, 32 | FLATPAK_HOST_COMMAND_FLAGS_NONE = 0 33 | } FlatpakHostCommandFlags; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /session-helper/flatpak-session-helper.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=flatpak session helper 3 | PartOf=graphical-session.target 4 | 5 | [Service] 6 | BusName=org.freedesktop.Flatpak 7 | ExecStart=@libexecdir@/flatpak-session-helper 8 | Type=dbus 9 | -------------------------------------------------------------------------------- /session-helper/org.freedesktop.Flatpak.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.freedesktop.Flatpak 3 | Exec=@libexecdir@/flatpak-session-helper 4 | SystemdService=flatpak-session-helper.service 5 | -------------------------------------------------------------------------------- /sideload-repos-systemd/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if BUILD_AUTO_SIDELOADING 2 | 3 | dist_libexec_SCRIPTS = sideload-repos-systemd/flatpak-create-sideload-symlinks.sh 4 | 5 | service_in_files += sideload-repos-systemd/flatpak-sideload-usb-repo.service.in 6 | systemduserunit_DATA += sideload-repos-systemd/flatpak-sideload-usb-repo.service 7 | 8 | path_in_files = sideload-repos-systemd/flatpak-sideload-usb-repo.path.in 9 | systemduserunit_DATA += sideload-repos-systemd/flatpak-sideload-usb-repo.path 10 | 11 | %.path: %.path.in config.log 12 | $(AM_V_GEN) $(SED) -e "s|\@media_dir\@|$(RUN_MEDIA_DIR)|" $< > $@ 13 | 14 | dist_tmpfiles_DATA += sideload-repos-systemd/tmpfiles.d/flatpak-sideload-repos.conf 15 | 16 | endif 17 | 18 | EXTRA_DIST += sideload-repos-systemd/flatpak-sideload-usb-repo.path.in sideload-repos-systemd/flatpak-sideload-usb-repo.service.in 19 | 20 | -------------------------------------------------------------------------------- /sideload-repos-systemd/flatpak-create-sideload-symlinks.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script is intended to be run by flatpak-sideload-usb-repo.service 4 | 5 | shopt -s nullglob 6 | media_dir=${1:?path to media directory is required} 7 | 8 | # Add a link to any newly inserted drives which might have been copied to with 9 | # "flatpak create-usb". If we were to check for a repo on the drive that would 10 | # break the case of using it for sideloading directly after copying to it (e.g. 11 | # for testing). 12 | for f in "$media_dir"/*; do 13 | if ! test -d "$f"; then 14 | continue 15 | fi 16 | unique_name=automount$(systemd-escape "$f") 17 | if test -e "/run/flatpak/sideload-repos/$unique_name"; then 18 | continue 19 | fi 20 | ln -s "$f" "/run/flatpak/sideload-repos/$unique_name" 21 | done 22 | 23 | # Remove any broken symlinks e.g. from drives that were removed 24 | for f in /run/flatpak/sideload-repos/automount*; do 25 | OWNER=$(stat -c '%u' "$f") 26 | if [ "$UID" != "$OWNER" ]; then 27 | continue 28 | fi 29 | if ! test -e "$f"; then 30 | rm "$f" 31 | fi 32 | done 33 | -------------------------------------------------------------------------------- /sideload-repos-systemd/flatpak-sideload-usb-repo.path.in: -------------------------------------------------------------------------------- 1 | # This unit is intended to be installed in the systemd user instance, and 2 | # depends on /run/flatpak/sideload-repos having been created via 3 | # systemd-tmpfiles. The idea here is that we add any USB drive mounts to the 4 | # appropriate directory so Flatpak can find and pull from them in case they 5 | # have flatpaks on them, both when a new drive is inserted and at the start of 6 | # the user session. 7 | [Path] 8 | PathChanged=@media_dir@/%u 9 | 10 | [Install] 11 | WantedBy=default.target 12 | -------------------------------------------------------------------------------- /sideload-repos-systemd/flatpak-sideload-usb-repo.service.in: -------------------------------------------------------------------------------- 1 | # This unit is intended to be installed in the systemd user instance; see the 2 | # docs in flatpak-sideload-usb-repo.path 3 | [Service] 4 | Type=oneshot 5 | ExecStart=@libexecdir@/flatpak-create-sideload-symlinks.sh @media_dir@/%u 6 | 7 | [Install] 8 | WantedBy=default.target 9 | -------------------------------------------------------------------------------- /sideload-repos-systemd/tmpfiles.d/flatpak-sideload-repos.conf: -------------------------------------------------------------------------------- 1 | D /run/flatpak/sideload-repos 0777 - - - 2 | -------------------------------------------------------------------------------- /subprojects/Makefile-bwrap.am.inc: -------------------------------------------------------------------------------- 1 | bwrap_SOURCES = \ 2 | subprojects/bubblewrap/bubblewrap.c \ 3 | subprojects/bubblewrap/bind-mount.h \ 4 | subprojects/bubblewrap/bind-mount.c \ 5 | subprojects/bubblewrap/network.h \ 6 | subprojects/bubblewrap/network.c \ 7 | subprojects/bubblewrap/utils.h \ 8 | subprojects/bubblewrap/utils.c \ 9 | $(NULL) 10 | 11 | bwrap_CFLAGS = $(AM_CFLAGS) 12 | bwrap_LDADD = $(SELINUX_LIBS) 13 | -------------------------------------------------------------------------------- /subprojects/bubblewrap/bind-mount.h: -------------------------------------------------------------------------------- 1 | /* bubblewrap 2 | * Copyright (C) 2016 Alexander Larsson 3 | * SPDX-License-Identifier: LGPL-2.0-or-later 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library. If not, see . 17 | * 18 | */ 19 | 20 | #pragma once 21 | 22 | #include "utils.h" 23 | 24 | typedef enum { 25 | BIND_READONLY = (1 << 0), 26 | BIND_DEVICES = (1 << 2), 27 | BIND_RECURSIVE = (1 << 3), 28 | } bind_option_t; 29 | 30 | typedef enum 31 | { 32 | BIND_MOUNT_SUCCESS = 0, 33 | BIND_MOUNT_ERROR_MOUNT, 34 | BIND_MOUNT_ERROR_REALPATH_DEST, 35 | BIND_MOUNT_ERROR_REOPEN_DEST, 36 | BIND_MOUNT_ERROR_READLINK_DEST_PROC_FD, 37 | BIND_MOUNT_ERROR_FIND_DEST_MOUNT, 38 | BIND_MOUNT_ERROR_REMOUNT_DEST, 39 | BIND_MOUNT_ERROR_REMOUNT_SUBMOUNT, 40 | } bind_mount_result; 41 | 42 | bind_mount_result bind_mount (int proc_fd, 43 | const char *src, 44 | const char *dest, 45 | bind_option_t options); 46 | 47 | const char *bind_mount_result_to_string (bind_mount_result res, 48 | bool *want_errno); 49 | 50 | void die_with_bind_result (bind_mount_result res, 51 | int saved_errno, 52 | const char *format, 53 | ...) 54 | __attribute__((__noreturn__)) 55 | __attribute__((format (printf, 3, 4))); 56 | -------------------------------------------------------------------------------- /subprojects/bubblewrap/network.h: -------------------------------------------------------------------------------- 1 | /* bubblewrap 2 | * Copyright (C) 2016 Alexander Larsson 3 | * SPDX-License-Identifier: LGPL-2.0-or-later 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library. If not, see . 17 | * 18 | */ 19 | 20 | #pragma once 21 | 22 | void loopback_setup (void); 23 | -------------------------------------------------------------------------------- /subprojects/libglnx/COPYING: -------------------------------------------------------------------------------- 1 | This project's licensing is REUSE-compliant . 2 | See individual files for full details of copyright and licensing, 3 | and see LICENSES/*.txt for the license text. 4 | -------------------------------------------------------------------------------- /subprojects/libglnx/README.md: -------------------------------------------------------------------------------- 1 | libglnx is the successor to [libgsystem](https://gitlab.gnome.org/Archive/libgsystem). 2 | 3 | It is for modules which depend on both GLib and Linux, intended to be 4 | used as a git submodule. 5 | 6 | Features: 7 | 8 | - File APIs which use `openat()` like APIs, but also take a `GCancellable` 9 | to support dynamic cancellation 10 | - APIs also have a `GError` parameter 11 | - High level "shutil", somewhat inspired by Python's 12 | - A "console" API for tty output 13 | - A backport of the GLib cleanup macros for projects which can't yet take 14 | a dependency on 2.40. 15 | 16 | Why? 17 | ---- 18 | 19 | There are multiple projects which have a hard dependency on Linux and 20 | GLib, such as NetworkManager, ostree, flatpak, etc. It makes sense 21 | for them to be able to share Linux-specific APIs. 22 | 23 | This module also contains some code taken from systemd, which has very 24 | high quality LGPLv2+ shared library code, but most of the internal 25 | shared library is private, and not namespaced. 26 | 27 | One could also compare this project to gnulib; the salient differences 28 | there are that at least some of this module is eventually destined for 29 | inclusion in GLib. 30 | 31 | Adding this to your project 32 | --------------------------- 33 | 34 | ## Meson 35 | 36 | First, set up a Git submodule: 37 | 38 | ``` 39 | git submodule add https://gitlab.gnome.org/GNOME/libglnx subprojects/libglnx 40 | ``` 41 | 42 | Or a Git [subtree](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt): 43 | 44 | ``` 45 | git remote add libglnx https://gitlab.gnome.org/GNOME/libglnx.git 46 | git fetch libglnx 47 | git subtree add -P subprojects/libglnx libglnx/master 48 | ``` 49 | 50 | Then, in your top-level `meson.build`: 51 | 52 | ``` 53 | libglnx_dep = subproject('libglnx').get_variable('libglnx_dep') 54 | # now use libglnx_dep in your dependencies 55 | ``` 56 | 57 | Porting from libgsystem 58 | ----------------------- 59 | 60 | For all of the filesystem access code, libglnx exposes only 61 | fd-relative API, not `GFile*`. It does use `GCancellable` where 62 | applicable. 63 | 64 | For local allocation macros, you should start using the `g_auto` 65 | macros from GLib. A backport is included in libglnx. There are a few 66 | APIs not defined in GLib yet, such as `glnx_autofd`. 67 | 68 | `gs_transfer_out_value` is replaced by `g_steal_pointer`. 69 | 70 | Contributing 71 | ------------ 72 | 73 | Development happens in GNOME Gitlab: https://gitlab.gnome.org/GNOME/libglnx 74 | 75 | (If you're seeing this on the Github mirror, we used to do development 76 | on Github but that was before GNOME deployed Gitlab.) 77 | 78 | 83 | -------------------------------------------------------------------------------- /subprojects/libglnx/glnx-backports.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2015 Colin Walters 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published 8 | * by the Free Software Foundation; either version 2 of the licence or (at 9 | * your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General 17 | * Public License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #include "libglnx-config.h" 23 | 24 | #include "glnx-backports.h" 25 | 26 | #if !GLIB_CHECK_VERSION(2, 44, 0) 27 | gboolean 28 | glnx_strv_contains (const gchar * const *strv, 29 | const gchar *str) 30 | { 31 | g_return_val_if_fail (strv != NULL, FALSE); 32 | g_return_val_if_fail (str != NULL, FALSE); 33 | 34 | for (; *strv != NULL; strv++) 35 | { 36 | if (g_str_equal (str, *strv)) 37 | return TRUE; 38 | } 39 | 40 | return FALSE; 41 | } 42 | 43 | gboolean 44 | glnx_set_object (GObject **object_ptr, 45 | GObject *new_object) 46 | { 47 | GObject *old_object = *object_ptr; 48 | 49 | if (old_object == new_object) 50 | return FALSE; 51 | 52 | if (new_object != NULL) 53 | g_object_ref (new_object); 54 | 55 | *object_ptr = new_object; 56 | 57 | if (old_object != NULL) 58 | g_object_unref (old_object); 59 | 60 | return TRUE; 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /subprojects/libglnx/glnx-console.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2013,2014,2015 Colin Walters 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published 8 | * by the Free Software Foundation; either version 2 of the licence or (at 9 | * your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General 17 | * Public License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | struct GLnxConsoleRef { 29 | gboolean locked; 30 | gboolean is_tty; 31 | }; 32 | 33 | typedef struct GLnxConsoleRef GLnxConsoleRef; 34 | 35 | gboolean glnx_stdout_is_tty (void); 36 | 37 | void glnx_console_lock (GLnxConsoleRef *ref); 38 | 39 | void glnx_console_text (const char *text); 40 | 41 | void glnx_console_progress_text_percent (const char *text, 42 | guint percentage); 43 | 44 | void glnx_console_progress_n_items (const char *text, 45 | guint current, 46 | guint total); 47 | 48 | void glnx_console_unlock (GLnxConsoleRef *ref); 49 | 50 | guint glnx_console_lines (void); 51 | 52 | guint glnx_console_columns (void); 53 | 54 | static inline void 55 | glnx_console_ref_cleanup (GLnxConsoleRef *p) 56 | { 57 | if (p->locked) 58 | glnx_console_unlock (p); 59 | } 60 | G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxConsoleRef, glnx_console_ref_cleanup) 61 | 62 | G_END_DECLS 63 | -------------------------------------------------------------------------------- /subprojects/libglnx/glnx-local-alloc.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2012,2015 Colin Walters . 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | /** 30 | * glnx_unref_object: 31 | * 32 | * Call g_object_unref() on a variable location when it goes out of 33 | * scope. Note that unlike g_object_unref(), the variable may be 34 | * %NULL. 35 | */ 36 | #define glnx_unref_object __attribute__ ((cleanup(glnx_local_obj_unref))) 37 | static inline void 38 | glnx_local_obj_unref (void *v) 39 | { 40 | GObject *o = *(GObject **)v; 41 | if (o) 42 | g_object_unref (o); 43 | } 44 | #define glnx_unref_object __attribute__ ((cleanup(glnx_local_obj_unref))) 45 | 46 | static inline int 47 | glnx_steal_fd (int *fdp) 48 | { 49 | int fd = *fdp; 50 | *fdp = -1; 51 | return fd; 52 | } 53 | 54 | /** 55 | * glnx_close_fd: 56 | * @fdp: Pointer to fd 57 | * 58 | * Effectively `close (glnx_steal_fd (&fd))`. Also 59 | * asserts that `close()` did not raise `EBADF` - encountering 60 | * that error is usually a critical bug in the program. 61 | */ 62 | static inline void 63 | glnx_close_fd (int *fdp) 64 | { 65 | int errsv; 66 | 67 | g_assert (fdp); 68 | 69 | int fd = glnx_steal_fd (fdp); 70 | if (fd >= 0) 71 | { 72 | errsv = errno; 73 | if (close (fd) < 0) 74 | g_assert (errno != EBADF); 75 | errno = errsv; 76 | } 77 | } 78 | 79 | /** 80 | * glnx_fd_close: 81 | * 82 | * Deprecated in favor of `glnx_autofd`. 83 | */ 84 | #define glnx_fd_close __attribute__((cleanup(glnx_close_fd))) 85 | /** 86 | * glnx_autofd: 87 | * 88 | * Call close() on a variable location when it goes out of scope. 89 | */ 90 | #define glnx_autofd __attribute__((cleanup(glnx_close_fd))) 91 | 92 | G_END_DECLS 93 | -------------------------------------------------------------------------------- /subprojects/libglnx/glnx-lockfile.h: -------------------------------------------------------------------------------- 1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ 2 | 3 | #pragma once 4 | 5 | /*** 6 | This file is part of systemd. 7 | 8 | Copyright 2011 Lennart Poettering 9 | Copyright 2015 Colin Walters 10 | SPDX-License-Identifier: LGPL-2.1-or-later 11 | 12 | systemd is free software; you can redistribute it and/or modify it 13 | under the terms of the GNU Lesser General Public License as published by 14 | the Free Software Foundation; either version 2.1 of the License, or 15 | (at your option) any later version. 16 | 17 | systemd is distributed in the hope that it will be useful, but 18 | WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | Lesser General Public License for more details. 21 | 22 | You should have received a copy of the GNU Lesser General Public License 23 | along with systemd; If not, see . 24 | ***/ 25 | 26 | #include "glnx-backport-autoptr.h" 27 | 28 | typedef struct GLnxLockFile { 29 | gboolean initialized; 30 | int dfd; 31 | char *path; 32 | int fd; 33 | int operation; 34 | } GLnxLockFile; 35 | 36 | gboolean glnx_make_lock_file(int dfd, const char *p, int operation, GLnxLockFile *ret, GError **error); 37 | void glnx_release_lock_file(GLnxLockFile *f); 38 | 39 | G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GLnxLockFile, glnx_release_lock_file) 40 | -------------------------------------------------------------------------------- /subprojects/libglnx/glnx-shutil.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2014,2015 Colin Walters . 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | gboolean 29 | glnx_shutil_rm_rf_at (int dfd, 30 | const char *path, 31 | GCancellable *cancellable, 32 | GError **error); 33 | 34 | gboolean 35 | glnx_shutil_mkdir_p_at (int dfd, 36 | const char *path, 37 | int mode, 38 | GCancellable *cancellable, 39 | GError **error); 40 | 41 | gboolean 42 | glnx_shutil_mkdir_p_at_open (int dfd, 43 | const char *path, 44 | int mode, 45 | int *out_dfd, 46 | GCancellable *cancellable, 47 | GError **error); 48 | 49 | G_END_DECLS 50 | -------------------------------------------------------------------------------- /subprojects/libglnx/libglnx.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2012,2013,2015 Colin Walters . 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | G_BEGIN_DECLS 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | G_END_DECLS 42 | -------------------------------------------------------------------------------- /subprojects/libglnx/libglnx.m4: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Colin Walters 2 | # Copyright 2020 Endless OS Foundation LLC 3 | # SPDX-License-Identifier: LGPL-2.1-or-later 4 | 5 | AC_DEFUN([LIBGLNX_CONFIGURE], 6 | [ 7 | AC_CHECK_DECLS([ 8 | renameat2, 9 | memfd_create, 10 | copy_file_range], 11 | [], [], [[ 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | ]]) 22 | 23 | AC_ARG_ENABLE(otmpfile, 24 | [AS_HELP_STRING([--disable-otmpfile], 25 | [Disable use of O_TMPFILE [default=no]])],, 26 | [enable_otmpfile=yes]) 27 | AS_IF([test $enable_otmpfile = yes], [], [ 28 | AC_DEFINE([DISABLE_OTMPFILE], 1, [Define if we should avoid using O_TMPFILE])]) 29 | 30 | AC_ARG_ENABLE(wrpseudo-compat, 31 | [AS_HELP_STRING([--enable-wrpseudo-compat], 32 | [Disable use of syscall() in some cases for compatibility with pseudo [default=no]])],, 33 | [enable_wrpseudo_compat=no]) 34 | AS_IF([test $enable_wrpseudo_compat = no], [], [ 35 | AC_DEFINE([ENABLE_WRPSEUDO_COMPAT], 1, [Define if we should be compatible with pseudo])]) 36 | 37 | dnl end LIBGLNX_CONFIGURE 38 | ]) 39 | -------------------------------------------------------------------------------- /subprojects/libglnx/tests/libglnx-testlib.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright 2019 Collabora Ltd. 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #include "libglnx-config.h" 23 | #include "libglnx-testlib.h" 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include "libglnx.h" 30 | 31 | struct _GLnxTestAutoTempDir 32 | { 33 | gchar *old_cwd; 34 | int old_cwd_fd; 35 | GLnxTmpDir temp_dir; 36 | }; 37 | 38 | _GLnxTestAutoTempDir * 39 | _glnx_test_auto_temp_dir_enter (void) 40 | { 41 | GError *error = NULL; 42 | _GLnxTestAutoTempDir *ret = g_new0 (_GLnxTestAutoTempDir, 1); 43 | 44 | glnx_mkdtemp ("glnx-test-XXXXXX", 0700, &ret->temp_dir, &error); 45 | g_assert_no_error (error); 46 | 47 | /* just for better diagnostics */ 48 | ret->old_cwd = g_get_current_dir (); 49 | 50 | glnx_opendirat (-1, ".", TRUE, &ret->old_cwd_fd, &error); 51 | g_assert_no_error (error); 52 | 53 | if (fchdir (ret->temp_dir.fd) != 0) 54 | g_error ("fchdir(): %s", ret->temp_dir.path, g_strerror (errno)); 55 | 56 | return ret; 57 | } 58 | 59 | void 60 | _glnx_test_auto_temp_dir_leave (_GLnxTestAutoTempDir *dir) 61 | { 62 | GError *error = NULL; 63 | 64 | if (fchdir (dir->old_cwd_fd) != 0) 65 | g_error ("fchdir(): %s", dir->old_cwd, g_strerror (errno)); 66 | 67 | glnx_tmpdir_delete (&dir->temp_dir, NULL, &error); 68 | g_assert_no_error (error); 69 | 70 | g_close (dir->old_cwd_fd, &error); 71 | g_assert_no_error (error); 72 | 73 | g_free (dir->old_cwd); 74 | g_free (dir); 75 | } 76 | -------------------------------------------------------------------------------- /subprojects/libglnx/tests/libglnx-testlib.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright (C) 2017 Red Hat, Inc. 4 | * Copyright 2019 Collabora Ltd. 5 | * SPDX-License-Identifier: LGPL-2.0-or-later 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | #include "glnx-backport-autoptr.h" 28 | 29 | typedef GError _GLnxTestAutoError; 30 | static inline void 31 | _glnx_test_auto_error_cleanup (_GLnxTestAutoError *autoerror) 32 | { 33 | g_assert_no_error (autoerror); 34 | /* We could add a clear call here, but no point...we'll have aborted */ 35 | } 36 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(_GLnxTestAutoError, _glnx_test_auto_error_cleanup); 37 | 38 | #define _GLNX_TEST_DECLARE_ERROR(local_error, error) \ 39 | g_autoptr(_GLnxTestAutoError) local_error = NULL; \ 40 | GError **error = &local_error 41 | 42 | typedef struct _GLnxTestAutoTempDir _GLnxTestAutoTempDir; 43 | 44 | _GLnxTestAutoTempDir *_glnx_test_auto_temp_dir_enter (void); 45 | void _glnx_test_auto_temp_dir_leave (_GLnxTestAutoTempDir *dir); 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(_GLnxTestAutoTempDir, _glnx_test_auto_temp_dir_leave); 47 | 48 | #define _GLNX_TEST_SCOPED_TEMP_DIR \ 49 | G_GNUC_UNUSED g_autoptr(_GLnxTestAutoTempDir) temp_dir = _glnx_test_auto_temp_dir_enter () 50 | -------------------------------------------------------------------------------- /subprojects/libglnx/tests/test-libglnx-shutil.c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- 2 | * 3 | * Copyright © 2017 Endless OS Foundation LLC 4 | * SPDX-License-Identifier: LGPL-2.0-or-later 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #include "libglnx-config.h" 23 | #include "libglnx.h" 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "libglnx-testlib.h" 31 | 32 | static void 33 | test_mkdir_p_enoent (void) 34 | { 35 | _GLNX_TEST_DECLARE_ERROR(local_error, error); 36 | glnx_autofd int dfd = -1; 37 | 38 | if (!glnx_ensure_dir (AT_FDCWD, "test", 0755, error)) 39 | return; 40 | if (!glnx_opendirat (AT_FDCWD, "test", FALSE, &dfd, error)) 41 | return; 42 | if (rmdir ("test") < 0) 43 | return (void) glnx_throw_errno_prefix (error, "rmdir(%s)", "test"); 44 | 45 | /* This should fail with ENOENT. */ 46 | glnx_shutil_mkdir_p_at (dfd, "blah/baz", 0755, NULL, error); 47 | g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND); 48 | g_clear_error (&local_error); 49 | } 50 | 51 | int 52 | main (int argc, 53 | char **argv) 54 | { 55 | int ret; 56 | 57 | g_test_init (&argc, &argv, NULL); 58 | 59 | g_test_add_func ("/mkdir-p/enoent", test_mkdir_p_enoent); 60 | 61 | ret = g_test_run(); 62 | 63 | return ret; 64 | } 65 | -------------------------------------------------------------------------------- /system-helper/Makefile.am.inc: -------------------------------------------------------------------------------- 1 | if BUILD_SYSTEM_HELPER 2 | 3 | libexec_PROGRAMS += \ 4 | flatpak-system-helper \ 5 | $(NULL) 6 | 7 | dbussystemservicedir = $(datadir)/dbus-1/system-services 8 | service_in_files += system-helper/org.freedesktop.Flatpak.SystemHelper.service.in 9 | dbussystemservice_DATA = system-helper/org.freedesktop.Flatpak.SystemHelper.service 10 | 11 | dbusconfdir = $(DBUS_CONFIG_DIR) 12 | dist_dbusconf_DATA = system-helper/org.freedesktop.Flatpak.SystemHelper.conf 13 | 14 | service_in_files += system-helper/flatpak-system-helper.service.in 15 | systemdsystemunit_DATA += system-helper/flatpak-system-helper.service 16 | 17 | flatpak_system_helper_SOURCES = \ 18 | system-helper/flatpak-system-helper.c \ 19 | system-helper/flatpak-system-helper.h \ 20 | $(NULL) 21 | 22 | flatpak_system_helper_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(POLKIT_LIBS) libflatpak-common.la libflatpak-common-base.la libglnx.la 23 | flatpak_system_helper_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(APPSTREAM_CFLAGS) $(SOUP_CFLAGS) $(JSON_CFLAGS) $(POLKIT_CFLAGS) -DFLATPAK_COMPILATION -DLIBEXECDIR=\"$(libexecdir)\" 24 | 25 | system-helper/org.freedesktop.Flatpak.rules: system-helper/org.freedesktop.Flatpak.rules.in 26 | $(AM_V_GEN) $(SED) -e "s|\@privileged_group\@|$(PRIVILEGED_GROUP)|" $< > $@ 27 | 28 | polkit_rulesdir = $(datadir)/polkit-1/rules.d 29 | polkit_rules_DATA = \ 30 | system-helper/org.freedesktop.Flatpak.rules 31 | 32 | polkit_policydir = $(datadir)/polkit-1/actions 33 | polkit_policy_DATA = \ 34 | system-helper/org.freedesktop.Flatpak.policy 35 | 36 | %.policy: %.policy.in 37 | $(AM_V_GEN) $(MSGFMT) --xml -d $(top_srcdir)/po --template $< -o $@ || cp $< $@ 38 | 39 | sysusers_DATA = system-helper/flatpak.conf 40 | 41 | %.conf: %.conf.in 42 | $(AM_V_GEN) $(SED) \ 43 | -e "s|\@SYSTEM_HELPER_USER\@|$(SYSTEM_HELPER_USER)|" \ 44 | $< > $@ 45 | 46 | DISTCLEANFILES += system-helper/org.freedesktop.Flatpak.policy system-helper/org.freedesktop.Flatpak.rules system-helper/flatpak-system-helper.service system-helper/org.freedesktop.Flatpak.SystemHelper.service system-helper/flatpak.conf 47 | 48 | endif 49 | 50 | EXTRA_DIST += system-helper/org.freedesktop.Flatpak.policy.in system-helper/org.freedesktop.Flatpak.SystemHelper.conf system-helper/org.freedesktop.Flatpak.rules.in system-helper/org.freedesktop.Flatpak.SystemHelper.service.in system-helper/flatpak-system-helper.service.in system-helper/flatpak.conf.in 51 | -------------------------------------------------------------------------------- /system-helper/flatpak-system-helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2021 Collabora Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef __FLATPAK_SYSTEM_HELPER_H__ 19 | #define __FLATPAK_SYSTEM_HELPER_H__ 20 | 21 | #define FLATPAK_SYSTEM_HELPER_BUS_NAME "org.freedesktop.Flatpak.SystemHelper" 22 | #define FLATPAK_SYSTEM_HELPER_PATH "/org/freedesktop/Flatpak/SystemHelper" 23 | #define FLATPAK_SYSTEM_HELPER_INTERFACE FLATPAK_SYSTEM_HELPER_BUS_NAME 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /system-helper/flatpak-system-helper.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=flatpak system helper 3 | 4 | [Service] 5 | BusName=org.freedesktop.Flatpak.SystemHelper 6 | Environment=XDG_DATA_DIRS=@localstatedir@/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/ 7 | ExecStart=@libexecdir@/flatpak-system-helper 8 | Type=dbus 9 | IOSchedulingClass=idle 10 | -------------------------------------------------------------------------------- /system-helper/flatpak.conf.in: -------------------------------------------------------------------------------- 1 | u @SYSTEM_HELPER_USER@ - "Flatpak system helper" - 2 | -------------------------------------------------------------------------------- /system-helper/org.freedesktop.Flatpak.SystemHelper.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 21 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /system-helper/org.freedesktop.Flatpak.SystemHelper.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.freedesktop.Flatpak.SystemHelper 3 | Exec=@libexecdir@/flatpak-system-helper@extraargs@ 4 | SystemdService=flatpak-system-helper.service 5 | User=root 6 | -------------------------------------------------------------------------------- /system-helper/org.freedesktop.Flatpak.rules.in: -------------------------------------------------------------------------------- 1 | polkit.addRule(function(action, subject) { 2 | if ((action.id == "org.freedesktop.Flatpak.app-install" || 3 | action.id == "org.freedesktop.Flatpak.runtime-install"|| 4 | action.id == "org.freedesktop.Flatpak.app-uninstall" || 5 | action.id == "org.freedesktop.Flatpak.runtime-uninstall" || 6 | action.id == "org.freedesktop.Flatpak.modify-repo") && 7 | subject.active == true && subject.local == true && 8 | subject.isInGroup("@privileged_group@")) { 9 | return polkit.Result.YES; 10 | } 11 | 12 | return polkit.Result.NOT_HANDLED; 13 | }); 14 | 15 | polkit.addRule(function(action, subject) { 16 | if (action.id == "org.freedesktop.Flatpak.override-parental-controls") { 17 | return polkit.Result.AUTH_ADMIN; 18 | } 19 | 20 | return polkit.Result.NOT_HANDLED; 21 | }); 22 | -------------------------------------------------------------------------------- /tests/Makefile-test-matrix.am.inc: -------------------------------------------------------------------------------- 1 | # This file is autogenerated by ./tests/update-test-matrix, don't edit 2 | TEST_MATRIX= \ 3 | tests/test-run@user,nodeltas.wrap \ 4 | tests/test-run@user,deltas.wrap \ 5 | tests/test-run@system,nodeltas.wrap \ 6 | tests/test-run@system,deltas.wrap \ 7 | tests/test-run@system-norevokefs,nodeltas.wrap \ 8 | tests/test-run@system-norevokefs,deltas.wrap \ 9 | tests/test-info@user.wrap \ 10 | tests/test-info@system.wrap \ 11 | tests/test-repo@user.wrap \ 12 | tests/test-repo@system.wrap \ 13 | tests/test-repo@system-norevokefs.wrap \ 14 | tests/test-repo@user,oldsummary.wrap \ 15 | tests/test-repo@system,oldsummary.wrap \ 16 | tests/test-sideload@user.wrap \ 17 | tests/test-sideload@system.wrap \ 18 | tests/test-bundle@user.wrap \ 19 | tests/test-bundle@system.wrap \ 20 | tests/test-bundle@system-norevokefs.wrap \ 21 | tests/test-oci-registry@user.wrap \ 22 | tests/test-oci-registry@system.wrap \ 23 | tests/test-update-remote-configuration@newsummary.wrap \ 24 | tests/test-update-remote-configuration@oldsummary.wrap \ 25 | tests/test-update-portal@user.wrap \ 26 | tests/test-update-portal@system.wrap \ 27 | tests/test-summaries@user.wrap \ 28 | tests/test-summaries@system.wrap \ 29 | tests/test-subset@user.wrap \ 30 | tests/test-subset@system.wrap \ 31 | $(NULL) 32 | TEST_MATRIX_DIST= \ 33 | tests/test-basic.sh \ 34 | tests/test-completion.sh \ 35 | tests/test-config.sh \ 36 | tests/test-build-update-repo.sh \ 37 | tests/test-http-utils.sh \ 38 | tests/test-history.sh \ 39 | tests/test-default-remotes.sh \ 40 | tests/test-metadata-validation.sh \ 41 | tests/test-extensions.sh \ 42 | tests/test-oci.sh \ 43 | tests/test-override.sh \ 44 | tests/test-auth.sh \ 45 | tests/test-unused.sh \ 46 | tests/test-prune.sh \ 47 | tests/test-seccomp.sh \ 48 | tests/test-repair.sh \ 49 | $(NULL) 50 | TEST_MATRIX_EXTRA_DIST= \ 51 | tests/test-run.sh \ 52 | tests/test-info.sh \ 53 | tests/test-repo.sh \ 54 | tests/test-sideload.sh \ 55 | tests/test-bundle.sh \ 56 | tests/test-oci-registry.sh \ 57 | tests/test-update-remote-configuration.sh \ 58 | tests/test-update-portal.sh \ 59 | tests/test-summaries.sh \ 60 | tests/test-subset.sh \ 61 | $(NULL) 62 | -------------------------------------------------------------------------------- /tests/can-use-fuse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2021 Collabora Ltd. 3 | * SPDX-License-Identifier: LGPL-2.1-or-later 4 | */ 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | extern gchar *cannot_use_fuse; 11 | gboolean check_fuse (void); 12 | gboolean check_fuse_or_skip_test (void); 13 | -------------------------------------------------------------------------------- /tests/httpcache.c: -------------------------------------------------------------------------------- 1 | #include "common/flatpak-utils-private.h" 2 | 3 | int 4 | main (int argc, char *argv[]) 5 | { 6 | g_autoptr(FlatpakHttpSession) session = flatpak_create_http_session (PACKAGE_STRING); 7 | GError *error = NULL; 8 | const char *url, *dest; 9 | int flags = 0; 10 | 11 | /* Avoid weird recursive type initialization deadlocks from libsoup */ 12 | g_type_ensure (G_TYPE_SOCKET); 13 | 14 | if (argc == 3) 15 | { 16 | url = argv[1]; 17 | dest = argv[2]; 18 | } 19 | else if (argc == 4 && g_strcmp0 (argv[1], "--compressed") == 0) 20 | { 21 | url = argv[2]; 22 | dest = argv[3]; 23 | flags |= FLATPAK_HTTP_FLAGS_STORE_COMPRESSED; 24 | } 25 | else 26 | { 27 | g_printerr ("Usage httpcache [--compressed] URL DEST\n"); 28 | return 1; 29 | } 30 | 31 | 32 | if (!flatpak_cache_http_uri (session, 33 | url, 34 | flags, 35 | AT_FDCWD, dest, 36 | NULL, NULL, NULL, &error)) 37 | { 38 | g_print ("%s\n", error->message); 39 | return 1; 40 | } 41 | else 42 | { 43 | g_print ("Server returned status 200: ok\n"); 44 | return 0; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/libpreload.c: -------------------------------------------------------------------------------- 1 | /* vi:set et sw=2 sts=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e-s: 2 | * Copyright 2021 Collabora Ltd. 3 | * SPDX-License-Identifier: LGPL-2-or-later 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | __attribute__((constructor)) static void 13 | ctor (void) 14 | { 15 | pid_t me = getpid (); 16 | struct stat buf; 17 | 18 | fprintf (stderr, "LD_PRELOAD module got loaded by process %d\n", me); 19 | 20 | if (stat ("/.flatpak-info", &buf) == 0) 21 | { 22 | fprintf (stderr, "OK: pid %d is in a Flatpak sandbox\n", me); 23 | } 24 | else 25 | { 26 | /* If the --env=LD_PRELOAD had come from a call to flatpak-portal, 27 | * then this would be a sandbox escape (GHSA-4ppf-fxf6-vxg2). */ 28 | fprintf (stderr, "Error: pid %d is not in a Flatpak sandbox\n", me); 29 | abort (); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/list-unused.c: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | #include "flatpak-dir-private.h" 4 | 5 | static char **opt_exclude_refs; 6 | static gboolean opt_user; 7 | 8 | static GOptionEntry options[] = { 9 | { "user", 0, 0, G_OPTION_ARG_NONE, &opt_user, "Work on the user installation", NULL }, 10 | { "exclude", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_exclude_refs, "Exclude ref", "REF" }, 11 | { NULL } 12 | }; 13 | 14 | 15 | int 16 | main (int argc, char *argv[]) 17 | { 18 | g_autoptr(FlatpakDir) dir = NULL; 19 | g_autoptr(GError) error = NULL; 20 | g_auto(GStrv) refs = NULL; 21 | g_autoptr(GOptionContext) context = NULL; 22 | int i; 23 | 24 | context = g_option_context_new (""); 25 | 26 | g_option_context_add_main_entries (context, options, NULL); 27 | if (!g_option_context_parse (context, &argc, &argv, &error)) 28 | { 29 | g_print("Arg error: %s\n", error->message); 30 | return 1; 31 | } 32 | 33 | if (opt_user) 34 | dir = flatpak_dir_get_user (); 35 | else 36 | dir = flatpak_dir_get_system_default (); 37 | 38 | refs = flatpak_dir_list_unused_refs (dir, NULL, NULL, NULL, (const char * const *)opt_exclude_refs, FALSE, NULL, &error); 39 | g_assert_nonnull (refs); 40 | g_assert_no_error (error); 41 | 42 | for (i = 0; refs[i] != NULL; i++) 43 | g_print ("%s\n", refs[i]); 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /tests/make-multi-collection-id-repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # make-multi-collection-id-repo.sh: Creates an ostree repository 4 | # that will hold a different collection ID per ref. 5 | # 6 | # Copyright (C) 2017 Endless, Inc. 7 | # 8 | # Authors: 9 | # Joaquim Rocha 10 | # 11 | # This library is free software; you can redistribute it and/or 12 | # modify it under the terms of the GNU Lesser General Public 13 | # License as published by the Free Software Foundation; either 14 | # version 2 of the License, or (at your option) any later version. 15 | # 16 | # This library is distributed in the hope that it will be useful, 17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | # Lesser General Public License for more details. 20 | # 21 | # You should have received a copy of the GNU Lesser General Public 22 | # License along with this library; if not, write to the 23 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24 | # Boston, MA 02111-1307, USA. 25 | 26 | set -e 27 | 28 | . $(dirname $0)/libtest.sh 29 | 30 | REPO_DIR=$1 31 | REPO_NAME=$(basename $REPO_DIR) 32 | 33 | COLLECTION_ID_PREFIX=org.test.Collection 34 | 35 | ostree --repo=${REPO_DIR} init --mode=archive --collection-id=${COLLECTION_ID_PREFIX}1 >&2 36 | 37 | for i in {1..3}; do 38 | APP_REPO=test${i} 39 | APP_REPO_DIR=`pwd`/repos/${APP_REPO} 40 | APP_ID=org.test.Hello${i} 41 | COLLECTION_ID=${COLLECTION_ID_PREFIX}${i} 42 | 43 | $(dirname $0)/make-test-app.sh repos/${APP_REPO} ${APP_ID} master ${COLLECTION_ID} 44 | ref=$(ostree --repo=${APP_REPO_DIR} refs | grep ${APP_ID}) 45 | 46 | ostree --repo=${REPO_DIR} remote add --no-gpg-verify --collection-id=${COLLECTION_ID} ${APP_REPO} file://${APP_REPO_DIR} >&2 47 | ostree --repo=${REPO_DIR} pull ${APP_REPO} ${ref} >&2 48 | done 49 | 50 | ostree --repo=${REPO_DIR} summary --update >&2 51 | -------------------------------------------------------------------------------- /tests/make-runtime-repos: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2018-2020 Red Hat Inc. 3 | # Copyright 2018-2019 Matthew Leeds 4 | # Copyright 2022 Collabora Ltd. 5 | 6 | set -eu 7 | 8 | flatpak_dir="$1" 9 | make_test_runtime="$2" 10 | target="$3" 11 | stamp="$4" 12 | 13 | export PATH="$flatpak_dir:$PATH" 14 | 15 | rm -fr "$target" 16 | "$make_test_runtime" "$target" org.test.Platform master "" "" 17 | "$make_test_runtime" "$target" org.test.Platform stable "" "" 18 | touch "$stamp" 19 | -------------------------------------------------------------------------------- /tests/make-test-runtime.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Don't inherit the -x from the testsuite 6 | set +x 7 | 8 | DIR=`mktemp -d` 9 | 10 | REPO=$1 11 | shift 12 | ID=$1 13 | shift 14 | BRANCH=$1 15 | shift 16 | COLLECTION_ID=$1 17 | shift 18 | 19 | EXTRA="${1-}" 20 | shift 21 | 22 | mkdir ${DIR}/files 23 | mkdir ${DIR}/usr 24 | cat > ${DIR}/metadata < /dev/null; then 52 | echo "${f} not found" 53 | exit 1 54 | fi 55 | 56 | if grep -qFe "${f}" $BINS; then 57 | # Already handled 58 | return 0 59 | fi 60 | 61 | echo $f >> $BINS 62 | 63 | # Add library dependencies 64 | (ldd "${f}" | sed "s/.* => //" | awk '{ print $1}' | grep ^/ | sort -u -o $LIBS $LIBS -) || true 65 | 66 | local shebang=$(sed -n '1s/^#!\([^ ]*\).*/\1/p' "${f}") 67 | if [ x$shebang != x ]; then 68 | add_bin "$shebang" 69 | fi 70 | } 71 | 72 | for i in $@ bash ls cat echo readlink socat; do 73 | I=$(type -P "$i") 74 | add_bin "$I" 75 | done 76 | for i in `cat $BINS`; do 77 | #echo Adding binary $i 1>&2 78 | cp "$i" ${DIR}/usr/bin/ 79 | done 80 | for i in `cat $LIBS`; do 81 | #echo Adding library $i 1>&2 82 | cp "$i" ${DIR}/usr/lib/ 83 | done 84 | ln -s bash ${DIR}/usr/bin/sh 85 | 86 | # This only exists so we can update the runtime 87 | cat > ${DIR}/usr/bin/runtime_hello.sh <&2 107 | rm -rf ${DIR} 108 | -------------------------------------------------------------------------------- /tests/mock-flatpak.c: -------------------------------------------------------------------------------- 1 | /* vi:set et sw=2 sts=2 cin cino=t0,f0,(0,{s,>2s,n-s,^-s,e-s: 2 | * Copyright © 2018-2021 Collabora Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "libglnx.h" 23 | 24 | #include 25 | #include 26 | 27 | #include "flatpak-context-private.h" 28 | 29 | int 30 | main (int argc, 31 | char **argv) 32 | { 33 | int i; 34 | 35 | g_debug ("This is a mock implementation of `flatpak run` for the portal"); 36 | 37 | for (i = 0; i < argc; i++) 38 | g_print ("argv[%d] = %s\n", i, argv[i]); 39 | 40 | for (i = 0; i < argc; i++) 41 | { 42 | if (g_str_has_prefix (argv[i], "--env-fd=")) 43 | { 44 | g_autoptr(FlatpakContext) context = flatpak_context_new (); 45 | const char *value = argv[i] + strlen ("--env-fd="); 46 | g_autoptr(GError) error = NULL; 47 | guint64 fd; 48 | gchar *endptr; 49 | GHashTableIter iter; 50 | gpointer k, v; 51 | 52 | fd = g_ascii_strtoull (value, &endptr, 10); 53 | 54 | if (endptr == NULL || *endptr != '\0' || fd > G_MAXINT) 55 | g_error ("Not a valid file descriptor: %s", value); 56 | 57 | flatpak_context_parse_env_fd (context, (int) fd, &error); 58 | g_assert_no_error (error); 59 | 60 | g_hash_table_iter_init (&iter, context->env_vars); 61 | 62 | while (g_hash_table_iter_next (&iter, &k, &v)) 63 | g_print ("env[%s] = %s\n", (const char *) k, (const char *) v); 64 | } 65 | } 66 | 67 | for (i = 0; i < 256; i++) 68 | { 69 | struct stat stat_buf; 70 | 71 | if (fstat (i, &stat_buf) < 0) 72 | { 73 | int saved_errno = errno; 74 | 75 | g_assert_cmpint (saved_errno, ==, EBADF); 76 | } 77 | else 78 | { 79 | g_print ("fd[%d] = (dev=%" G_GUINT64_FORMAT " ino=%" G_GUINT64_FORMAT ")\n", 80 | i, 81 | (guint64) stat_buf.st_dev, 82 | (guint64) stat_buf.st_ino); 83 | } 84 | } 85 | 86 | return 0; 87 | } 88 | -------------------------------------------------------------------------------- /tests/oci-registry-client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | 5 | if sys.version_info[0] >= 3: 6 | import http.client as http_client 7 | import urllib.parse as urllib_parse 8 | else: 9 | import http.client as http_client 10 | import urllib as urllib_parse 11 | 12 | if sys.argv[2] == 'add': 13 | detach_icons = '--detach-icons' in sys.argv 14 | if detach_icons: 15 | sys.argv.remove('--detach-icons') 16 | params = {'d': sys.argv[5]} 17 | if detach_icons: 18 | params['detach-icons'] = 1 19 | query = urllib_parse.urlencode(params) 20 | conn = http_client.HTTPConnection(sys.argv[1]) 21 | path = "/testing/{repo}/{tag}?{query}".format(repo=sys.argv[3], 22 | tag=sys.argv[4], 23 | query=query) 24 | conn.request("POST", path) 25 | response = conn.getresponse() 26 | if response.status != 200: 27 | print(response.read(), file=sys.stderr) 28 | print("Failed: status={}".format(response.status), file=sys.stderr) 29 | sys.exit(1) 30 | elif sys.argv[2] == 'delete': 31 | conn = http_client.HTTPConnection(sys.argv[1]) 32 | path = "/testing/{repo}/{ref}".format(repo=sys.argv[3], 33 | ref=sys.argv[4]) 34 | conn.request("DELETE", path) 35 | response = conn.getresponse() 36 | if response.status != 200: 37 | print(response.read(), file=sys.stderr) 38 | print("Failed: status={}".format(response.status), file=sys.stderr) 39 | sys.exit(1) 40 | else: 41 | print("Usage: oci-registry-client.py [add|remove] ARGS", file=sys.stderr) 42 | sys.exit(1) 43 | 44 | -------------------------------------------------------------------------------- /tests/org.flatpak.Authenticator.test.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.flatpak.Authenticator.test 3 | Exec=@libexecdir@/test-authenticator 4 | -------------------------------------------------------------------------------- /tests/org.freedesktop.impl.portal.desktop.test.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.freedesktop.impl.portal.desktop.test 3 | Exec=@libexecdir@/test-portal-impl 4 | -------------------------------------------------------------------------------- /tests/org.test.Hello.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/tests/org.test.Hello.png -------------------------------------------------------------------------------- /tests/package_version.txt: -------------------------------------------------------------------------------- 1 | 1.14.10 2 | -------------------------------------------------------------------------------- /tests/session.conf.in: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | session 6 | 7 | 9 | 10 | 11 | unix:tmpdir=/tmp 12 | 13 | @testdir@/services 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | contexts/dbus_contexts 30 | 31 | 38 | 39 | 40 | 1000000000 41 | 250000000 42 | 1000000000 43 | 250000000 44 | 1000000000 45 | 4096 46 | 120000 47 | 240000 48 | 100000 49 | 10000 50 | 100000 51 | 10000 52 | 50000 53 | 50000 54 | 50000 55 | 56 | 57 | -------------------------------------------------------------------------------- /tests/test-build-update-repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright © 2018 Endless Mobile, Inc. 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the 17 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | # Boston, MA 02111-1307, USA. 19 | # 20 | # Authors: 21 | # - Philip Withnall 22 | 23 | set -euo pipefail 24 | 25 | . $(dirname $0)/libtest.sh 26 | 27 | skip_without_bwrap 28 | skip_revokefs_without_fuse 29 | 30 | echo "1..5" 31 | 32 | # Configure a repository, then set a collection ID on it and check that the ID 33 | # is saved in the config file. 34 | setup_repo 35 | install_repo 36 | 37 | ${FLATPAK} build-update-repo --collection-id=org.test.Collection repos/test >&2 38 | 39 | assert_file_has_content repos/test/config '^collection-id=org\.test\.Collection$' 40 | 41 | ok "1 update repo to add collection ID" 42 | 43 | # Test that you’re not allowed to change the collection ID once it’s already set. 44 | if ${FLATPAK} build-update-repo --collection-id=org.test.Collection2 repos/test &> build-update-repo-error-log; then 45 | assert_not_reached "flatpak build-update-repo should not set a collection ID when one is already set" 46 | fi 47 | 48 | assert_file_has_content repos/test/config '^collection-id=org\.test\.Collection$' 49 | assert_not_file_has_content repos/test/config '^collection-id=org\.test\.Collection2$' 50 | 51 | ok "2 collection ID cannot be changed" 52 | 53 | ${FLATPAK} build-update-repo --title="My little repo" repos/test >&2 54 | 55 | assert_file_has_content repos/test/config '^title=My little repo$' 56 | 57 | ok "can update repo title" 58 | 59 | ${FLATPAK} build-update-repo --redirect-url=http://no.where/ repos/test >&2 60 | 61 | assert_file_has_content repos/test/config '^redirect-url=http://no\.where/$' 62 | 63 | ok "can update redirect url" 64 | 65 | ${FLATPAK} build-update-repo --default-branch=no-such-branch repos/test >&2 66 | 67 | assert_file_has_content repos/test/config '^default-branch=no-such-branch$' 68 | 69 | ok "can update default branch" 70 | -------------------------------------------------------------------------------- /tests/test-config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2019 Matthias Clasen 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the 17 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | # Boston, MA 02111-1307, USA. 19 | 20 | set -euo pipefail 21 | 22 | . $(dirname $0)/libtest.sh 23 | 24 | # This test looks for specific localized strings. 25 | export LC_ALL=C 26 | 27 | echo "1..5" 28 | 29 | ${FLATPAK} config --list > list_out 30 | assert_file_has_content list_out "^languages:" 31 | 32 | ok "config list" 33 | 34 | ${FLATPAK} config --set languages "de;fr" 35 | ${FLATPAK} config --get languages > get_out 36 | assert_file_has_content get_out "^de;fr" 37 | 38 | ok "config set" 39 | 40 | ${FLATPAK} config --set languages "*" 41 | ${FLATPAK} config --get languages > get_out 42 | assert_file_has_content get_out "*" 43 | 44 | ok "config languages *" 45 | 46 | ${FLATPAK} config --set languages "all" 47 | ${FLATPAK} config --get languages > get_out 48 | assert_file_has_content get_out "all" 49 | 50 | ok "config languages *" 51 | 52 | ${FLATPAK} config --unset languages 53 | ${FLATPAK} config --get languages > get_out 54 | assert_file_has_content get_out "^[*]unset[*]" 55 | 56 | ok "config unset" 57 | -------------------------------------------------------------------------------- /tests/test-info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | . $(dirname $0)/libtest.sh 6 | 7 | skip_revokefs_without_fuse 8 | 9 | echo "1..9" 10 | 11 | INCLUDE_SPECIAL_CHARACTER=1 setup_repo 12 | install_repo 13 | 14 | COMMIT=`${FLATPAK} ${U} info --show-commit org.test.Hello` 15 | 16 | ${FLATPAK} info -rcos org.test.Hello > info 17 | 18 | assert_file_has_content info "^app/org\.test\.Hello/$(flatpak --default-arch)/master test-repo ${COMMIT}" 19 | 20 | ok "info -rcos" 21 | 22 | ${FLATPAK} info --show-metadata org.test.Hello > info 23 | 24 | # CVE-2023-28101 25 | assert_file_has_content info "name=org\.test\.Hello" 26 | assert_file_has_content info "^A=x\\\\x09y" 27 | 28 | ok "info --show-metadata" 29 | 30 | ${FLATPAK} info --show-permissions org.test.Hello > info 31 | 32 | assert_file_has_content info "^A=x\\\\x09y" 33 | 34 | ok "info --show-permissions" 35 | 36 | ${FLATPAK} info --show-location org.test.Hello > info 37 | 38 | assert_file_has_content info "app/org\.test\.Hello/$(flatpak --default-arch)/master/${COMMIT}" 39 | 40 | ok "info --show-location" 41 | 42 | ${FLATPAK} info --show-runtime org.test.Hello > info 43 | 44 | assert_file_has_content info "^org\.test\.Platform/$(flatpak --default-arch)/master$" 45 | 46 | ok "info --show-runtime" 47 | 48 | ${FLATPAK} info --show-sdk org.test.Hello > info 49 | 50 | assert_file_has_content info "^org\.test\.Platform/$(flatpak --default-arch)/master$" 51 | 52 | ok "info --show-sdk" 53 | 54 | ${FLATPAK} info --show-extensions org.test.Hello > info 55 | 56 | assert_file_has_content info "Extension: runtime/org\.test\.Hello\.Locale/$(flatpak --default-arch)/master$" 57 | 58 | ok "info --show-extensions" 59 | 60 | ${FLATPAK} info --file-access=home org.test.Hello > info 61 | 62 | assert_file_has_content info "^hidden$" 63 | 64 | ok "info --file-access" 65 | 66 | ${FLATPAK} info org.test.Hello > info 67 | 68 | assert_file_has_content info "^Hello world test app: org\.test\.Hello - Print a greeting$" 69 | 70 | ok "info (name header)" 71 | -------------------------------------------------------------------------------- /tests/test-keyring/README: -------------------------------------------------------------------------------- 1 | These are completely random keys, which include the secret key. 2 | Use these for testing gpg signing, do *NOT* ever use these for any 3 | real application. 4 | -------------------------------------------------------------------------------- /tests/test-keyring/pubring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/tests/test-keyring/pubring.gpg -------------------------------------------------------------------------------- /tests/test-keyring/secring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/tests/test-keyring/secring.gpg -------------------------------------------------------------------------------- /tests/test-keyring2/README: -------------------------------------------------------------------------------- 1 | These are completely random keys, which include the secret key. 2 | Use these for testing gpg signing, do *NOT* ever use these for any 3 | real application. 4 | -------------------------------------------------------------------------------- /tests/test-keyring2/pubring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/tests/test-keyring2/pubring.gpg -------------------------------------------------------------------------------- /tests/test-keyring2/secring.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/flatpak/ppa-flatpak/0a8f0c95d012679b6d89c799fe05ea0d1467cc04/tests/test-keyring2/secring.gpg -------------------------------------------------------------------------------- /tests/test-oci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2011 Colin Walters 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the 17 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | # Boston, MA 02111-1307, USA. 19 | 20 | set -euo pipefail 21 | 22 | . $(dirname $0)/libtest.sh 23 | 24 | skip_without_bwrap 25 | 26 | echo "1..2" 27 | 28 | setup_repo_no_add oci 29 | 30 | mkdir -p oci 31 | ${FLATPAK} build-bundle --oci $FL_GPGARGS repos/oci oci/image org.test.Hello >&2 32 | 33 | assert_has_file oci/image/oci-layout 34 | assert_has_dir oci/image/blobs/sha256 35 | assert_has_file oci/image/index.json 36 | 37 | for i in oci/image/blobs/sha256/*; do 38 | echo $(basename $i) $i >> sums 39 | done 40 | sha256sum -c sums >&2 41 | 42 | digest=$(grep sha256: oci/image/index.json | sed s'@.*sha256:\([a-fA-F0-9]\+\).*@\1@') 43 | manifest=oci/image/blobs/sha256/$digest 44 | 45 | assert_has_file $manifest 46 | 47 | DIGEST=$(grep -C2 application/vnd.oci.image.config.v1+json $manifest | grep digest | sed s/.*\"sha256:\\\(.*\\\)\".*/\\1/) 48 | echo DIGEST: $DIGEST >&2 49 | image=oci/image/blobs/sha256/$DIGEST 50 | 51 | assert_has_file $image 52 | assert_file_has_content $image "org\.freedesktop\.appstream\.appdata.*Print a greeting" 53 | assert_file_has_content $image "org\.freedesktop\.appstream\.icon-64" 54 | assert_file_has_content $image org.flatpak.ref.*app/"org.test.Hello/$ARCH/master" 55 | 56 | ok "export oci" 57 | 58 | ostree --repo=repo2 init --mode=archive-z2 >&2 59 | 60 | $FLATPAK build-import-bundle --oci repo2 oci/image >&2 61 | 62 | ostree checkout -U --repo=repo2 app/org.test.Hello/$ARCH/master checked-out >&2 63 | 64 | assert_has_dir checked-out/files 65 | assert_has_file checked-out/files/bin/hello.sh 66 | assert_has_file checked-out/metadata 67 | 68 | ok "import oci" 69 | -------------------------------------------------------------------------------- /tests/test-repair.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2021 Matthew Leeds 4 | # 5 | # SPDX-License-Identifier: LGPL-2.0-or-later 6 | 7 | set -euo pipefail 8 | 9 | . $(dirname $0)/libtest.sh 10 | 11 | echo "1..1" 12 | 13 | setup_repo 14 | ${FLATPAK} ${U} install -y test-repo org.test.Hello >&2 15 | 16 | # delete the object for files/bin/hello.sh 17 | rm ${FL_DIR}/repo/objects/0d/30582c0ac8a2f89f23c0f62e548ba7853f5285d21848dd503460a567b5d253.file 18 | 19 | # dry run repair shouldn't replace the missing file 20 | ${FLATPAK} ${U} repair --dry-run >&2 21 | assert_not_has_file ${FL_DIR}/repo/objects/0d/30582c0ac8a2f89f23c0f62e548ba7853f5285d21848dd503460a567b5d253.file 22 | 23 | # normal repair should replace the missing file 24 | ${FLATPAK} ${U} repair >&2 25 | assert_has_file ${FL_DIR}/repo/objects/0d/30582c0ac8a2f89f23c0f62e548ba7853f5285d21848dd503460a567b5d253.file 26 | 27 | # app should've been reinstalled 28 | ${FLATPAK} ${U} list -d > list-log 29 | assert_file_has_content list-log "org\.test\.Hello/" 30 | 31 | # clean up 32 | ${FLATPAK} ${U} uninstall -y org.test.Platform org.test.Hello >&2 33 | ${FLATPAK} ${U} remote-delete test-repo >&2 34 | 35 | ok "repair command handles missing files" 36 | -------------------------------------------------------------------------------- /tests/test-webserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | dir=$1 6 | 7 | rm -f httpd-pipe 8 | mkfifo httpd-pipe 9 | $(dirname $0)/web-server.py "$dir" 3> httpd-pipe & 10 | read < httpd-pipe 11 | -------------------------------------------------------------------------------- /tests/test-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for feature in $(echo $1 | sed "s/^.*@\(.*\).wrap/\1/" | tr "," "\n"); do 4 | case $feature in 5 | system) 6 | export USE_SYSTEMDIR=yes 7 | ;; 8 | system-norevokefs) 9 | export USE_SYSTEMDIR=yes 10 | export FLATPAK_DISABLE_REVOKEFS=yes 11 | ;; 12 | user) 13 | export USE_SYSTEMDIR=no 14 | ;; 15 | deltas) 16 | export USE_DELTAS=yes 17 | ;; 18 | newsummary) 19 | export SUMMARY_FORMAT=new 20 | ;; 21 | oldsummary) 22 | export SUMMARY_FORMAT=old 23 | ;; 24 | nodeltas) 25 | export USE_DELTAS=no 26 | ;; 27 | labels) 28 | export USE_OCI_LABELS=yes 29 | ;; 30 | annotations) 31 | export USE_OCI_ANNOTATIONS=yes 32 | ;; 33 | *) 34 | echo unsupported test feature $feature 35 | exit 1 36 | esac 37 | done 38 | 39 | WRAPPED=$(echo $1 | sed "s/@.*/\.sh/") 40 | . $WRAPPED "$@" 41 | -------------------------------------------------------------------------------- /tests/test.filter: -------------------------------------------------------------------------------- 1 | deny * 2 | allow org.test.Platform 3 | -------------------------------------------------------------------------------- /tests/test.portal.in: -------------------------------------------------------------------------------- 1 | [portal] 2 | DBusName=org.freedesktop.impl.portal.desktop.test 3 | Interfaces=org.freedesktop.impl.portal.Access 4 | UseIn=test 5 | -------------------------------------------------------------------------------- /tests/testlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018-2021 Collabora Ltd. 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library. If not, see . 16 | */ 17 | 18 | #ifndef TESTLIB_H 19 | #define TESTLIB_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #ifndef g_assert_no_errno 26 | #define g_assert_no_errno(expr) \ 27 | g_assert_cmpstr ((expr) >= 0 ? NULL : g_strerror (errno), ==, NULL) 28 | #endif 29 | 30 | char *assert_mkdtemp (char *tmpl); 31 | 32 | extern char *isolated_test_dir; 33 | void isolated_test_dir_global_setup (void); 34 | void isolated_test_dir_global_teardown (void); 35 | 36 | typedef struct 37 | { 38 | GSubprocess *dbus_daemon; 39 | gchar *dbus_address; 40 | gchar *temp_dir; 41 | } TestsDBusDaemon; 42 | 43 | void tests_dbus_daemon_setup (TestsDBusDaemon *self); 44 | void tests_dbus_daemon_teardown (TestsDBusDaemon *self); 45 | 46 | typedef struct _TestsStdoutToStderr TestsStdoutToStderr; 47 | TestsStdoutToStderr *tests_stdout_to_stderr_begin (void); 48 | void tests_stdout_to_stderr_end (TestsStdoutToStderr *original); 49 | G_DEFINE_AUTOPTR_CLEANUP_FUNC (TestsStdoutToStderr, tests_stdout_to_stderr_end); 50 | 51 | #define TESTS_SCOPED_STDOUT_TO_STDERR \ 52 | G_GNUC_UNUSED g_autoptr(TestsStdoutToStderr) _tests_stdout_to_stderr = tests_stdout_to_stderr_begin () 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /tests/update-test-matrix: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 Red Hat, Inc. 3 | # Copyright 2021-2022 Collabora Ltd. 4 | # SPDX-License-Identifier: LGPL-2.1-or-later 5 | 6 | set -eu 7 | 8 | tests_srcdir="$(dirname "$(realpath "$0")")" 9 | 10 | TEST_MATRIX_SOURCE=( 11 | 'tests/test-basic.sh' \ 12 | 'tests/test-completion.sh' \ 13 | 'tests/test-config.sh' \ 14 | 'tests/test-build-update-repo.sh' \ 15 | 'tests/test-http-utils.sh' \ 16 | 'tests/test-run.sh{{user+system+system-norevokefs},{nodeltas+deltas}}' \ 17 | 'tests/test-info.sh{user+system}' \ 18 | 'tests/test-repo.sh{{user+system+system-norevokefs}+{{user+system},oldsummary}}' \ 19 | 'tests/test-history.sh' \ 20 | 'tests/test-sideload.sh{user+system}' \ 21 | 'tests/test-default-remotes.sh' \ 22 | 'tests/test-metadata-validation.sh' \ 23 | 'tests/test-extensions.sh' \ 24 | 'tests/test-bundle.sh{user+system+system-norevokefs}' \ 25 | 'tests/test-oci.sh' \ 26 | 'tests/test-oci-registry.sh{user+system}' \ 27 | 'tests/test-update-remote-configuration.sh{newsummary+oldsummary}' \ 28 | 'tests/test-override.sh' \ 29 | 'tests/test-update-portal.sh{user+system}' \ 30 | 'tests/test-auth.sh' \ 31 | 'tests/test-unused.sh' \ 32 | 'tests/test-summaries.sh{user+system}' \ 33 | 'tests/test-subset.sh{user+system}' \ 34 | 'tests/test-prune.sh' \ 35 | 'tests/test-seccomp.sh' \ 36 | 'tests/test-repair.sh' \ 37 | ) 38 | 39 | "${tests_srcdir}/expand-test-matrix.sh" --automake "${TEST_MATRIX_SOURCE[*]}" > "${tests_srcdir}/Makefile-test-matrix.am.inc" 40 | -------------------------------------------------------------------------------- /tests/web-server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | from wsgiref.handlers import format_date_time 4 | from email.utils import parsedate 5 | from calendar import timegm 6 | import gzip 7 | import sys 8 | import time 9 | import zlib 10 | import os 11 | from http import HTTPStatus 12 | from urllib.parse import parse_qs 13 | import http.server as http_server 14 | from io import BytesIO 15 | import sys 16 | 17 | class RequestHandler(http_server.SimpleHTTPRequestHandler): 18 | def handle_tokens(self): 19 | need_token_path = self.translate_path(self.path) + ".need_token" 20 | if os.path.isfile(need_token_path): 21 | with open(need_token_path, 'r') as content_file: 22 | token_content = content_file.read() 23 | token = None 24 | auth = self.headers.get("Authorization") 25 | if auth and auth.startswith("Bearer "): 26 | token = auth[7:] 27 | if token == None: 28 | self.send_response(HTTPStatus.UNAUTHORIZED, "No token") 29 | self.end_headers() 30 | return True 31 | if token != token_content: 32 | self.send_response(HTTPStatus.UNAUTHORIZED, "Wrong token") 33 | self.end_headers() 34 | return True 35 | return False 36 | 37 | def do_GET(self): 38 | if self.handle_tokens(): 39 | return None 40 | self.headers.__delitem__("If-Modified-Since") 41 | return super().do_GET() 42 | 43 | def run(dir): 44 | RequestHandler.protocol_version = "HTTP/1.0" 45 | httpd = http_server.HTTPServer( ("127.0.0.1", 0), RequestHandler) 46 | host, port = httpd.socket.getsockname()[:2] 47 | with open("httpd-port", 'w') as file: 48 | file.write("%d" % port) 49 | with open("httpd-pid", 'w') as file: 50 | file.write("%d" % os.getpid()) 51 | try: 52 | os.write(3, bytes("Started\n", 'utf-8')); 53 | except: 54 | pass 55 | print("Serving HTTP on port %d" % port); 56 | if dir: 57 | os.chdir(dir) 58 | httpd.serve_forever() 59 | 60 | if __name__ == '__main__': 61 | dir = None 62 | if len(sys.argv) >= 2 and len(sys.argv[1]) > 0: 63 | dir = sys.argv[1] 64 | 65 | run(dir) 66 | -------------------------------------------------------------------------------- /triggers/desktop-database.trigger: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if command -v update-desktop-database >/dev/null && test -d "$1/exports/share/applications"; then 4 | exec update-desktop-database -q "$1/exports/share/applications" 5 | fi 6 | -------------------------------------------------------------------------------- /triggers/gtk-icon-cache.trigger: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if command -v gtk-update-icon-cache >/dev/null && test -d "$1/exports/share/icons/hicolor"; then 4 | cp /usr/share/icons/hicolor/index.theme "$1/exports/share/icons/hicolor/" 5 | for dir in "$1"/exports/share/icons/*; do 6 | if test -f "$dir/index.theme"; then 7 | if ! gtk-update-icon-cache --quiet "$dir"; then 8 | echo "Failed to run gtk-update-icon-cache for $dir" 9 | exit 1 10 | fi 11 | fi 12 | done 13 | fi 14 | -------------------------------------------------------------------------------- /triggers/mime-database.trigger: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if command -v update-mime-database >/dev/null && test -d "$1/exports/share/mime/packages"; then 4 | exec update-mime-database "$1/exports/share/mime" 5 | fi 6 | --------------------------------------------------------------------------------