├── .git-blame-ignore-revs ├── .gitignore ├── .gitlab-ci.yml ├── .kde-ci.yml ├── .reuse └── dep5 ├── CMakeLists.txt ├── KF6PackageConfig.cmake.in ├── KF6PackageMacros.cmake ├── LICENSES ├── CC0-1.0.txt ├── GPL-2.0-or-later.txt └── LGPL-2.0-or-later.txt ├── README.KF6.md ├── README.md ├── autotests ├── CMakeLists.txt ├── config.h.cmake ├── data │ ├── customcontent.tar.gz │ ├── customcontent │ │ ├── contents │ │ │ ├── customcontent │ │ │ │ └── CustomContentFile.qml │ │ │ └── ui │ │ │ │ └── main.qml │ │ └── metadata.json │ ├── simplecontent │ │ ├── contents │ │ │ └── ui │ │ │ │ └── main.qml │ │ └── metadata.json │ ├── testfallbackpackage │ │ ├── contents │ │ │ └── ui │ │ │ │ └── main.qml │ │ ├── metadata.json │ │ └── testfallbackpackage.testappdataxml │ ├── testinvalidmetadata │ │ ├── contents │ │ │ └── ui │ │ │ │ └── main.qml │ │ └── metadata.json │ ├── testpackage-nodisplay │ │ ├── contents │ │ │ ├── images │ │ │ │ └── empty.png │ │ │ └── ui │ │ │ │ ├── main.qml │ │ │ │ └── otherfile.qml │ │ └── metadata.json │ ├── testpackage │ │ ├── contents.hash │ │ ├── contents │ │ │ ├── images │ │ │ │ └── empty.png │ │ │ └── ui │ │ │ │ ├── main.qml │ │ │ │ └── otherfile.qml │ │ ├── metadata.json │ │ └── testpackage.testappdataxml │ ├── testpackagesdep │ │ ├── contents │ │ │ └── ui │ │ │ │ └── main.qml │ │ ├── metadata.json │ │ └── testpackagesdep.testappdataxml │ └── testpackagesdepinvalid │ │ ├── contents │ │ └── ui │ │ │ └── main.qml │ │ ├── metadata.json │ │ └── testpackagesdepinvalid.testappdataxml ├── fallbackpackagetest.cpp ├── fallbackpackagetest.h ├── kpackagetoolappstreamtest.cmake ├── mockdepresolver │ ├── CMakeLists.txt │ └── main.cpp ├── packagestructures │ ├── plasmoidpackagestructure.json │ └── plasmoidstructure.cpp ├── packagestructuretest.cpp ├── packagestructuretest.h ├── plasmoidpackagetest.cpp ├── plasmoidpackagetest.h ├── querytest.cpp └── querytest.h ├── docs ├── CMakeLists.txt ├── Doxyfile.local └── kpackagetool │ ├── CMakeLists.txt │ └── man-kpackagetool6.1.docbook ├── metainfo.yaml ├── po ├── ar │ └── libkpackage6.po ├── ast │ └── libkpackage6.po ├── az │ └── libkpackage6.po ├── bg │ └── libkpackage6.po ├── bs │ └── libkpackage6.po ├── ca │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── ca@valencia │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── cs │ └── libkpackage6.po ├── da │ └── libkpackage6.po ├── de │ └── libkpackage6.po ├── el │ └── libkpackage6.po ├── en_GB │ └── libkpackage6.po ├── eo │ └── libkpackage6.po ├── es │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── et │ └── libkpackage6.po ├── eu │ └── libkpackage6.po ├── fi │ └── libkpackage6.po ├── fr │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── gd │ └── libkpackage6.po ├── gl │ └── libkpackage6.po ├── he │ └── libkpackage6.po ├── hi │ └── libkpackage6.po ├── hu │ └── libkpackage6.po ├── ia │ └── libkpackage6.po ├── id │ └── libkpackage6.po ├── it │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── ja │ └── libkpackage6.po ├── ka │ └── libkpackage6.po ├── ko │ └── libkpackage6.po ├── lt │ └── libkpackage6.po ├── lv │ └── libkpackage6.po ├── ml │ └── libkpackage6.po ├── mr │ └── libkpackage6.po ├── nb │ └── libkpackage6.po ├── nds │ └── libkpackage6.po ├── nl │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── nn │ └── libkpackage6.po ├── pa │ └── libkpackage6.po ├── pl │ └── libkpackage6.po ├── pt │ └── libkpackage6.po ├── pt_BR │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── ro │ └── libkpackage6.po ├── ru │ └── libkpackage6.po ├── sa │ └── libkpackage6.po ├── sk │ └── libkpackage6.po ├── sl │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── sr │ └── libkpackage6.po ├── sr@ijekavian │ └── libkpackage6.po ├── sr@ijekavianlatin │ └── libkpackage6.po ├── sr@latin │ └── libkpackage6.po ├── sv │ └── libkpackage6.po ├── ta │ └── libkpackage6.po ├── tg │ └── libkpackage6.po ├── tr │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── ug │ └── libkpackage6.po ├── uk │ ├── docs │ │ └── kpackagetool │ │ │ └── man-kpackagetool6.1.docbook │ └── libkpackage6.po ├── zh_CN │ └── libkpackage6.po └── zh_TW │ └── libkpackage6.po └── src ├── CMakeLists.txt ├── Messages.sh ├── kpackage ├── CMakeLists.txt ├── config-package.h.cmake ├── kpackage-index.qdoc ├── kpackage.qdoc ├── kpackage.qdocconf ├── package.cpp ├── package.h ├── packagejob.cpp ├── packagejob.h ├── packageloader.cpp ├── packageloader.h ├── packagestructure.cpp ├── packagestructure.h ├── packagestructure_compat_p.h └── private │ ├── package_p.h │ ├── packagejobthread.cpp │ ├── packagejobthread_p.h │ ├── packageloader_p.h │ ├── packages.cpp │ ├── packages_p.h │ └── utils.h └── kpackagetool ├── CMakeLists.txt ├── kpackagetool.cpp ├── kpackagetool.h ├── main.cpp └── options.h /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | #clang-format 2 | 1ddea2e98dba1cc931c28d3e2c6146883610291c 3 | fd75bbfffa05db7b2e1ac61d134548f1cedc3e61 4 | 6045c908ea190754b9df111a194359a7894ed355 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore the following files 2 | *~ 3 | *.[oa] 4 | *.diff 5 | *.kate-swp 6 | *.kdev4 7 | .kdev_include_paths 8 | *.kdevelop.pcs 9 | *.moc 10 | *.moc.cpp 11 | *.orig 12 | *.user 13 | .*.swp 14 | .swp.* 15 | Doxyfile 16 | Makefile 17 | avail 18 | random_seed 19 | /build*/ 20 | CMakeLists.txt.user* 21 | *.unc-backup* 22 | .cmake/ 23 | /.clang-format 24 | /compile_commands.json 25 | .clangd 26 | .idea 27 | .vscode 28 | /cmake-build* 29 | .cache 30 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2020 Volker Krause 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | include: 5 | - project: sysadmin/ci-utilities 6 | file: 7 | - /gitlab-templates/linux-qt6.yml 8 | - /gitlab-templates/linux-qt6-next.yml 9 | - /gitlab-templates/alpine-qt6.yml 10 | - /gitlab-templates/freebsd-qt6.yml 11 | - /gitlab-templates/windows-qt6.yml 12 | - /gitlab-templates/xml-lint.yml 13 | - /gitlab-templates/yaml-lint.yml 14 | -------------------------------------------------------------------------------- /.kde-ci.yml: -------------------------------------------------------------------------------- 1 | Dependencies: 2 | - 'on': ['Linux', 'FreeBSD', 'Windows', 'macOS'] 3 | 'require': 4 | 'frameworks/extra-cmake-modules': '@same' 5 | 'frameworks/karchive': '@same' 6 | 'frameworks/kcoreaddons': '@same' 7 | 'frameworks/ki18n': '@same' 8 | 'frameworks/kdoctools': '@same' 9 | 10 | Options: 11 | test-before-installing: True 12 | require-passing-tests-on: ['Linux', 'FreeBSD', 'Windows'] 13 | json-validate-ignore: ['autotests/data/testinvalidmetadata/metadata.json'] 14 | -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: krunner 3 | Upstream-Contact: Marco Martin 4 | Source: https://invent.kde.org/frameworks/kpackage 5 | 6 | Files: README*.md .kde-ci.yml .git-blame-ignore-revs .gitignore autotests/data/* 7 | Copyright: KPackage contributors 8 | License: CC0-1.0 9 | 10 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | set(KF_VERSION "6.15.0") # handled by release scripts 4 | set(KF_DEP_VERSION "6.14.0") # handled by release scripts 5 | project(KPackage VERSION ${KF_VERSION}) 6 | 7 | # ECM setup 8 | include(FeatureSummary) 9 | find_package(ECM 6.14.0 NO_MODULE) 10 | set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://commits.kde.org/extra-cmake-modules") 11 | feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) 12 | 13 | set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) 14 | 15 | include(KDEInstallDirs) 16 | include(KDECMakeSettings) 17 | include(KDEGitCommitHooks) 18 | include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) 19 | 20 | include(ECMGenerateExportHeader) 21 | include(ECMGenerateHeaders) 22 | include(CMakePackageConfigHelpers) 23 | include(ECMSetupVersion) 24 | include(ECMMarkNonGuiExecutable) 25 | include(ECMQtDeclareLoggingCategory) 26 | include(ECMDeprecationSettings) 27 | include(ECMGenerateQDoc) 28 | 29 | set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") 30 | 31 | set(kpackage_version_header "${CMAKE_CURRENT_BINARY_DIR}/src/kpackage/kpackage_version.h") 32 | ecm_setup_version(PROJECT 33 | VARIABLE_PREFIX PACKAGE 34 | VERSION_HEADER "${kpackage_version_header}" 35 | PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfigVersion.cmake" 36 | SOVERSION 6) 37 | 38 | ################# now find all used packages ################# 39 | 40 | set (REQUIRED_QT_VERSION 6.7.0) 41 | 42 | find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Core) 43 | 44 | # shall we use DBus? 45 | # enabled per default on Linux & BSD systems 46 | set(USE_DBUS_DEFAULT OFF) 47 | if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU) 48 | set(USE_DBUS_DEFAULT ON) 49 | endif() 50 | option(USE_DBUS "Build components using DBus" ${USE_DBUS_DEFAULT}) 51 | if(USE_DBUS) 52 | find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED DBus) 53 | set(HAVE_DBUS ON) 54 | endif() 55 | 56 | find_package(KF6Archive ${KF_DEP_VERSION} REQUIRED) 57 | find_package(KF6I18n ${KF_DEP_VERSION} REQUIRED) 58 | find_package(KF6CoreAddons ${KF_DEP_VERSION} REQUIRED) 59 | 60 | find_package(KF6DocTools ${KF_DEP_VERSION}) 61 | set_package_properties(KF6DocTools PROPERTIES DESCRIPTION "Tools to generate documentation" 62 | TYPE OPTIONAL 63 | ) 64 | 65 | ecm_set_disabled_deprecation_versions( 66 | QT 6.9.0 67 | KF 6.13.0 68 | ) 69 | 70 | include(KF6PackageMacros.cmake) 71 | 72 | # make package_version.h available 73 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) 74 | 75 | ################# list the subdirectories ################# 76 | if (KF6DocTools_FOUND) 77 | add_subdirectory(docs) 78 | endif() 79 | add_definitions(-DTRANSLATION_DOMAIN=\"libkpackage6\") 80 | ki18n_install(po) 81 | if (KF6DocTools_FOUND) 82 | kdoctools_install(po) 83 | endif() 84 | add_subdirectory(src) 85 | if (BUILD_TESTING) 86 | add_subdirectory(autotests) 87 | endif() 88 | 89 | ################ create PackageConfig.cmake and install it #################### 90 | 91 | # create a Config.cmake and a ConfigVersion.cmake file and install them 92 | 93 | set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF6Package") 94 | 95 | configure_package_config_file( 96 | "${CMAKE_CURRENT_SOURCE_DIR}/KF6PackageConfig.cmake.in" 97 | "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfig.cmake" 98 | INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} 99 | PATH_VARS KDE_INSTALL_INCLUDEDIR_KF CMAKE_INSTALL_PREFIX 100 | ) 101 | 102 | install(FILES 103 | "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfig.cmake" 104 | "${CMAKE_CURRENT_BINARY_DIR}/KF6PackageConfigVersion.cmake" 105 | "${CMAKE_CURRENT_SOURCE_DIR}/KF6PackageMacros.cmake" 106 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 107 | COMPONENT Devel 108 | ) 109 | 110 | install(EXPORT KF6PackageTargets 111 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 112 | FILE KF6PackageTargets.cmake 113 | NAMESPACE KF6:: 114 | COMPONENT Devel) 115 | install(EXPORT KF6PackageToolsTargets 116 | DESTINATION "${CMAKECONFIG_INSTALL_DIR}" 117 | FILE KF6PackageToolsTargets.cmake 118 | NAMESPACE KF6:: 119 | COMPONENT Devel) 120 | 121 | install(FILES ${kpackage_version_header} 122 | DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPackage COMPONENT Devel ) 123 | 124 | include(ECMFeatureSummary) 125 | ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 126 | 127 | kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) 128 | -------------------------------------------------------------------------------- /KF6PackageConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | # Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. 4 | 5 | include("${CMAKE_CURRENT_LIST_DIR}/KF6PackageTargets.cmake") 6 | if (CMAKE_CROSSCOMPILING AND KF6_HOST_TOOLING) 7 | find_file(KPACKAGE_TARGETSFILE KF6Package/KF6PackageToolsTargets.cmake PATHS ${KF6_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) 8 | include("${KPACKAGE_TARGETSFILE}") 9 | else() 10 | include("${CMAKE_CURRENT_LIST_DIR}/KF6PackageToolsTargets.cmake") 11 | endif() 12 | 13 | set(Package_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") 14 | set_and_check(Package_INCLUDE_DIR "@PACKAGE_KDE_INSTALL_INCLUDEDIR_KF@") 15 | 16 | set(Package_LIBRARIES KF6::Package) 17 | 18 | include(CMakeFindDependencyMacro) 19 | find_dependency(KF6CoreAddons "@KF_DEP_VERSION@") 20 | 21 | @PACKAGE_SETUP_AUTOMOC_VARIABLES@ 22 | 23 | include("${CMAKE_CURRENT_LIST_DIR}/KF6PackageMacros.cmake") 24 | -------------------------------------------------------------------------------- /KF6PackageMacros.cmake: -------------------------------------------------------------------------------- 1 | # To not mess up the ECM_FIND_VERSION we only include ECM if the required variables are not set 2 | if (NOT KDE_INSTALL_DATADIR OR NOT KDE_INSTALL_METAINFODIR) 3 | find_package(ECM 5.83.0 CONFIG REQUIRED) 4 | include(${ECM_KDE_MODULE_DIR}/KDEInstallDirs.cmake) 5 | endif() 6 | set(KPACKAGE_RELATIVE_DATA_INSTALL_DIR "kpackage") 7 | 8 | # kpackage_install_package(path componentname [root] [install_dir]) 9 | # 10 | # Installs a package to the system path 11 | # @arg path The source path to install from, location of metadata.json 12 | # @arg componentname The plugin id of the component, corresponding to the 13 | # Id key of the KPlugin object in metadata.json 14 | # @arg root The subdirectory to install to, default: packages 15 | # @arg install_dir the path where to install packages, 16 | # such as myapp, that would go under prefix/share/myapp: 17 | # default ${KPACKAGE_RELATIVE_DATA_INSTALL_DIR} 18 | # 19 | # Examples: 20 | # kpackage_install_package(mywidget org.kde.plasma.mywidget plasmoids) # installs an applet 21 | # kpackage_install_package(declarativetoolbox org.kde.toolbox packages) # installs a generic package 22 | # kpackage_install_package(declarativetoolbox org.kde.toolbox) # installs a generic package 23 | # 24 | 25 | set(kpackagedir ${CMAKE_CURRENT_LIST_DIR}) 26 | function(kpackage_install_package dir component) 27 | set(root ${ARGV2}) 28 | set(install_dir ${ARGV3}) 29 | if(NOT root) 30 | set(root packages) 31 | endif() 32 | if(NOT install_dir) 33 | set(install_dir ${KPACKAGE_RELATIVE_DATA_INSTALL_DIR}) 34 | endif() 35 | 36 | install(DIRECTORY ${dir}/ DESTINATION ${KDE_INSTALL_DATADIR}/${install_dir}/${root}/${component} 37 | PATTERN .svn EXCLUDE 38 | PATTERN *.qmlc EXCLUDE 39 | PATTERN CMakeLists.txt EXCLUDE 40 | PATTERN Messages.sh EXCLUDE 41 | PATTERN dummydata EXCLUDE) 42 | 43 | get_target_property(kpackagetool_cmd KF6::kpackagetool6 LOCATION) 44 | if (${component} MATCHES "^.+\\..+\\.") #we make sure there's at least 2 dots 45 | set(APPDATAFILE "${CMAKE_CURRENT_BINARY_DIR}/${component}.appdata.xml") 46 | 47 | execute_process( 48 | COMMAND ${kpackagetool_cmd} --appstream-metainfo ${CMAKE_CURRENT_SOURCE_DIR}/${dir} --appstream-metainfo-output ${APPDATAFILE} 49 | ERROR_VARIABLE appstreamerror 50 | RESULT_VARIABLE result) 51 | if (NOT result EQUAL 0) 52 | message(WARNING "couldn't generate metainfo for ${component}: ${appstreamerror}") 53 | else() 54 | if(appstreamerror) 55 | message(WARNING "warnings during generation of metainfo for ${component}: ${appstreamerror}") 56 | endif() 57 | 58 | # OPTIONAL because json files can be NoDisplay so they render no XML 59 | install(FILES ${APPDATAFILE} DESTINATION ${KDE_INSTALL_METAINFODIR} OPTIONAL) 60 | endif() 61 | else() 62 | message(DEBUG "KPackage components should be specified in reverse domain notation. Appstream information won't be generated for ${component}.") 63 | endif() 64 | endfunction() 65 | -------------------------------------------------------------------------------- /LICENSES/CC0-1.0.txt: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.KF6.md: -------------------------------------------------------------------------------- 1 | # Porting notes for KF6 2 | 3 | - In KF5, the packagestructures were installed in "kpackage/packagestructure". In KF6, this changed to "kf6/packagestructure" 4 | 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KPackage Framework 2 | 3 | Installation and loading of additional content (ex: scripts, images...) as packages. 4 | 5 | ## Introduction 6 | 7 | The KPackage framework lets the user install and load packages of non binary content such as scripted extensions or graphic assets, as if they were traditional plugins. 8 | 9 | # Using KPackage 10 | 11 | The frameworks consists of 3 classes: PackageStructure, PackageLoader and Package. 12 | The central class is Package, that represents an installed package and is used to access its file, install, update or uninstall it. 13 | 14 | In order to use the framework the developer has to define a package structure. (the package type, that will be depending on the particular application, and the type of content that will be provided, may be a sound theme, graphics assets, qml files etc). 15 | 16 | The package loader is used to load instances of Package of a given type. 17 | 18 | ## Package class 19 | 20 | Package is the central class of the framework, and it represents a package of a certain type, it can be either "abstract", not pointing to a particular package on disk (in which case the only things allowed will be installing and uninstalling) or it can point to a particular package installed on disk: its path() not being empty and valid. 21 | 22 | A Package defines a particular filesystem structure for installed addons, made up of allowed subdirectories in which content will be organized and several optional named files, if you want to mandate a particular named file in every package (for instance if your addons need a file named "main.qml" in order to be considered valid). 23 | 24 | A fixed structure is encouraged by the api of Package in order to encourage plugin creators to distribute packages made with a standard and expected structure, encouraging a common path installation prefix, and strongly discouraging cross references between different packages such as ../ relative paths and symlinks across packages. 25 | 26 | An example filesystem structure (that in the end, depends from the PackageStructure) may be: 27 | 28 | ``` 29 | 30 | (root) 31 | |-- code 32 | | `-- main.js 33 | |-- config 34 | | `-- config.xml 35 | |-- images 36 | | `-- background.png 37 | `-- metadata.json 38 | 39 | ``` 40 | 41 | The special, main and always required for every package structure file is the "metadata" file, which describes the package with values such as name, description, pluginname etc. It is in the JSON format accepted by KPluginMetadata. The metadata is accessible with Package::metadata(). 42 | 43 | All the other files are under the contents/ subdirectory: a folder under addDirectoryDefinition will be registered under contents/. 44 | 45 | If the developer wants that those extension package require to have a particular file or folder, he will use setRequired() on a particular key: in that case if a package misses that file or folder, isValid() will return false and all the filePath resolution won't work. 46 | 47 | To access a file within the package, the filePath(key, filename) method is used. In order to use that the caller doesn't have to care where the package is installed and absolute paths of any kind, it will pass a relative one, and the prober absolute path will be resolved and returned. 48 | 49 | The key parameter is one of those that has been registered by the structure beforehand by addFileDefinition or addDirectoryDefinition. Files asked with an unknown keys won't be resolved. 50 | 51 | Accessing a file under a directory will look like package.filePath("ui", "main.qml") while accessing a particular named file will look like package.filePath("mainscript"). 52 | 53 | If as file path is passed a relative path with ".." elements in it or an absolute path, the resolution will fail as well, in order to discourage cross references (same thing will happen if the resolved file is a symlink), unless the package structure explicitly allowed it with setAllowExternalPaths(). 54 | Here is a minimal example of a PackageStructure::initPackage. 55 | 56 | ```cpp 57 | // ... 58 | void MyStructure::initPackage(KPackage::Package *package) 59 | { 60 | package->setDefaultPackageRoot(QStringLiteral("myapp" "/packages/")); 61 | 62 | package->addDirectoryDefinition("images", QStringLiteral("images")); 63 | QStringList mimetypes{QStringLiteral("image/svg+xml"), QStringLiteral("image/png"), QStringLiteral("image/jpeg")}; 64 | package->setMimeTypes("images", mimetypes); 65 | package->addDirectoryDefinition("code", QStringLiteral("code")); 66 | package->addFileDefinition("mainscript", QStringLiteral("scripts/main.js")); 67 | //this way, the package will not be considered valid if mainscript is not present 68 | package->setRequired("mainscript", true); 69 | } 70 | ... 71 | K_PLUGIN_CLASS_WITH_JSON(MyStructure, "mystructure.json") 72 | ``` 73 | 74 | The line `K_PLUGIN_CLASS_WITH_JSON` is important in order to export the PackageStructure subclass MyStructure as a standalone plugin library using the KPluginFactory architecture, in order to be loadable and recognizable by a PackageLoader instance from any process (without the need to explicitly link to a library containing the MyStructure implementation). 75 | 76 | In order to build the plugin, it is also needed a .json file describing the metadata for the plugin: 77 | 78 | ```json 79 | { 80 | "KPackageStructure": "MyApp/MyStructure", 81 | "X-KDE-ParentApp": "org.kde.myapp" 82 | } 83 | ``` 84 | 85 | And an own CMakeLists.txt. 86 | 87 | ``` 88 | # build the PackageStructure implementation and install it where PackageLoader looks for plugins 89 | kcoreaddons_add_plugin(myapp_packagestructure_mystructure SOURCES mystructure.cpp INSTALL_NAMESPACE kf6/packagestructure) 90 | target_link_libraries(myapp_packagestructure_mystructure KF6::Package) 91 | ``` 92 | 93 | The C++ implementation with its CMake and JSON files are recommended to be in their own subdirectory, for separation respect to the code of the parent application. 94 | 95 | ## Package structures 96 | 97 | Package structures are instance of PackageStructure and are shipeed as plugins. 98 | 99 | PackageStructure::initPackage will be executed once when any package is created, and this initializes the Package instance on what are the allowed subfolders and named files for this type. The most important thing to do in initPackage is setting a packageRoot path, that will be a common prefix under which all packages will be installed, relative to the xdg data paths. For instance the packages of type "plasmoid" will be under "plasma/plasmoids" which means searching under ~/.local/share/plasma/plasmoids and /usr/share/plasma/plasmoids. 100 | 101 | This is the only required function to be reimplemented for a given PackageStructure, the other ones being optional only when particular needs ensue. 102 | 103 | PackageStructure::pathChanged gets executed when the base path of the Package changes (that means, what package on the filesystem the class is pointing to, as this can change at runetime with Package::setPath). Reimplement this only if you need to have extra check/operations when such a thing happens. 104 | 105 | ## Package loader 106 | 107 | The PackageLoader is used to list, find and load Package instances. 108 | 109 | The most important functions of this class are listPackages/findPackages to list and search packages of a certain type (package structure), for example listing all plasmoids or all plasmoids that have "clock" in their description PackageLoader::loadPackage loads a "blank" package of a certain type. The returned package will be a Package instance that has been initialized to that given structure, pointing to a particular package in the filesystem only if the optional parameter packagePath has been passed. If not, it will be an invalid package, still usable to install and uninstall packages of this type or it can always load a package on the filesystem with the setPath Package method, relative to the packageroot. 110 | 111 | Upon setPath, subdirectories of the packageroot will be searched both in the global system installation and in the user home, preferring the home, such as ~/.local/share/plasma/plasmoids and /usr/share/plasma/plasmoids. If one has to iterate through packages, creating a single Package instance then loading different ones with subsequent calls of setPath is preferable over creating multiple instances for performance reasons. 112 | Example of code loading a package: 113 | 114 | ``` 115 | KPackage::Package p = KPackage::PackageLoader::self()->loadPackage("Plasma/Applet", "org.kde.plasma.analogclock"); 116 | if (p.isValid()) { 117 | qDebug() << p.filePath("mainscript"); 118 | } 119 | ``` 120 | -------------------------------------------------------------------------------- /autotests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Qt6Test ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) 2 | set_package_properties(Qt6Test PROPERTIES PURPOSE "Required for tests") 3 | 4 | remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_KEYWORDS) 5 | 6 | include(ECMMarkAsTest) 7 | include(ECMAddTests) 8 | 9 | configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) 10 | 11 | ecm_add_tests( 12 | fallbackpackagetest.cpp 13 | packagestructuretest.cpp 14 | plasmoidpackagetest.cpp 15 | querytest.cpp 16 | LINK_LIBRARIES Qt6::Test KF6::Package KF6::I18n KF6::Archive 17 | ) 18 | 19 | 20 | kcoreaddons_add_plugin(plasmoidstructure_plugin STATIC SOURCES packagestructures/plasmoidstructure.cpp INSTALL_NAMESPACE kf6/packagestructure) 21 | target_link_libraries(plasmoidstructure_plugin KF6::Package) 22 | kcoreaddons_target_static_plugins(querytest NAMESPACE kf6/packagestructure) 23 | kcoreaddons_target_static_plugins(plasmoidpackagetest NAMESPACE kf6/packagestructure) 24 | 25 | set_tests_properties(querytest PROPERTIES RUN_SERIAL TRUE) # it wipes out ~/.qttest/share 26 | set_tests_properties(plasmoidpackagetest PROPERTIES RUN_SERIAL TRUE) 27 | 28 | function(kpackagetooltest testname) 29 | add_test(NAME ${testname}-appstream COMMAND cmake -Dkpackagetool=$ 30 | -Dgenerated=${CMAKE_CURRENT_BINARY_DIR}/${testname}.appdata.xml 31 | -Dinput=${CMAKE_CURRENT_LIST_DIR}/data/${testname}/ 32 | -Doutput=${CMAKE_CURRENT_SOURCE_DIR}/data/${testname}/${testname}.testappdataxml 33 | -P ${CMAKE_CURRENT_SOURCE_DIR}/kpackagetoolappstreamtest.cmake 34 | ) 35 | set(XDG_DATA_DIRS "$ENV{XDG_DATA_DIRS}") 36 | if(NOT XDG_DATA_DIRS) 37 | set(XDG_DATA_DIRS "/usr/local/share:/usr/share") 38 | endif() 39 | set_property(TEST ${testname}-appstream PROPERTY ENVIRONMENT "XDG_DATA_DIRS=${CMAKE_SOURCE_DIR}/src/kpackage/data:${XDG_DATA_DIRS}") 40 | endfunction() 41 | 42 | foreach(var "testfallbackpackage" "testpackage" "testpackage-nodisplay" "testpackagesdep" "testpackagesdepinvalid") # "customcontent" "simplecontent" 43 | kpackagetooltest(${var}) 44 | endforeach() 45 | 46 | add_subdirectory(mockdepresolver) 47 | -------------------------------------------------------------------------------- /autotests/config.h.cmake: -------------------------------------------------------------------------------- 1 | #define KPACKAGE_DEP_RESOLVERS "${CMAKE_BINARY_DIR}/bin" 2 | -------------------------------------------------------------------------------- /autotests/data/customcontent.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kpackage/16dcc950f7f3123b32108a4eeb09112aed197064/autotests/data/customcontent.tar.gz -------------------------------------------------------------------------------- /autotests/data/customcontent/contents/customcontent/CustomContentFile.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/customcontent/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/customcontent/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Id": "org.kde.customcontent", 4 | "Name": "Custom Content" 5 | }, 6 | "KPackageStructure": "KPackage/CustomContent" 7 | } 8 | -------------------------------------------------------------------------------- /autotests/data/simplecontent/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/simplecontent/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Id": "org.kde.simplecontent", 4 | "Name": "Simple Content" 5 | }, 6 | "KPackageStructure": "KPackage/SimpleContent" 7 | } 8 | -------------------------------------------------------------------------------- /autotests/data/testfallbackpackage/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/testfallbackpackage/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Description": "test description", 4 | "Id": "org.kde.testfallbackpackage", 5 | "License": "GPLv2+", 6 | "Name": "Test Fallback Package" 7 | }, 8 | "KPackageStructure": "Plasma/TestKPackageInternalPlasmoid" 9 | } 10 | -------------------------------------------------------------------------------- /autotests/data/testfallbackpackage/testfallbackpackage.testappdataxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.kde.testfallbackpackage 4 | Test Fallback Package 5 | test description 6 | https://www.kde.org/donate.php?app=org.kde.testfallbackpackage 7 | Marco Martin <mart@kde.org> 8 | GPL-2.0+ 9 | CC0-1.0 10 | 11 | -------------------------------------------------------------------------------- /autotests/data/testinvalidmetadata/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/testinvalidmetadata/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Authors": [ 4 | { 5 | "Email": "bshah@kde 6 | -------------------------------------------------------------------------------- /autotests/data/testpackage-nodisplay/contents/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kpackage/16dcc950f7f3123b32108a4eeb09112aed197064/autotests/data/testpackage-nodisplay/contents/images/empty.png -------------------------------------------------------------------------------- /autotests/data/testpackage-nodisplay/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/testpackage-nodisplay/contents/ui/otherfile.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/testpackage-nodisplay/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Description": "fancy shmancy summary", 4 | "Icon": "plasma", 5 | "Id": "org.kde.testpackage", 6 | "License": "GPLv2+", 7 | "Name": "Test Package" 8 | }, 9 | "KPackageStructure": "KPackage/Generic", 10 | "NoDisplay": true 11 | } 12 | -------------------------------------------------------------------------------- /autotests/data/testpackage/contents.hash: -------------------------------------------------------------------------------- 1 | 88a45736f27b7b477a470feaacd9e725232c47cc 2 | -------------------------------------------------------------------------------- /autotests/data/testpackage/contents/images/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/kpackage/16dcc950f7f3123b32108a4eeb09112aed197064/autotests/data/testpackage/contents/images/empty.png -------------------------------------------------------------------------------- /autotests/data/testpackage/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/testpackage/contents/ui/otherfile.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root 5 | color: "darkblue" 6 | } 7 | 8 | -------------------------------------------------------------------------------- /autotests/data/testpackage/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Authors": [ 4 | { 5 | "Email": "jblow@kde.org", 6 | "Name": "Joe Blow" 7 | } 8 | ], 9 | "Category": "", 10 | "Description": "fancy shmancy summary", 11 | "Icon": "plasma", 12 | "Id": "org.kde.testpackage", 13 | "License": "GPLv2+", 14 | "Website": "https://kde.org", 15 | "Name": "Test Package", 16 | "Name[ar]": "حزمة اختبارية", 17 | "Name[ast]": "Paquete de prueba", 18 | "Name[bs]": "Testni paket", 19 | "Name[ca@valencia]": "Paquet de proves", 20 | "Name[ca]": "Paquet de proves", 21 | "Name[cs]": "Testovací balíček", 22 | "Name[da]": "Testpakke", 23 | "Name[de]": "Test-Paket", 24 | "Name[el]": "Πακέτο δοκιμής", 25 | "Name[en_GB]": "Test Package", 26 | "Name[es]": "Probar el paquete", 27 | "Name[fi]": "Testipaketti", 28 | "Name[fr]": "Paquet de test", 29 | "Name[gd]": "Pacaid dheuchainneach", 30 | "Name[gl]": "Paquete de probas", 31 | "Name[hu]": "Tesztcsomag", 32 | "Name[ia]": "Pacchetto de prova", 33 | "Name[it]": "Pacchetto di prova", 34 | "Name[ko]": "테스트 패키지", 35 | "Name[mr]": "चाचणी पॅकेज", 36 | "Name[nb]": "Test pakke", 37 | "Name[nds]": "Testpaket", 38 | "Name[nl]": "Testpakket", 39 | "Name[nn]": "Test pakke", 40 | "Name[pa]": "ਟੈਸਟ ਪੈਕੇਜ", 41 | "Name[pl]": "Pakiet próbny", 42 | "Name[pt]": "Pacote de Teste", 43 | "Name[pt_BR]": "Pacote de teste", 44 | "Name[ro]": "Pachet de test", 45 | "Name[ru]": "Тестовый пакет", 46 | "Name[sk]": "Testovací balík", 47 | "Name[sl]": "Preizkusni paket", 48 | "Name[sr@ijekavian]": "Пробни пакет", 49 | "Name[sr@ijekavianlatin]": "Probni paket", 50 | "Name[sr@latin]": "Probni paket", 51 | "Name[sr]": "Пробни пакет", 52 | "Name[sv]": "Testpaket", 53 | "Name[tr]": "Paketi Denetle", 54 | "Name[uk]": "Тестовий пакунок", 55 | "Name[x-test]": "xxTest Packagexx", 56 | "Name[zh_CN]": "测试包", 57 | "Name[zh_TW]": "測試套件" 58 | }, 59 | "KPackageStructure": "Plasma/TestKPackageInternalPlasmoid" 60 | } 61 | -------------------------------------------------------------------------------- /autotests/data/testpackage/testpackage.testappdataxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.kde.testpackage 4 | Test Package 5 | حزمة اختبارية 6 | Paquete de prueba 7 | Testni paket 8 | Paquet de proves 9 | Paquet de proves 10 | Testovací balíček 11 | Testpakke 12 | Test-Paket 13 | Πακέτο δοκιμής 14 | Test Package 15 | Probar el paquete 16 | Testipaketti 17 | Paquet de test 18 | Pacaid dheuchainneach 19 | Paquete de probas 20 | Tesztcsomag 21 | Pacchetto de prova 22 | Pacchetto di prova 23 | 테스트 패키지 24 | चाचणी पॅकेज 25 | Test pakke 26 | Testpaket 27 | Testpakket 28 | Test pakke 29 | ਟੈਸਟ ਪੈਕੇਜ 30 | Pakiet próbny 31 | Pacote de Teste 32 | Pacote de teste 33 | Pachet de test 34 | Тестовый пакет 35 | Testovací balík 36 | Preizkusni paket 37 | Пробни пакет 38 | Probni paket 39 | Probni paket 40 | Пробни пакет 41 | Testpaket 42 | Paketi Denetle 43 | Тестовий пакунок 44 | xxTest Packagexx 45 | 测试包 46 | 測試套件 47 | fancy shmancy summary 48 | https://www.kde.org/donate.php?app=org.kde.testpackage 49 | Joe Blow <jblow@kde.org> 50 | plasma 51 | GPL-2.0+ 52 | CC0-1.0 53 | 54 | -------------------------------------------------------------------------------- /autotests/data/testpackagesdep/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle {} 4 | 5 | -------------------------------------------------------------------------------- /autotests/data/testpackagesdep/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Id": "org.kde.testpackagesdep", 4 | "License": "GPLv2+", 5 | "Name": "Test Packages with Dependencies", 6 | "Description": "test description" 7 | }, 8 | "KPackageStructure": "Plasma/TestKPackageInternalPlasmoid", 9 | "X-KPackage-Dependencies": [ 10 | "mock://validdep", 11 | "mock://validdep2" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /autotests/data/testpackagesdep/testpackagesdep.testappdataxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.kde.testpackagesdep 4 | Test Packages with Dependencies 5 | test description 6 | https://www.kde.org/donate.php?app=org.kde.testpackagesdep 7 | Aleix <aleixpol@kde.org> 8 | GPL-2.0+ 9 | CC0-1.0 10 | 11 | -------------------------------------------------------------------------------- /autotests/data/testpackagesdepinvalid/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle {} 4 | 5 | -------------------------------------------------------------------------------- /autotests/data/testpackagesdepinvalid/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Authors": [ 4 | { 5 | "Email": "bshah@kde.org", 6 | "Name": "Bhushan" 7 | } 8 | ], 9 | "Id": "org.kde.testpackagesdepinvalid", 10 | "License": "GPLv2+", 11 | "Name": "Test Packages with Dependencies", 12 | "Description": "test description" 13 | }, 14 | "KPackageStructure": "Plasma/TestKPackageInternalPlasmoid", 15 | "X-KPackage-Dependencies": [ 16 | "mock://invaliddep" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /autotests/data/testpackagesdepinvalid/testpackagesdepinvalid.testappdataxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.kde.testpackagesdepinvalid 4 | Test Packages with Dependencies 5 | test description 6 | https://www.kde.org/donate.php?app=org.kde.testpackagesdepinvalid 7 | Bhushan <bshah@kde.org> 8 | GPL-2.0+ 9 | CC0-1.0 10 | 11 | -------------------------------------------------------------------------------- /autotests/fallbackpackagetest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Aaron Seigo 3 | SPDX-FileCopyrightText: 2014 Marco Martin 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #include "fallbackpackagetest.h" 9 | 10 | #include "packageloader.h" 11 | #include "packagestructure.h" 12 | #include 13 | 14 | void FallbackPackageTest::initTestCase() 15 | { 16 | m_fallPackagePath = QFINDTESTDATA("data/testpackage"); 17 | m_fallbackPkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/Generic")); 18 | m_fallbackPkg.addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); 19 | m_fallbackPkg.setPath(m_fallPackagePath); 20 | 21 | m_packagePath = QFINDTESTDATA("data/testfallbackpackage"); 22 | m_pkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/Generic")); 23 | m_pkg.addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); 24 | m_pkg.setPath(m_packagePath); 25 | } 26 | 27 | void FallbackPackageTest::beforeFallback() 28 | { 29 | QVERIFY(m_fallbackPkg.hasValidStructure()); 30 | QVERIFY(m_pkg.hasValidStructure()); 31 | 32 | // m_fallbackPkg should have otherfile.qml, m_pkg shouldn't 33 | QVERIFY(!m_fallbackPkg.filePath("ui", QStringLiteral("otherfile.qml")).isEmpty()); 34 | QVERIFY(m_pkg.filePath("ui", QStringLiteral("otherfile.qml")).isEmpty()); 35 | } 36 | 37 | void FallbackPackageTest::afterFallback() 38 | { 39 | m_pkg.setFallbackPackage(m_fallbackPkg); 40 | 41 | // after setting the fallback, m_pkg should resolve the exact same file as m_fallbackPkg 42 | // for otherfile.qml 43 | QVERIFY(!m_pkg.filePath("ui", QStringLiteral("otherfile.qml")).isEmpty()); 44 | QCOMPARE(m_fallbackPkg.filePath("ui", QStringLiteral("otherfile.qml")), m_pkg.filePath("ui", QStringLiteral("otherfile.qml"))); 45 | QVERIFY(m_fallbackPkg.filePath("mainscript") != m_pkg.filePath("mainscript")); 46 | } 47 | 48 | void FallbackPackageTest::cycle() 49 | { 50 | m_fallbackPkg.setFallbackPackage(m_pkg); 51 | m_pkg.setFallbackPackage(m_fallbackPkg); 52 | 53 | // The cycle should have been detected and filePath should take a not infinite time 54 | QTRY_COMPARE_WITH_TIMEOUT(m_fallbackPkg.filePath("ui", QStringLiteral("otherfile.qml")), m_pkg.filePath("ui", QStringLiteral("otherfile.qml")), 1000); 55 | } 56 | 57 | QTEST_MAIN(FallbackPackageTest) 58 | 59 | #include "moc_fallbackpackagetest.cpp" 60 | -------------------------------------------------------------------------------- /autotests/fallbackpackagetest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Aaron Seigo 3 | SPDX-FileCopyrightText: 2014 Marco Martin 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef FALLBACKPACKAGETEST_H 9 | #define FALLBACKPACKAGETEST_H 10 | 11 | #include 12 | 13 | #include "kpackage/package.h" 14 | 15 | class FallbackPackageTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void initTestCase(); 21 | void beforeFallback(); 22 | void afterFallback(); 23 | void cycle(); 24 | 25 | private: 26 | KPackage::Package m_pkg; 27 | KPackage::Package m_fallbackPkg; 28 | QString m_packagePath; 29 | QString m_fallPackagePath; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /autotests/kpackagetoolappstreamtest.cmake: -------------------------------------------------------------------------------- 1 | get_filename_component(generated_name ${generated} NAME) 2 | 3 | if(NOT ${generated_name} STREQUAL "testpackage.appdata.xml") 4 | message(STATUS "cd ${input} ; ${kpackagetool} --appstream-metainfo . --appstream-metainfo-output ${generated}") 5 | execute_process(COMMAND ${kpackagetool} --appstream-metainfo . --appstream-metainfo-output "${generated}" 6 | WORKING_DIRECTORY ${input} 7 | ERROR_VARIABLE std_error_output) 8 | else() 9 | message(STATUS "cd ${input} ; ${kpackagetool} --appstream-metainfo .") 10 | # Make sure that without output argument we get the output on STDOUT. 11 | # This only runs on the testpackage test. 12 | execute_process(COMMAND ${kpackagetool} --appstream-metainfo . 13 | WORKING_DIRECTORY ${input} 14 | OUTPUT_FILE "${generated}" 15 | ERROR_VARIABLE std_error_output) 16 | endif() 17 | 18 | if (std_error_output) 19 | message(STATUS "${std_error_output}") 20 | endif() 21 | 22 | # We'll want no generated output file at all on NoDisplay. For other tests we'll want to compare 23 | # the expected with the generated output. 24 | if(${generated_name} STREQUAL "testpackage-nodisplay.appdata.xml") 25 | if(EXISTS "${generated}") 26 | message(FATAL_ERROR "expected file ${output} does not exist, but one was generated at ${generated}") 27 | endif() 28 | else() 29 | execute_process(COMMAND cmake -E compare_files ${output} ${generated} ERROR_VARIABLE error_compare) 30 | if (error_compare) 31 | message(FATAL_ERROR "error on compare: ${error_compare}") 32 | endif() 33 | endif() 34 | 35 | # Make sure the standard test passes appstream validation. 36 | if(${generated_name} STREQUAL "testpackage.appdata.xml") 37 | find_program(APPSTREAMCLI appstreamcli) 38 | if(APPSTREAMCLI) 39 | execute_process(COMMAND ${APPSTREAMCLI} validate ${generated} 40 | ERROR_VARIABLE appstream_stderr 41 | OUTPUT_VARIABLE appstream_stdout 42 | RESULT_VARIABLE result 43 | ) 44 | if(NOT result EQUAL 0) 45 | message(FATAL_ERROR "appstream data seems to be imperfect: ${appstream_stderr} ${appstream_stdout}") 46 | endif() 47 | else() 48 | message(WARNING "skipping appstream validation as no appstreamcli binary was found") 49 | endif() 50 | endif() 51 | -------------------------------------------------------------------------------- /autotests/mockdepresolver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(mockhandler main.cpp) 2 | ecm_mark_nongui_executable(mockhandler) 3 | target_link_libraries(mockhandler Qt6::Core) 4 | -------------------------------------------------------------------------------- /autotests/mockdepresolver/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Bhushan Shah 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | int main(int argc, char **argv) 12 | { 13 | QCoreApplication app(argc, argv); 14 | Q_ASSERT(app.arguments().count() == 2); 15 | 16 | const QUrl url(app.arguments().constLast()); 17 | Q_ASSERT(url.isValid()); 18 | Q_ASSERT(url.scheme() == QLatin1String("mock")); 19 | 20 | // This is very basic dep resolver used for mocking in tests 21 | // if asked to install invalidapp, will fail 22 | // if asked to install validdep, will pass 23 | const QString componentName = url.host(); 24 | if (componentName.isEmpty()) { 25 | qWarning() << "wrongly formatted URI" << url; 26 | return 1; 27 | } 28 | 29 | if (componentName == QStringLiteral("invaliddep")) { 30 | qWarning() << "package asked to install invalid dep, bailing out"; 31 | return 1; 32 | } 33 | 34 | if (componentName.startsWith(QLatin1String("validdep"))) { 35 | qWarning() << "asked to install valid dep, success!"; 36 | return 0; 37 | } 38 | 39 | qWarning() << "Assuming provided package is not available"; 40 | return 1; 41 | } 42 | -------------------------------------------------------------------------------- /autotests/packagestructures/plasmoidpackagestructure.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPackageStructure": "Plasma/TestKPackageInternalPlasmoid" 3 | } 4 | -------------------------------------------------------------------------------- /autotests/packagestructures/plasmoidstructure.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2009 Aaron Seigo 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include "packagestructure.h" 8 | #include 9 | 10 | class PlasmoidTestPackageStructure : public KPackage::PackageStructure 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | using KPackage::PackageStructure::PackageStructure; 16 | 17 | void initPackage(KPackage::Package *package) override 18 | { 19 | KPackage::PackageStructure::initPackage(package); 20 | package->setDefaultPackageRoot(QStringLiteral("plasma/plasmoids/")); 21 | 22 | package->addDirectoryDefinition("ui", QStringLiteral("ui")); 23 | package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); 24 | package->setRequired("mainscript", true); 25 | 26 | package->addFileDefinition("configmodel", QStringLiteral("config/config.qml")); 27 | package->addFileDefinition("mainconfigxml", QStringLiteral("config/main.xml")); 28 | 29 | package->addDirectoryDefinition("images", QStringLiteral("images")); 30 | package->setMimeTypes("images", {QStringLiteral("image/svg+xml"), QStringLiteral("image/png"), QStringLiteral("image/jpeg")}); 31 | 32 | package->addDirectoryDefinition("scripts", QStringLiteral("code")); 33 | package->setMimeTypes("scripts", {QStringLiteral("text/plain")}); 34 | } 35 | }; 36 | 37 | K_PLUGIN_CLASS_WITH_JSON(PlasmoidTestPackageStructure, "plasmoidpackagestructure.json") 38 | 39 | #include "plasmoidstructure.moc" 40 | -------------------------------------------------------------------------------- /autotests/packagestructuretest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Aaron Seigo 3 | SPDX-FileCopyrightText: 2014 Marco Martin 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef PACKAGESTRUCTURETEST_H 9 | #define PACKAGESTRUCTURETEST_H 10 | 11 | #include 12 | 13 | #include "kpackage/package.h" 14 | 15 | class PackageStructureTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void initTestCase(); 21 | void validStructures(); 22 | void validPackages(); 23 | void wallpaperPackage(); 24 | void mutateAfterCopy(); 25 | void emptyContentsPrefix(); 26 | void directories(); 27 | void requiredDirectories(); 28 | void files(); 29 | void requiredFiles(); 30 | void path(); 31 | void required(); 32 | void mimeTypes(); 33 | void customContent(); 34 | 35 | private: 36 | KPackage::Package ps; 37 | QString m_packagePath; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /autotests/plasmoidpackagetest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Bertjan Broeksema 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef PACKAGETEST_H 8 | #define PACKAGETEST_H 9 | 10 | #include 11 | 12 | #include "kpackage/package.h" 13 | #include "kpackage/packagestructure.h" 14 | 15 | class PlasmoidPackageTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | public Q_SLOTS: 20 | void initTestCase(); 21 | void init(); 22 | void cleanup(); 23 | 24 | private Q_SLOTS: 25 | void createAndInstallPackage(); 26 | void createAndUpdatePackage(); 27 | void uncompressPackageWithSubFolder(); 28 | void isValid(); 29 | void filePath(); 30 | void entryList(); 31 | void testInstallNonExistentPackageStructure(); 32 | 33 | void packageInstalled(KJob *j); 34 | void packageUninstalled(KJob *j); 35 | 36 | private: 37 | void createTestPackage(const QString &packageName, const QString &version); 38 | void cleanupPackage(const QString &packageName); 39 | 40 | QString m_packageRoot; 41 | QString m_package; 42 | KPackage::Package m_defaultPackage; 43 | const QString m_defaultPackageStructure = "KPackage/Test"; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /autotests/querytest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Aaron Seigo 3 | SPDX-FileCopyrightText: 2014 Marco Martin 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #include "querytest.h" 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "packagejob.h" 15 | #include "packageloader.h" 16 | #include "packagestructure.h" 17 | 18 | #include "config.h" 19 | 20 | void QueryTest::initTestCase() 21 | { 22 | QStandardPaths::setTestModeEnabled(true); 23 | // Remove any eventual installed package globally on the system 24 | qputenv("XDG_DATA_DIRS", "/not/valid"); 25 | qputenv("KPACKAGE_DEP_RESOLVERS_PATH", KPACKAGE_DEP_RESOLVERS); 26 | 27 | m_dataDir = QDir(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)); 28 | 29 | // verify that the test plugin if found 30 | QVERIFY(KPackage::PackageLoader::self()->loadPackageStructure("Plasma/TestKPackageInternalPlasmoid")); 31 | } 32 | 33 | static bool checkedInstall(const QString &packageFormat, const QString &source, int expectedError) 34 | { 35 | auto job = KPackage::PackageJob::install(packageFormat, source, {}); 36 | QEventLoop l; 37 | QObject::connect(job, &KJob::result, &l, [&l]() { 38 | l.quit(); 39 | }); 40 | l.exec(); 41 | if (job->error() == expectedError) { 42 | return true; 43 | } 44 | qWarning() << "Unexpected error" << job->error() << "while installing" << source << job->errorString(); 45 | return false; 46 | } 47 | 48 | void QueryTest::installAndQuery() 49 | { 50 | m_dataDir.removeRecursively(); 51 | // verify that no packages are installed 52 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 0); 53 | 54 | // install some packages 55 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testpackage"), KJob::NoError)); 56 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testfallbackpackage"), KJob::NoError)); 57 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 2); 58 | 59 | // installing package with invalid metadata should not be possible 60 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testinvalidmetadata"), KPackage::PackageJob::PluginIdInvalidError)); 61 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 2); 62 | 63 | // package with valid dep information should be installed 64 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testpackagesdep"), KJob::NoError)); 65 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 3); 66 | 67 | // package with invalid dep information should not be installed 68 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testpackagesdepinvalid"), KPackage::PackageJob::JobError::PackageCopyError)); 69 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 3); 70 | } 71 | 72 | void QueryTest::queryCustomPlugin() 73 | { 74 | m_dataDir.removeRecursively(); 75 | 76 | // verify that no packages are installed 77 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 0); 78 | 79 | auto testPackageStructure = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")); 80 | // install some packages 81 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testpackage"), KJob::NoError)); 82 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testfallbackpackage"), KJob::NoError)); 83 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 2); 84 | 85 | // installing package with invalid metadata should not be possible 86 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testinvalidmetadata"), KPackage::PackageJob::JobError::PluginIdInvalidError)); 87 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 2); 88 | 89 | // package with valid dep information should be installed 90 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testpackagesdep"), KJob::NoError)); 91 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 3); 92 | 93 | // package with invalid dep information should not be installed 94 | QVERIFY(checkedInstall(packageFormat, QFINDTESTDATA("data/testpackagesdepinvalid"), KPackage::PackageJob::JobError::PackageCopyError)); 95 | 96 | QCOMPARE(KPackage::PackageLoader::self()->listPackages(QStringLiteral("Plasma/TestKPackageInternalPlasmoid")).count(), 3); 97 | } 98 | 99 | QTEST_MAIN(QueryTest) 100 | 101 | #include "moc_querytest.cpp" 102 | -------------------------------------------------------------------------------- /autotests/querytest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Aaron Seigo 3 | SPDX-FileCopyrightText: 2014 Marco Martin 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef PACKAGESTRUCTURETEST_H 9 | #define PACKAGESTRUCTURETEST_H 10 | 11 | #include 12 | 13 | #include "kpackage/package.h" 14 | 15 | class QueryTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void initTestCase(); 21 | void installAndQuery(); 22 | void queryCustomPlugin(); 23 | 24 | private: 25 | const QString packageFormat = "Plasma/TestKPackageInternalPlasmoid"; 26 | QDir m_dataDir; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory(kpackagetool) 3 | -------------------------------------------------------------------------------- /docs/Doxyfile.local: -------------------------------------------------------------------------------- 1 | ### KApiDox Project-specific Overrides File 2 | 3 | # define so that deprecated API is not skipped 4 | PREDEFINED += \ 5 | "KPACKAGE_ENABLE_DEPRECATED_SINCE(x, y)=1" \ 6 | "KPACKAGE_BUILD_DEPRECATED_SINCE(x, y)=1" \ 7 | "KPACKAGE_DEPRECATED_VERSION(x, y, t)=" 8 | -------------------------------------------------------------------------------- /docs/kpackagetool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | kdoctools_create_manpage(man-kpackagetool6.1.docbook 1 INSTALL_DESTINATION ${KDE_INSTALL_MANDIR}) 2 | 3 | -------------------------------------------------------------------------------- /docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | KPackage Manager 9 | 2017-01-03 10 | Frameworks 5.30 11 | KDE Frameworks 12 | 13 | 14 | 15 | kpackagetool6 16 | 1 17 | 18 | 19 | 20 | kpackagetool6 21 | Install, list, remove &plasma; packages 22 | 23 | 24 | 25 | 26 | kpackagetool6 27 | 28 | 29 | 30 | path 31 | 32 | type 33 | path 34 | name 35 | path 36 | 37 | 38 | name 39 | path 40 | 41 | 42 | 43 | 44 | 45 | Description 46 | kpackagetool6 is a command line tool to 47 | install, list, remove &plasma; packages. 48 | 49 | 50 | 51 | 52 | Options 53 | 54 | 55 | 56 | 57 | Displays version information. 58 | 59 | 60 | 61 | Displays this help. 62 | 63 | 64 | path 65 | Generate a SHA1 hash for the package at path. 66 | 67 | 68 | 69 | For install or remove, operates on packages installed for all users. 70 | 71 | 72 | type 73 | The type of package, corresponding to the service type of the package plugin, 74 | ⪚ KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, &etc; 75 | 76 | 77 | path 78 | Install the package at path. 79 | 80 | 81 | name 82 | Show information of package name. 83 | 84 | 85 | path 86 | Upgrade the package at path. 87 | 88 | 89 | 90 | List installed packages. 91 | 92 | 93 | 94 | Lists all known Package types that can be installed. 95 | 96 | 97 | name 98 | Remove the package named name. 99 | 100 | 101 | path 102 | Absolute path to the package root. If not supplied, then the standard data 103 | directories for this &plasma; session will be searched instead. 104 | 105 | 106 | path 107 | Recreate the plugin index. To be used in conjunction with either 108 | the option or . Recreates the index for the 109 | given type or package root. Operates in the user directory, unless 110 | is used. 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | See Also 119 | 120 | More detailed user documentation is available from help:/plasma-desktop 122 | (either enter this &URL; into &konqueror;, or run 123 | khelpcenter 124 | help:/plasma-desktop). 125 | 126 | 127 | 128 | 129 | Authors 130 | kpackagetool6 was written by 131 | AaronSeigo aseigo@kde.org. 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /metainfo.yaml: -------------------------------------------------------------------------------- 1 | description: Library to load and install packages of non binary files as they were a plugin 2 | tier: 2 3 | type: functional 4 | platforms: 5 | - name: Linux 6 | - name: FreeBSD 7 | - name: Windows 8 | - name: macOS 9 | portingAid: false 10 | deprecated: false 11 | release: true 12 | libraries: 13 | - cmake: KF6::Package 14 | cmakename: KF6Package 15 | 16 | public_lib: true 17 | group: Frameworks 18 | subgroup: Tier 2 19 | -------------------------------------------------------------------------------- /po/ast/libkpackage6.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) YEAR This file is copyright: 2 | # This file is distributed under the same license as the kpackage package. 3 | # 4 | # Enol P. , 2023. 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: kpackage\n" 8 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 9 | "POT-Creation-Date: 2023-12-20 01:33+0000\n" 10 | "PO-Revision-Date: 2023-05-03 23:40+0200\n" 11 | "Last-Translator: Enol P. \n" 12 | "Language-Team: \n" 13 | "Language: ast\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 18 | "X-Generator: Lokalize 23.04.0\n" 19 | 20 | #, kde-format 21 | msgctxt "NAME OF TRANSLATORS" 22 | msgid "Your names" 23 | msgstr "Softastur" 24 | 25 | #, kde-format 26 | msgctxt "EMAIL OF TRANSLATORS" 27 | msgid "Your emails" 28 | msgstr "alministradores@softastur.org" 29 | 30 | #: kpackage/private/packagejobthread.cpp:164 31 | #, kde-format 32 | msgid "Could not create package root directory: %1" 33 | msgstr "" 34 | 35 | #: kpackage/private/packagejobthread.cpp:173 36 | #, kde-format 37 | msgid "No such file: %1" 38 | msgstr "" 39 | 40 | #: kpackage/private/packagejobthread.cpp:203 41 | #, kde-format 42 | msgid "Could not open package file, unsupported archive format: %1 %2" 43 | msgstr "" 44 | 45 | #: kpackage/private/packagejobthread.cpp:211 46 | #, kde-format 47 | msgid "Could not open package file: %1" 48 | msgstr "" 49 | 50 | #: kpackage/private/packagejobthread.cpp:238 51 | #, kde-format 52 | msgid "Package is not considered valid" 53 | msgstr "" 54 | 55 | #: kpackage/private/packagejobthread.cpp:248 56 | #, kde-format 57 | msgid "Package plugin id not specified: %1" 58 | msgstr "" 59 | 60 | #: kpackage/private/packagejobthread.cpp:258 61 | #, kde-format 62 | msgid "Package plugin id %1 contains invalid characters" 63 | msgstr "" 64 | 65 | #: kpackage/private/packagejobthread.cpp:277 66 | #, kde-format 67 | msgid "" 68 | "The new package has a different type from the old version already installed." 69 | msgstr "" 70 | 71 | #: kpackage/private/packagejobthread.cpp:282 72 | #, kde-format 73 | msgid "" 74 | "Impossible to remove the old installation of %1 located at %2. error: %3" 75 | msgstr "" 76 | 77 | #: kpackage/private/packagejobthread.cpp:286 78 | #, kde-format 79 | msgid "Not installing version %1 of %2. Version %3 already installed." 80 | msgstr "" 81 | 82 | #: kpackage/private/packagejobthread.cpp:290 83 | #, kde-format 84 | msgid "%1 already exists" 85 | msgstr "" 86 | 87 | #: kpackage/private/packagejobthread.cpp:311 88 | #, kde-format 89 | msgid "Could not install dependency: '%1'" 90 | msgstr "" 91 | 92 | #: kpackage/private/packagejobthread.cpp:323 93 | #, kde-format 94 | msgid "Could not move package to destination: %1" 95 | msgstr "" 96 | 97 | #: kpackage/private/packagejobthread.cpp:333 98 | #, kde-format 99 | msgid "Could not copy package to destination: %1" 100 | msgstr "" 101 | 102 | #: kpackage/private/packagejobthread.cpp:368 103 | #, kde-format 104 | msgid "package path was deleted manually" 105 | msgstr "" 106 | 107 | #: kpackage/private/packagejobthread.cpp:368 108 | #, kde-format 109 | msgid "%1 does not exist" 110 | msgstr "" 111 | 112 | #: kpackage/private/packagejobthread.cpp:388 113 | #, kde-format 114 | msgid "Could not delete package from: %1" 115 | msgstr "" 116 | 117 | #: kpackagetool/kpackagetool.cpp:87 118 | #, kde-format 119 | msgid "Failed to generate a Package hash for %1" 120 | msgstr "" 121 | 122 | #: kpackagetool/kpackagetool.cpp:90 123 | #, kde-format 124 | msgid "SHA1 hash for Package at %1: '%2'" 125 | msgstr "" 126 | 127 | #: kpackagetool/kpackagetool.cpp:145 128 | #, kde-format 129 | msgid "Listing KPackageType: %1 in %2" 130 | msgstr "" 131 | 132 | #: kpackagetool/kpackagetool.cpp:198 133 | #, kde-format 134 | msgid "Error: Plugin %1 is not installed." 135 | msgstr "" 136 | 137 | #: kpackagetool/kpackagetool.cpp:212 138 | #, kde-format 139 | msgctxt "" 140 | "No option was given, this is the error message telling the user he needs at " 141 | "least one, do not translate install, remove, upgrade nor list" 142 | msgid "One of install, remove, upgrade or list is required." 143 | msgstr "" 144 | 145 | #: kpackagetool/kpackagetool.cpp:255 kpackagetool/kpackagetool.cpp:333 146 | #, kde-format 147 | msgid "Error: Can't find plugin metadata: %1\n" 148 | msgstr "" 149 | 150 | #: kpackagetool/kpackagetool.cpp:259 151 | #, kde-format 152 | msgid "Showing info for package: %1" 153 | msgstr "" 154 | 155 | #: kpackagetool/kpackagetool.cpp:260 156 | #, kde-format 157 | msgid " Name : %1" 158 | msgstr "" 159 | 160 | #: kpackagetool/kpackagetool.cpp:261 161 | #, kde-format 162 | msgid " Description: %1" 163 | msgstr "" 164 | 165 | #: kpackagetool/kpackagetool.cpp:262 166 | #, kde-format 167 | msgid " Plugin : %1" 168 | msgstr "" 169 | 170 | #: kpackagetool/kpackagetool.cpp:268 171 | #, kde-format 172 | msgid " Author : %1" 173 | msgstr "" 174 | 175 | #: kpackagetool/kpackagetool.cpp:269 176 | #, kde-format 177 | msgid " Path : %1" 178 | msgstr "" 179 | 180 | #: kpackagetool/kpackagetool.cpp:429 181 | #, kde-format 182 | msgctxt "" 183 | "The user entered conflicting options packageroot and global, this is the " 184 | "error message telling the user he can use only one" 185 | msgid "" 186 | "The packageroot and global options conflict with each other, please select " 187 | "only one." 188 | msgstr "" 189 | 190 | #: kpackagetool/kpackagetool.cpp:457 191 | #, kde-format 192 | msgid "KPackage Structure Name" 193 | msgstr "" 194 | 195 | #: kpackagetool/kpackagetool.cpp:458 196 | #, kde-format 197 | msgid "Path" 198 | msgstr "" 199 | 200 | #: kpackagetool/kpackagetool.cpp:489 201 | #, kde-format 202 | msgid "Package types that are installable with this tool:" 203 | msgstr "" 204 | 205 | #: kpackagetool/kpackagetool.cpp:490 206 | #, kde-format 207 | msgid "Built in:" 208 | msgstr "" 209 | 210 | #: kpackagetool/kpackagetool.cpp:493 211 | #, kde-format 212 | msgid "KPackage/Generic" 213 | msgstr "" 214 | 215 | #: kpackagetool/kpackagetool.cpp:494 216 | #, kde-format 217 | msgid "KPackage/GenericQML" 218 | msgstr "" 219 | 220 | #: kpackagetool/kpackagetool.cpp:502 221 | #, kde-format 222 | msgid "Provided by plugins:" 223 | msgstr "" 224 | 225 | #: kpackagetool/kpackagetool.cpp:524 226 | #, kde-format 227 | msgid "Successfully upgraded %1" 228 | msgstr "" 229 | 230 | #: kpackagetool/kpackagetool.cpp:526 231 | #, kde-format 232 | msgid "Successfully installed %1" 233 | msgstr "" 234 | 235 | #: kpackagetool/kpackagetool.cpp:529 236 | #, kde-format 237 | msgid "Error: Installation of %1 failed: %2" 238 | msgstr "" 239 | 240 | #: kpackagetool/kpackagetool.cpp:541 241 | #, kde-format 242 | msgid "Upgrading package from file: %1" 243 | msgstr "" 244 | 245 | #: kpackagetool/kpackagetool.cpp:548 246 | #, kde-format 247 | msgid "Successfully uninstalled %1" 248 | msgstr "" 249 | 250 | #: kpackagetool/kpackagetool.cpp:550 251 | #, kde-format 252 | msgid "Error: Uninstallation of %1 failed: %2" 253 | msgstr "" 254 | 255 | #: kpackagetool/main.cpp:36 256 | #, kde-format 257 | msgid "KPackage Manager" 258 | msgstr "" 259 | 260 | #: kpackagetool/options.h:11 261 | #, kde-format 262 | msgctxt "Do not translate " 263 | msgid "Generate a SHA1 hash for the package at " 264 | msgstr "" 265 | 266 | #: kpackagetool/options.h:18 267 | #, kde-format 268 | msgid "For install or remove, operates on packages installed for all users." 269 | msgstr "" 270 | 271 | #: kpackagetool/options.h:27 272 | #, kde-format 273 | msgctxt "" 274 | "theme, wallpaper, etc. are keywords, but they may be translated, as both " 275 | "versions are recognized by the application (if translated, should be same as " 276 | "messages with 'package type' context below)" 277 | msgid "" 278 | "The type of package, corresponding to the service type of the package " 279 | "plugin, e.g. KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/" 280 | "Applet, etc." 281 | msgstr "" 282 | 283 | #: kpackagetool/options.h:36 284 | #, kde-format 285 | msgctxt "Do not translate " 286 | msgid "Install the package at " 287 | msgstr "" 288 | 289 | #: kpackagetool/options.h:43 290 | #, kde-format 291 | msgctxt "Do not translate " 292 | msgid "Show information of package " 293 | msgstr "" 294 | 295 | #: kpackagetool/options.h:50 296 | #, kde-format 297 | msgctxt "Do not translate " 298 | msgid "Upgrade the package at " 299 | msgstr "" 300 | 301 | #: kpackagetool/options.h:56 302 | #, kde-format 303 | msgid "List installed packages" 304 | msgstr "" 305 | 306 | #: kpackagetool/options.h:61 307 | #, kde-format 308 | msgid "List all known package types that can be installed" 309 | msgstr "" 310 | 311 | #: kpackagetool/options.h:67 312 | #, kde-format 313 | msgctxt "Do not translate " 314 | msgid "Remove the package named " 315 | msgstr "" 316 | 317 | #: kpackagetool/options.h:74 318 | #, kde-format 319 | msgid "" 320 | "Absolute path to the package root. If not supplied, then the standard data " 321 | "directories for this KDE session will be searched instead." 322 | msgstr "" 323 | 324 | #: kpackagetool/options.h:82 325 | #, kde-format 326 | msgctxt "Do not translate " 327 | msgid "Outputs the metadata for the package " 328 | msgstr "" 329 | 330 | #: kpackagetool/options.h:89 331 | #, kde-format 332 | msgctxt "Do not translate " 333 | msgid "Outputs the metadata for the package into " 334 | msgstr "" 335 | -------------------------------------------------------------------------------- /po/ca/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Gestor KPackage 10 | 3 de gener de 2017 12 | Frameworks 5.30 14 | Frameworks del KDE 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Instal·la, llista, suprimeix els paquets &plasma; 34 | 35 | 36 | 37 | kpackagetool6 camí tipus camí nom camí nom camí 107 | 108 | 109 | 110 | Descripció 112 | El kpackagetool6 és una eina de la línia d'ordres per a instal·lar, llistar, suprimir els paquets del &plasma;. 116 | 117 | 118 | 119 | 120 | Opcions 122 | 123 | 124 | 125 | 129 | Mostra informació sobre la versió. 133 | 134 | 135 | 139 | Mostra aquesta ajuda. 143 | 144 | 145 | camí 151 | Genera una suma de verificació SHA1 per al paquet al «camí». 155 | 156 | 157 | 161 | Per a instal·lar o suprimir, opera amb els paquets instal·lats per a tots els usuaris. 165 | 166 | 167 | tipus 173 | El tipus del paquet, el qual es correspon amb el tipus de servei del connector que es troba al paquet, &pex;, KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, &etc; 177 | 178 | 179 | camí 185 | Instal·la el paquet al «camí». 189 | 190 | 191 | nom 197 | Mostra la informació del paquet «nom». 201 | 202 | 203 | camí 209 | Actualitza el paquet al «camí». 213 | 214 | 215 | 219 | Llista els paquets instal·lats. 223 | 224 | 225 | 229 | Llista tots els tipus de paquets coneguts que es poden instal·lar. 233 | 234 | 235 | nom 241 | Suprimeix el paquet anomenat «nom». 245 | 246 | 247 | camí 253 | Camí absolut a l'arrel del paquet. Si no es proporciona, llavors se cercaran els directoris de dades estàndard per a aquesta sessió del &plasma;. 257 | 258 | 259 | camí 265 | Es torna a crear l'índex dels connectors. S'utilitzarà conjuntament amb les opcions o . Torna a crear l'índex per al tipus indicat o l'arrel del paquet. Opera en el directori d'usuari, excepte si s'utilitza l'opció . 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | Vegeu també 284 | 285 | Hi ha disponible documentació d'usuari més detallada des de help:/plasma-desktop (podeu emprar aquest &URL; al &konqueror; o bé executar khelpcenter help:/plasma-desktop). 295 | 296 | 297 | 298 | 299 | Autors 301 | El kpackagetool6 ha estat escrit per en AaronSeigo aseigo@kde.org. 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /po/ca@valencia/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Gestor KPackage 10 | 3 de gener de 2017 12 | Frameworks 5.30 14 | Frameworks de KDE 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Instal·la, llista, suprimix els paquets &plasma; 34 | 35 | 36 | 37 | kpackagetool6 camí tipus camí nom camí nom camí 107 | 108 | 109 | 110 | Descripció 112 | El kpackagetool6 és una eina de la línia d'ordres per a instal·lar, llistar, suprimir els paquets de &plasma;. 116 | 117 | 118 | 119 | 120 | Opcions 122 | 123 | 124 | 125 | 129 | Mostra informació sobre la versió. 133 | 134 | 135 | 139 | Mostra esta ajuda. 143 | 144 | 145 | camí 151 | Genera una suma de verificació SHA1 per al paquet al «camí». 155 | 156 | 157 | 161 | Per a instal·lar o suprimir, opera amb els paquets instal·lats per a tots els usuaris. 165 | 166 | 167 | tipus 173 | El tipus del paquet, el qual es correspon amb el tipus de servei del connector que es troba en el paquet, &pex;, KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, &etc; 177 | 178 | 179 | camí 185 | Instal·la el paquet en el «camí». 189 | 190 | 191 | nom 197 | Mostra la informació del paquet «nom». 201 | 202 | 203 | camí 209 | Actualitza el paquet al «camí». 213 | 214 | 215 | 219 | Llista els paquets instal·lats. 223 | 224 | 225 | 229 | Llista tots els tipus de paquets coneguts que es poden instal·lar. 233 | 234 | 235 | nom 241 | Suprimix el paquet anomenat «nom». 245 | 246 | 247 | camí 253 | Camí absolut cap a l'arrel del paquet. Si no es proporciona, es buscaran els directoris de dades estàndard per a esta sessió de &plasma;. 257 | 258 | 259 | camí 265 | Es torna a crear l'índex dels connectors. S'utilitzarà conjuntament amb les opcions o . Torna a crear l'índex per al tipus indicat o l'arrel del paquet. Opera en el directori d'usuari, excepte si s'utilitza l'opció . 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | Vegeu també 284 | 285 | Hi ha disponible documentació d'usuari més detallada des de help:/plasma-desktop (podeu emprar este &URL; a dins de &konqueror; o bé executar khelpcenter help:/plasma-desktop). 295 | 296 | 297 | 298 | 299 | Autoria 301 | El kpackagetool6 ha sigut escrit per en AaronSeigo aseigo@kde.org. 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /po/es/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Gestor KPackage 10 | 2017-01-03 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Instalar, listar y eliminar paquetes de &plasma; 34 | 35 | 36 | 37 | kpackagetool6 ruta tipo ruta nombre ruta nombre ruta 107 | 108 | 109 | 110 | Descripción 112 | kpackagetool6 es una herramienta de la línea de órdenes para instalar, listar y eliminar paquetes de &plasma;. 116 | 117 | 118 | 119 | 120 | Opciones 122 | 123 | 124 | 125 | 129 | Muestra información sobre la versión. 133 | 134 | 135 | 139 | Muestra esta ayuda. 143 | 144 | 145 | ruta 151 | Generar un resumen criptográfico SHA1 para el paquete que hay en la «ruta». 155 | 156 | 157 | 161 | Para instalar o eliminar; opera en los paquetes instalados para todos los usuarios. 165 | 166 | 167 | tipo 173 | El tipo de paquete que corresponde al tipo de servicio del complemento del paquete Por ejemplo, «KPackage/Generic», «Plasma/Theme», «Plasma/Wallpaper», «Plasma/Applet», etc. 177 | 178 | 179 | ruta 185 | Instalar el paquete que hay en la «ruta». 189 | 190 | 191 | nombre 197 | Mostrar información sobre el paquete «nombre». 201 | 202 | 203 | ruta 209 | Actualizar el paquete que hay en la «ruta». 213 | 214 | 215 | 219 | Listar los paquetes instalados. 223 | 224 | 225 | 229 | Lista todos los tipos de paquetes conocidos que se pueden instalar. 233 | 234 | 235 | nombre 241 | Eliminar el paquete denominado «nombre». 245 | 246 | 247 | ruta 253 | Ruta absoluta a la raíz del paquete. Si no se indica, se buscará en los directorios de datos estándar de esta sesión de &plasma;. 257 | 258 | 259 | ruta 265 | Volver a crear el índice del complemento. Para usar en conjunción con una de las opciones o . Vuelve a crear el índice para el tipo indicado o para la raíz del paquete. Opera en el directorio del usuario a menos que se use . 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | Vea también 284 | 285 | Dispone de documentación de usuario más detallada en help:/plasma-desktop (introduzca dicho &URL; en &konqueror; o ejecute khelpcenter help:/plasma-desktop). 295 | 296 | 297 | 298 | 299 | Autores 301 | kpackagetool6 fue escrito por AaronSeigo aseigo@kde.org. 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /po/fr/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Gestion « KPackage » 10 | 03-01-2017 12 | Environnement de développement 5.30 14 | Environnement de développement pour KDE 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Installer, lister, supprimer des paquets de &plasma; 34 | 35 | 36 | 37 | kpackagetool6 emplacement type emplacement nom emplacement nom emplacement 107 | 108 | 109 | 110 | Description 112 | kpackagetool6 est un outil en ligne de commandes pour installer, lister et supprimer des paquets de &plasma;. 116 | 117 | 118 | 119 | 120 | Options 122 | 123 | 124 | 125 | 129 | Affiche les informations. 133 | 134 | 135 | 139 | Affiche cette aide. 143 | 144 | 145 | emplacement 151 | Génère un somme de hachage SHA1 pour le paquet à l'emplacement. 157 | 158 | 159 | 163 | Pour installer ou supprimer, traite les paquets installés par les utilisateurs. 167 | 168 | 169 | type 175 | Le type de paquets, correspondant au type de service de module externe de paquets, &pex; KPackage / Générique, Plasma / Thème, Plasma / Fond d'écran, Plasma / Composant graphique, &etc;. 179 | 180 | 181 | emplacement 187 | Installer le paquet à l'emplacement. 193 | 194 | 195 | nom 201 | Affiche les informations sur le paquet nom. 207 | 208 | 209 | emplacement 215 | Met à jour le paquet à l'emplacement. 221 | 222 | 223 | 227 | Liste les paquets installés. 231 | 232 | 233 | 237 | Liste tous les types connus de paquets pouvant être installé 241 | 242 | 243 | nom 249 | Supprime le paquet nommé nom. 255 | 256 | 257 | emplacement 263 | Emplacement absolu de la racine du paquet. S'il n'est pas fourni, alors, les emplacements standards de données pour cette session de &plasma; seront recherchés à la place. 267 | 268 | 269 | emplacement 275 | Re-génère l'index des modules externes. A utiliser en conjonction soit de l'option ou . Re-génère l'index pour le type donné ou une racine du paquet. Fonctionne dans le dossier de l'utilisateur, sauf si l'option est utilisée. 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | Voir aussi 294 | 295 | Une documentation utilisateur plus détaillée est disponible à l'adresse help:/plasma-desktop (soit, saisissez cette &URL; dans &konqueror; ou lancer khelpcenter help:/plasma-desktop). 307 | 308 | 309 | 310 | 311 | Auteurs 313 | kpackagetool6 a été écrit par AaronSeigo aseigo@kde.org. 325 | 326 | 327 | 328 | -------------------------------------------------------------------------------- /po/it/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Gestore di KPackage 10 | 2017-01-03 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Installa, elenca, rimuovi pacchetti &plasma; 34 | 35 | 36 | 37 | kpackagetool6 percorso tipo percorso percorso nome percorso 97 | 98 | 99 | 100 | Descrizione 102 | kpackagetool6 è uno strumento per la riga di comando per installare, elencare e rimuovere i pacchetti di &plasma;. 106 | 107 | 108 | 109 | 110 | Opzioni 112 | 113 | 114 | 115 | 119 | Mostra le informazioni sulla versione. 123 | 124 | 125 | 129 | Mostra questo messaggio di aiuto. 133 | 134 | 135 | percorso 141 | Genera l'hash SHA1 per il pacchetto nel percorso dato. 147 | 148 | 149 | 153 | Per l'installazione o la rimozione, opera sui pacchetti installati per tutti gli utenti. 157 | 158 | 159 | tipo 165 | Il tipo del pacchetto, corrispondente al tipo di servizio del pacchetto di estensione, ⪚ KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, &etc;. 169 | 170 | 171 | percorso 177 | Installa il pacchetto nel percorso dato. 183 | 184 | 185 | nome 191 | Mostra informazioni per il pacchetto nome. 197 | 198 | 199 | percorso 205 | Aggiorna il pacchetto al percorso dato. 211 | 212 | 213 | 217 | Elenca pacchetti installati. 221 | 222 | 223 | 227 | Elenca tutti i tipi di pacchetti noti che si possono installare. 231 | 232 | 233 | nome 239 | Rimuovi il pacchetto chiamato nome. 245 | 246 | 247 | percorso 253 | Percorso assoluto alla radice dei pacchetti. Se non indicato, si cercherà nelle cartelle standard dei dati per questa sessione di &plasma;. 257 | 258 | 259 | percorso 265 | Ricrea l'indice delle estensioni. Va usato assieme con una tra le opzioni e . Ricrea l'indice per la radice del tipo dato o per la radice del pacchetto. Opera nella directory dell'utente, a meno che non sia stato specificato. 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | Vedi anche 284 | 285 | Una documentazione più dettagliata è disponibile a help:/plasma-desktop (inserisci questo &URL; in &konqueror; o esegui khelpcenter help:/plasma-desktop). 295 | 296 | 297 | 298 | 299 | Autori 301 | kpackagetool6 è stato scritto da AaronSeigo aseigo@kde.org. 313 | 314 | 315 | 316 | -------------------------------------------------------------------------------- /po/nl/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | KPackage-beheerder 10 | 2017-01-03 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | &plasma;-pakketten installeren, verwijderen of weergeven 34 | 35 | 36 | 37 | kpackagetool6 pad type pad naam pad naam pad 107 | 108 | 109 | 110 | Beschrijving 112 | kpackagetool6 is een commandoregelhulpmiddel om &plasma;-pakketten te installeren, in een lijst te tonen of te verwijderen. 116 | 117 | 118 | 119 | 120 | Opties 122 | 123 | 124 | 125 | 129 | Toont versie-informatie. 133 | 134 | 135 | 139 | Toont deze help. 143 | 144 | 145 | pad 151 | Genereer een SHA1-hash voor het pakket in pad. 157 | 158 | 159 | 163 | Voor installeren of verwijderen, van toepassing op pakketten die beschikbaar gemaakt zijn voor alle gebruikers. 167 | 168 | 169 | type 175 | Het type pakket, overeenkomend met het type service van de pakketplug-in, ⪚ KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet, &etc; 179 | 180 | 181 | pad 187 | Installeer het pakket in pad. 193 | 194 | 195 | naam 201 | Informatie over pakket naam tonen. 207 | 208 | 209 | pad 215 | Het pakket opwaarderen in pad. 221 | 222 | 223 | 227 | Alle geïnstalleerde pakketten tonen 231 | 232 | 233 | 237 | Toont alle bekende te installeren pakkettypen 241 | 242 | 243 | naam 249 | Verwijder het pakket genaamd naam. 255 | 256 | 257 | pad 263 | Absoluut pad naar de hoofdmap van het pakket. Indien niet opgegeven zullen de standaard gegevensmappen voor deze &plasma;-sessie worden doorzocht. 267 | 268 | 269 | pad 275 | Maak de plug-in-index opnieuw. Om te worden gebruikt samen met ofwel de optie of . Maak de index voor het gegeven type pakket-root. Werkt in de gebruikersmap, tenzij wordt gebruikt. 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | Zie ook 294 | 295 | Meer gedetailleerde gebruikersdocumentatie is beschikbaar op help:/plasma-desktop (ofwel voer deze &URL; in in &konqueror; of voer uit khelpcenter help:/plasma-desktop). 305 | 306 | 307 | 308 | 309 | Auteurs 311 | kpackagetool6 is geschreven door AaronSeigo aseigo@kde.org. 323 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /po/pt_BR/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Gerenciador KPackage 10 | 03/01/2017 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Instalar, listar e remover os pacotes do &plasma; 34 | 35 | 36 | 37 | kpackagetool6 caminho tipo caminho nome caminho nome caminho 107 | 108 | 109 | 110 | Descrição 112 | kpackagetool6 é uma ferramenta de linha de comando para instalar, listar e remover pacotes &plasma;. 116 | 117 | 118 | 119 | 120 | Opções 122 | 123 | 124 | 125 | 129 | Apresenta informações sobre a versão. 133 | 134 | 135 | 139 | Apresenta esta ajuda. 143 | 144 | 145 | caminho 151 | Gera um código SHA1 para o pacote disponível na localização. 157 | 158 | 159 | 163 | Para instalar ou remover, funciona em pacotes instalados para todos os usuários. 167 | 168 | 169 | tipo 175 | O tipo de pacote, correspondendo ao tipo de serviço do plugin de pacotes, ⪚ KPackage/Genérico, Plasma/Tema, Plasma/Papel de parede, Plasma/Miniaplicativo, &etc;. 179 | 180 | 181 | caminho 187 | Instala o pacote disponível no caminho. 193 | 194 | 195 | nome 201 | Mostra as informações do pacote nome. 207 | 208 | 209 | caminho 215 | Atualiza o pacote disponível na caminho. 221 | 222 | 223 | 227 | Lista os pacotes instalados. 231 | 232 | 233 | 237 | Lista todos os tipos de pacotes que podem ser instalados. 241 | 242 | 243 | nome 249 | Remove o pacote chamado nome. 255 | 256 | 257 | caminho 263 | O caminho completo do pacote raiz. Se não for indicado, serão pesquisadas as pastas de dados padrão desta sessão do &plasma;. 267 | 268 | 269 | caminho 275 | Recria o índice do plugin. Será usado em conjunto com as opções ou . Recria o índice para o tipo indicado ou para a raiz dos pacotes. Funciona sobre a pasta do usuário, a menos que seja usada a opção . 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | Veja também 294 | 295 | Documentação do usuário mais detalhada está disponível em help:/plasma-desktop (quer através deste &URL; no &konqueror;, quer através do comando khelpcenter help:/plasma-desktop). 305 | 306 | 307 | 308 | 309 | Autores 311 | kpackagetool6 foi escrito por AaronSeigo aseigo@kde.org. 323 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /po/sl/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | KPackage Manager 10 | 03.01.2017 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Namesti, seznam, odstrani 34 | 35 | 36 | 37 | kpackagetool6 path type path name path name path 107 | 108 | 109 | 110 | Opis 112 | kpackagetool6 je orodje ukazne vrstice za namestitev, seznam, odstranjevanje &plasma; paketi. 116 | 117 | 118 | 119 | 120 | Opcije 122 | 123 | 124 | 125 | 129 | Prikaže informacije o različici. 133 | 134 | 135 | 139 | Prikaže to pomoč. 143 | 144 | 145 | path 151 | Ustvari zgoščeno vrednost SHA1 za paket na pot. 157 | 158 | 159 | 163 | Za namestitev ali odstranitev deluje na paketih, nameščenih za vse uporabnike. 167 | 168 | 169 | type 175 | Vrsta paketa, ki ustreza vrsti storitve vtičnika paketa, ⪚ KPackage/generično, Plasma/tema, Plasma/ozadje, Plasma/Applet, &etc; 179 | 180 | 181 | path 187 | Namestite paket na path. 193 | 194 | 195 | name 201 | Prikaži informacije name paketa. 207 | 208 | 209 | path 215 | Nadgradite paket na path. 221 | 222 | 223 | 227 | Seznam nameščenih paketov. 231 | 232 | 233 | 237 | Navaja vse znane vrste paketov, ki jih je mogoče namestiti. 241 | 242 | 243 | name 249 | Odstranite paket z imenom name. 255 | 256 | 257 | path 263 | Absolutna pot do korena paketa. Če ni priložen, so standardni podatkovni imeniki za ta &plasma; Namesto tega se bo iskala seja. 267 | 268 | 269 | path 275 | Ponovno ustvarite indeks vtičnika. Za uporabo v povezavi z možnostjo ali . Ponovno ustvari indeks za dano vrsto ali koren paketa. Deluje v uporabniškem imeniku, razen če je uporabljena . 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | Poglej tudi 294 | 295 | Podrobnejša uporabniška dokumentacija je na voljo na help:/plasma-desktop (vnesite ta &URL; v &konqueror; ali zaženite khelpcenter help:/plasma-desktop). 305 | 306 | 307 | 308 | 309 | Avtorji 311 | kpackagetool6 je napisal AaronSeigo aseigo@kde.org. 323 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /po/ta/libkpackage6.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 This file is copyright: 2 | # This file is distributed under the same license as the kpackage package. 3 | # 4 | # SPDX-FileCopyrightText: 2024 Kishore G 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: kpackage\n" 8 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 9 | "POT-Creation-Date: 2023-12-20 01:33+0000\n" 10 | "PO-Revision-Date: 2024-04-07 16:29+0530\n" 11 | "Last-Translator: Kishore G \n" 12 | "Language-Team: Tamil \n" 13 | "Language: ta\n" 14 | "MIME-Version: 1.0\n" 15 | "Content-Type: text/plain; charset=UTF-8\n" 16 | "Content-Transfer-Encoding: 8bit\n" 17 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 18 | "X-Generator: Lokalize 24.02.1\n" 19 | 20 | #, kde-format 21 | msgctxt "NAME OF TRANSLATORS" 22 | msgid "Your names" 23 | msgstr "" 24 | 25 | #, kde-format 26 | msgctxt "EMAIL OF TRANSLATORS" 27 | msgid "Your emails" 28 | msgstr "" 29 | 30 | #: kpackage/private/packagejobthread.cpp:164 31 | #, kde-format 32 | msgid "Could not create package root directory: %1" 33 | msgstr "" 34 | 35 | #: kpackage/private/packagejobthread.cpp:173 36 | #, kde-format 37 | msgid "No such file: %1" 38 | msgstr "இப்படிப்பட்ட கோப்பு இல்லை: %1" 39 | 40 | #: kpackage/private/packagejobthread.cpp:203 41 | #, kde-format 42 | msgid "Could not open package file, unsupported archive format: %1 %2" 43 | msgstr "" 44 | 45 | #: kpackage/private/packagejobthread.cpp:211 46 | #, kde-format 47 | msgid "Could not open package file: %1" 48 | msgstr "" 49 | 50 | #: kpackage/private/packagejobthread.cpp:238 51 | #, kde-format 52 | msgid "Package is not considered valid" 53 | msgstr "" 54 | 55 | #: kpackage/private/packagejobthread.cpp:248 56 | #, kde-format 57 | msgid "Package plugin id not specified: %1" 58 | msgstr "" 59 | 60 | #: kpackage/private/packagejobthread.cpp:258 61 | #, kde-format 62 | msgid "Package plugin id %1 contains invalid characters" 63 | msgstr "" 64 | 65 | #: kpackage/private/packagejobthread.cpp:277 66 | #, kde-format 67 | msgid "" 68 | "The new package has a different type from the old version already installed." 69 | msgstr "" 70 | 71 | #: kpackage/private/packagejobthread.cpp:282 72 | #, kde-format 73 | msgid "" 74 | "Impossible to remove the old installation of %1 located at %2. error: %3" 75 | msgstr "" 76 | 77 | #: kpackage/private/packagejobthread.cpp:286 78 | #, kde-format 79 | msgid "Not installing version %1 of %2. Version %3 already installed." 80 | msgstr "" 81 | 82 | #: kpackage/private/packagejobthread.cpp:290 83 | #, kde-format 84 | msgid "%1 already exists" 85 | msgstr "" 86 | 87 | #: kpackage/private/packagejobthread.cpp:311 88 | #, kde-format 89 | msgid "Could not install dependency: '%1'" 90 | msgstr "" 91 | 92 | #: kpackage/private/packagejobthread.cpp:323 93 | #, kde-format 94 | msgid "Could not move package to destination: %1" 95 | msgstr "" 96 | 97 | #: kpackage/private/packagejobthread.cpp:333 98 | #, kde-format 99 | msgid "Could not copy package to destination: %1" 100 | msgstr "" 101 | 102 | #: kpackage/private/packagejobthread.cpp:368 103 | #, kde-format 104 | msgid "package path was deleted manually" 105 | msgstr "" 106 | 107 | #: kpackage/private/packagejobthread.cpp:368 108 | #, kde-format 109 | msgid "%1 does not exist" 110 | msgstr "" 111 | 112 | #: kpackage/private/packagejobthread.cpp:388 113 | #, kde-format 114 | msgid "Could not delete package from: %1" 115 | msgstr "" 116 | 117 | #: kpackagetool/kpackagetool.cpp:87 118 | #, kde-format 119 | msgid "Failed to generate a Package hash for %1" 120 | msgstr "" 121 | 122 | #: kpackagetool/kpackagetool.cpp:90 123 | #, kde-format 124 | msgid "SHA1 hash for Package at %1: '%2'" 125 | msgstr "" 126 | 127 | #: kpackagetool/kpackagetool.cpp:145 128 | #, kde-format 129 | msgid "Listing KPackageType: %1 in %2" 130 | msgstr "" 131 | 132 | #: kpackagetool/kpackagetool.cpp:198 133 | #, kde-format 134 | msgid "Error: Plugin %1 is not installed." 135 | msgstr "" 136 | 137 | #: kpackagetool/kpackagetool.cpp:212 138 | #, kde-format 139 | msgctxt "" 140 | "No option was given, this is the error message telling the user he needs at " 141 | "least one, do not translate install, remove, upgrade nor list" 142 | msgid "One of install, remove, upgrade or list is required." 143 | msgstr "" 144 | 145 | #: kpackagetool/kpackagetool.cpp:255 kpackagetool/kpackagetool.cpp:333 146 | #, kde-format 147 | msgid "Error: Can't find plugin metadata: %1\n" 148 | msgstr "" 149 | 150 | #: kpackagetool/kpackagetool.cpp:259 151 | #, kde-format 152 | msgid "Showing info for package: %1" 153 | msgstr "" 154 | 155 | #: kpackagetool/kpackagetool.cpp:260 156 | #, kde-format 157 | msgid " Name : %1" 158 | msgstr " பெயர் : %1" 159 | 160 | #: kpackagetool/kpackagetool.cpp:261 161 | #, kde-format 162 | msgid " Description: %1" 163 | msgstr " விவரணம்: %1" 164 | 165 | #: kpackagetool/kpackagetool.cpp:262 166 | #, kde-format 167 | msgid " Plugin : %1" 168 | msgstr " செருகுநிரல்: %1" 169 | 170 | #: kpackagetool/kpackagetool.cpp:268 171 | #, kde-format 172 | msgid " Author : %1" 173 | msgstr " இயற்றியவர் : %1" 174 | 175 | #: kpackagetool/kpackagetool.cpp:269 176 | #, kde-format 177 | msgid " Path : %1" 178 | msgstr " பாதை : %1" 179 | 180 | #: kpackagetool/kpackagetool.cpp:429 181 | #, kde-format 182 | msgctxt "" 183 | "The user entered conflicting options packageroot and global, this is the " 184 | "error message telling the user he can use only one" 185 | msgid "" 186 | "The packageroot and global options conflict with each other, please select " 187 | "only one." 188 | msgstr "" 189 | 190 | #: kpackagetool/kpackagetool.cpp:457 191 | #, kde-format 192 | msgid "KPackage Structure Name" 193 | msgstr "" 194 | 195 | #: kpackagetool/kpackagetool.cpp:458 196 | #, kde-format 197 | msgid "Path" 198 | msgstr "" 199 | 200 | #: kpackagetool/kpackagetool.cpp:489 201 | #, kde-format 202 | msgid "Package types that are installable with this tool:" 203 | msgstr "" 204 | 205 | #: kpackagetool/kpackagetool.cpp:490 206 | #, kde-format 207 | msgid "Built in:" 208 | msgstr "" 209 | 210 | #: kpackagetool/kpackagetool.cpp:493 211 | #, kde-format 212 | msgid "KPackage/Generic" 213 | msgstr "" 214 | 215 | #: kpackagetool/kpackagetool.cpp:494 216 | #, kde-format 217 | msgid "KPackage/GenericQML" 218 | msgstr "" 219 | 220 | #: kpackagetool/kpackagetool.cpp:502 221 | #, kde-format 222 | msgid "Provided by plugins:" 223 | msgstr "" 224 | 225 | #: kpackagetool/kpackagetool.cpp:524 226 | #, kde-format 227 | msgid "Successfully upgraded %1" 228 | msgstr "" 229 | 230 | #: kpackagetool/kpackagetool.cpp:526 231 | #, kde-format 232 | msgid "Successfully installed %1" 233 | msgstr "" 234 | 235 | #: kpackagetool/kpackagetool.cpp:529 236 | #, kde-format 237 | msgid "Error: Installation of %1 failed: %2" 238 | msgstr "" 239 | 240 | #: kpackagetool/kpackagetool.cpp:541 241 | #, kde-format 242 | msgid "Upgrading package from file: %1" 243 | msgstr "" 244 | 245 | #: kpackagetool/kpackagetool.cpp:548 246 | #, kde-format 247 | msgid "Successfully uninstalled %1" 248 | msgstr "" 249 | 250 | #: kpackagetool/kpackagetool.cpp:550 251 | #, kde-format 252 | msgid "Error: Uninstallation of %1 failed: %2" 253 | msgstr "" 254 | 255 | #: kpackagetool/main.cpp:36 256 | #, kde-format 257 | msgid "KPackage Manager" 258 | msgstr "" 259 | 260 | #: kpackagetool/options.h:11 261 | #, kde-format 262 | msgctxt "Do not translate " 263 | msgid "Generate a SHA1 hash for the package at " 264 | msgstr "" 265 | 266 | #: kpackagetool/options.h:18 267 | #, kde-format 268 | msgid "For install or remove, operates on packages installed for all users." 269 | msgstr "" 270 | 271 | #: kpackagetool/options.h:27 272 | #, kde-format 273 | msgctxt "" 274 | "theme, wallpaper, etc. are keywords, but they may be translated, as both " 275 | "versions are recognized by the application (if translated, should be same as " 276 | "messages with 'package type' context below)" 277 | msgid "" 278 | "The type of package, corresponding to the service type of the package " 279 | "plugin, e.g. KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/" 280 | "Applet, etc." 281 | msgstr "" 282 | 283 | #: kpackagetool/options.h:36 284 | #, kde-format 285 | msgctxt "Do not translate " 286 | msgid "Install the package at " 287 | msgstr "" 288 | 289 | #: kpackagetool/options.h:43 290 | #, kde-format 291 | msgctxt "Do not translate " 292 | msgid "Show information of package " 293 | msgstr "" 294 | 295 | #: kpackagetool/options.h:50 296 | #, kde-format 297 | msgctxt "Do not translate " 298 | msgid "Upgrade the package at " 299 | msgstr "" 300 | 301 | #: kpackagetool/options.h:56 302 | #, kde-format 303 | msgid "List installed packages" 304 | msgstr "நிறுவியுள்ள தொகுப்புகளை பட்டியலிடு" 305 | 306 | #: kpackagetool/options.h:61 307 | #, kde-format 308 | msgid "List all known package types that can be installed" 309 | msgstr "" 310 | 311 | #: kpackagetool/options.h:67 312 | #, kde-format 313 | msgctxt "Do not translate " 314 | msgid "Remove the package named " 315 | msgstr "" 316 | 317 | #: kpackagetool/options.h:74 318 | #, kde-format 319 | msgid "" 320 | "Absolute path to the package root. If not supplied, then the standard data " 321 | "directories for this KDE session will be searched instead." 322 | msgstr "" 323 | 324 | #: kpackagetool/options.h:82 325 | #, kde-format 326 | msgctxt "Do not translate " 327 | msgid "Outputs the metadata for the package " 328 | msgstr "" 329 | 330 | #: kpackagetool/options.h:89 331 | #, kde-format 332 | msgctxt "Do not translate " 333 | msgid "Outputs the metadata for the package into " 334 | msgstr "" 335 | -------------------------------------------------------------------------------- /po/tr/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | KPackage Yöneticisi 10 | 2017-01-03 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | &plasma; paketlerini kur, listele, kaldır 34 | 35 | 36 | 37 | kpackagetool6 yol type yol ad yol ad yol 107 | 108 | 109 | 110 | Açıklama 112 | kpackagetool6, &plasma; paketlerini kurmak, listelemek ve kaldırmak için bir komut satırı aracıdır. 116 | 117 | 118 | 119 | 120 | Seçenekler 122 | 123 | 124 | 125 | 129 | Sürüm bilgisini görüntüler. 133 | 134 | 135 | 139 | Bu yardımı görüntüler. 143 | 144 | 145 | yol 151 | yol'daki paket için bir SHA1 sağlaması oluşturun. 157 | 158 | 159 | 163 | Paket kurma ve kaldırmayı tüm kullanıcılar için kurulu paketlerde yapar. 167 | 168 | 169 | tür 175 | Paket eklentisinin hizmet türüyle eşleşen paket türü; ⪚, KPackage/Genel, Plasma/Tema, Plasma/Duvar Kağıdı, Plasma/Uygulamacık, &etc; 179 | 180 | 181 | yol 187 | path'daki paketi kurun. 193 | 194 | 195 | ad 201 | Paket ad'ı hakkında bilgi gösterin. 207 | 208 | 209 | yol 215 | yol'daki paketi yükseltin. 221 | 222 | 223 | 227 | Kurulu paketleri listeleyin. 231 | 232 | 233 | 237 | Kurulması olanaklı olan bilinen tüm Paket türlerini listeler. 241 | 242 | 243 | ad 249 | Paket ad'ını kaldırın. 255 | 256 | 257 | yol 263 | Paket köküne olan mutlak yol. Sağlanmazsa bu &plasma; oturumu için olan standart veri dizinleri aranır. 267 | 268 | 269 | yol 275 | Eklenti indeksini yeniden oluşturun. veya seçenekleriyle kullanılır. Verilen tür veya paket kökü için indeksi yeniden oluşturur. seçeneği sağlanmadığı sürece kullanıcı dizininde işlem yapar. 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | Ayrıca Bakınız 294 | 295 | Daha ayrıntılı kullanıcı belgelendirmesine help:/plasma-desktop (ya bu &URL;'yi &konqueror;'a girin ya da khelpcenter help:/plasma-desktop komutunu çalıştırın) adresinden ulaşabilirsiniz. 305 | 306 | 307 | 308 | 309 | Yazarlar 311 | kpackagetool6, AaronSeigo aseigo@kde.org tarafından yazılmıştır. 323 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /po/uk/docs/kpackagetool/man-kpackagetool6.1.docbook: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 7 | 8 | Засіб керування KPackage 10 | 3 січня 2017 року 12 | Frameworks 5.30 14 | KDE Frameworks 16 | 17 | 18 | 19 | kpackagetool6 23 | 1 25 | 26 | 27 | 28 | kpackagetool6 32 | Встановлення, показ списку, вилучення пакунків Плазми 34 | 35 | 36 | 37 | kpackagetool6 шлях тип шлях назва шлях назва шлях 107 | 108 | 109 | 110 | Опис 112 | kpackagetool6 — програма з інтерфейсом командного рядка для встановлення, показу списку та вилучення пакунків Плазми. 116 | 117 | 118 | 119 | 120 | Параметри 122 | 123 | 124 | 125 | 129 | Показати дані щодо версії. 133 | 134 | 135 | 139 | Показати цю довідку. 143 | 144 | 145 | шлях 151 | Створює хеш SHA1 для пакунка у каталозі «шлях». 155 | 156 | 157 | 161 | Для встановлення і вилучення, працює з пакунками, встановленими для всіх користувачів. 165 | 166 | 167 | тип 173 | Тип пакунка, відповідає типу служби додатка у пакунку, наприклад KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/Applet тощо 177 | 178 | 179 | шлях 185 | Встановити пакунок за адресою «шлях». 189 | 190 | 191 | назва 197 | Показати дані щодо пакунка «назва». 201 | 202 | 203 | шлях 209 | Оновити пакунок за адресою «шлях». 213 | 214 | 215 | 219 | Показати список встановлених пакунків. 223 | 224 | 225 | 229 | Показує список всіх відомих типів пакунків, які програма може встановлювати. 233 | 234 | 235 | назва 241 | Вилучити пакунок з назвою «назва». 245 | 246 | 247 | шлях 253 | Абсолютний шлях до кореня пакунків. Якщо його не вказано, для пошуку буде використано стандартні каталоги даних цього сеансу Плазми. 257 | 258 | 259 | шлях 265 | Повторно створити покажчик додатка. Використовується разом з параметром або . Створює покажчик вказаного типу або кореневий покажчик. Працює у каталозі користувача, якщо не вказано параметра . 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | Прочитайте також 284 | 285 | Докладнішу документацію користувача можна знайти за адресою help:/plasma-desktop (ви можете або ввести цю адресу URL у рядок адреси &konqueror;, або виконати команду khelpcenter help:/plasma-desktop). 297 | 298 | 299 | 300 | 301 | Автори 303 | kpackagetool6 створено AaronSeigo aseigo@kde.org. 315 | 316 | 317 | 318 | -------------------------------------------------------------------------------- /po/zh_CN/libkpackage6.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: kdeorg\n" 4 | "Report-Msgid-Bugs-To: https://bugs.kde.org\n" 5 | "POT-Creation-Date: 2023-12-20 01:33+0000\n" 6 | "PO-Revision-Date: 2024-04-22 15:58\n" 7 | "Last-Translator: \n" 8 | "Language-Team: Chinese Simplified\n" 9 | "Language: zh_CN\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "Plural-Forms: nplurals=1; plural=0;\n" 14 | "X-Crowdin-Project: kdeorg\n" 15 | "X-Crowdin-Project-ID: 269464\n" 16 | "X-Crowdin-Language: zh-CN\n" 17 | "X-Crowdin-File: /kf6-trunk/messages/kpackage/libkpackage6.pot\n" 18 | "X-Crowdin-File-ID: 43129\n" 19 | 20 | #, kde-format 21 | msgctxt "NAME OF TRANSLATORS" 22 | msgid "Your names" 23 | msgstr "KDE 中国, Guo Yunhe, Tyson Tan" 24 | 25 | #, kde-format 26 | msgctxt "EMAIL OF TRANSLATORS" 27 | msgid "Your emails" 28 | msgstr "kde-china@kde.org, i@guoyunhe.me, tds00@qq.com" 29 | 30 | #: kpackage/private/packagejobthread.cpp:164 31 | #, kde-format 32 | msgid "Could not create package root directory: %1" 33 | msgstr "无法创建包根目录:%1" 34 | 35 | #: kpackage/private/packagejobthread.cpp:173 36 | #, kde-format 37 | msgid "No such file: %1" 38 | msgstr "没有这个文件:%1" 39 | 40 | #: kpackage/private/packagejobthread.cpp:203 41 | #, kde-format 42 | msgid "Could not open package file, unsupported archive format: %1 %2" 43 | msgstr "无法打开包文件,不支持的压缩格式:%1 %2" 44 | 45 | #: kpackage/private/packagejobthread.cpp:211 46 | #, kde-format 47 | msgid "Could not open package file: %1" 48 | msgstr "无法打开包文件:%1" 49 | 50 | #: kpackage/private/packagejobthread.cpp:238 51 | #, kde-format 52 | msgid "Package is not considered valid" 53 | msgstr "软件包无效" 54 | 55 | #: kpackage/private/packagejobthread.cpp:248 56 | #, kde-format 57 | msgid "Package plugin id not specified: %1" 58 | msgstr "软件包插件 ID 未指定:%1" 59 | 60 | #: kpackage/private/packagejobthread.cpp:258 61 | #, kde-format 62 | msgid "Package plugin id %1 contains invalid characters" 63 | msgstr "软件包插件 ID %1 包含无效字符" 64 | 65 | #: kpackage/private/packagejobthread.cpp:277 66 | #, kde-format 67 | msgid "" 68 | "The new package has a different type from the old version already installed." 69 | msgstr "新包的格式和已安装的旧版本不同。" 70 | 71 | #: kpackage/private/packagejobthread.cpp:282 72 | #, kde-format 73 | msgid "" 74 | "Impossible to remove the old installation of %1 located at %2. error: %3" 75 | msgstr "无法删除位于 %2 的 %1 的旧版安装文件。错误:%3" 76 | 77 | #: kpackage/private/packagejobthread.cpp:286 78 | #, kde-format 79 | msgid "Not installing version %1 of %2. Version %3 already installed." 80 | msgstr "未安装 %1 版本的 %2。已安装版本 %3 。" 81 | 82 | #: kpackage/private/packagejobthread.cpp:290 83 | #, kde-format 84 | msgid "%1 already exists" 85 | msgstr "%1 已存在" 86 | 87 | #: kpackage/private/packagejobthread.cpp:311 88 | #, kde-format 89 | msgid "Could not install dependency: '%1'" 90 | msgstr "无法安装依赖:“%1”" 91 | 92 | #: kpackage/private/packagejobthread.cpp:323 93 | #, kde-format 94 | msgid "Could not move package to destination: %1" 95 | msgstr "无法移动包到目标:%1" 96 | 97 | #: kpackage/private/packagejobthread.cpp:333 98 | #, kde-format 99 | msgid "Could not copy package to destination: %1" 100 | msgstr "无法复制包到目标:%1" 101 | 102 | #: kpackage/private/packagejobthread.cpp:368 103 | #, kde-format 104 | msgid "package path was deleted manually" 105 | msgstr "软件包路径已被手动删除" 106 | 107 | #: kpackage/private/packagejobthread.cpp:368 108 | #, kde-format 109 | msgid "%1 does not exist" 110 | msgstr "%1 不存在" 111 | 112 | #: kpackage/private/packagejobthread.cpp:388 113 | #, kde-format 114 | msgid "Could not delete package from: %1" 115 | msgstr "无法从位置删除包:%1" 116 | 117 | #: kpackagetool/kpackagetool.cpp:87 118 | #, kde-format 119 | msgid "Failed to generate a Package hash for %1" 120 | msgstr "生成 %1 的包哈希值失败" 121 | 122 | #: kpackagetool/kpackagetool.cpp:90 123 | #, kde-format 124 | msgid "SHA1 hash for Package at %1: '%2'" 125 | msgstr "位于 %1 的包的 SHA1 哈希值:'%2'" 126 | 127 | #: kpackagetool/kpackagetool.cpp:145 128 | #, kde-format 129 | msgid "Listing KPackageType: %1 in %2" 130 | msgstr "正在列出 %2 中的 KPackageType:%1" 131 | 132 | #: kpackagetool/kpackagetool.cpp:198 133 | #, kde-format 134 | msgid "Error: Plugin %1 is not installed." 135 | msgstr "错误:插件 %1 未安装。" 136 | 137 | #: kpackagetool/kpackagetool.cpp:212 138 | #, kde-format 139 | msgctxt "" 140 | "No option was given, this is the error message telling the user he needs at " 141 | "least one, do not translate install, remove, upgrade nor list" 142 | msgid "One of install, remove, upgrade or list is required." 143 | msgstr "" 144 | "必须使用安装 (install)、移除 (remove)、升级 (upgrade) 或列出 (list) 四个选项" 145 | "之一。" 146 | 147 | #: kpackagetool/kpackagetool.cpp:255 kpackagetool/kpackagetool.cpp:333 148 | #, kde-format 149 | msgid "Error: Can't find plugin metadata: %1\n" 150 | msgstr "错误:无法找到插件元数据:%1\n" 151 | 152 | #: kpackagetool/kpackagetool.cpp:259 153 | #, kde-format 154 | msgid "Showing info for package: %1" 155 | msgstr "显示包信息:%1" 156 | 157 | #: kpackagetool/kpackagetool.cpp:260 158 | #, kde-format 159 | msgid " Name : %1" 160 | msgstr " 名称:%1" 161 | 162 | #: kpackagetool/kpackagetool.cpp:261 163 | #, kde-format 164 | msgid " Description: %1" 165 | msgstr " 描述:%1" 166 | 167 | #: kpackagetool/kpackagetool.cpp:262 168 | #, kde-format 169 | msgid " Plugin : %1" 170 | msgstr " 插件:%1" 171 | 172 | #: kpackagetool/kpackagetool.cpp:268 173 | #, kde-format 174 | msgid " Author : %1" 175 | msgstr " 作者:%1" 176 | 177 | #: kpackagetool/kpackagetool.cpp:269 178 | #, kde-format 179 | msgid " Path : %1" 180 | msgstr " 路径:%1" 181 | 182 | #: kpackagetool/kpackagetool.cpp:429 183 | #, kde-format 184 | msgctxt "" 185 | "The user entered conflicting options packageroot and global, this is the " 186 | "error message telling the user he can use only one" 187 | msgid "" 188 | "The packageroot and global options conflict with each other, please select " 189 | "only one." 190 | msgstr "包目录树的选项和全局选项相互冲突,请选择其中一个。" 191 | 192 | #: kpackagetool/kpackagetool.cpp:457 193 | #, kde-format 194 | msgid "KPackage Structure Name" 195 | msgstr "KPackage 结构名称" 196 | 197 | #: kpackagetool/kpackagetool.cpp:458 198 | #, kde-format 199 | msgid "Path" 200 | msgstr "路径" 201 | 202 | #: kpackagetool/kpackagetool.cpp:489 203 | #, kde-format 204 | msgid "Package types that are installable with this tool:" 205 | msgstr "使用本工具可安装的包类型:" 206 | 207 | #: kpackagetool/kpackagetool.cpp:490 208 | #, kde-format 209 | msgid "Built in:" 210 | msgstr "构建于:" 211 | 212 | #: kpackagetool/kpackagetool.cpp:493 213 | #, kde-format 214 | msgid "KPackage/Generic" 215 | msgstr "KPackage/通用" 216 | 217 | #: kpackagetool/kpackagetool.cpp:494 218 | #, kde-format 219 | msgid "KPackage/GenericQML" 220 | msgstr "KPackage/通用 QML" 221 | 222 | #: kpackagetool/kpackagetool.cpp:502 223 | #, kde-format 224 | msgid "Provided by plugins:" 225 | msgstr "由这些插件提供:" 226 | 227 | #: kpackagetool/kpackagetool.cpp:524 228 | #, kde-format 229 | msgid "Successfully upgraded %1" 230 | msgstr "已成功升级 %1" 231 | 232 | #: kpackagetool/kpackagetool.cpp:526 233 | #, kde-format 234 | msgid "Successfully installed %1" 235 | msgstr "已成功安装 %1" 236 | 237 | #: kpackagetool/kpackagetool.cpp:529 238 | #, kde-format 239 | msgid "Error: Installation of %1 failed: %2" 240 | msgstr "错误:安装 %1 失败:%2" 241 | 242 | #: kpackagetool/kpackagetool.cpp:541 243 | #, kde-format 244 | msgid "Upgrading package from file: %1" 245 | msgstr "从文件更新包:%1" 246 | 247 | #: kpackagetool/kpackagetool.cpp:548 248 | #, kde-format 249 | msgid "Successfully uninstalled %1" 250 | msgstr "已成功卸载 %1" 251 | 252 | #: kpackagetool/kpackagetool.cpp:550 253 | #, kde-format 254 | msgid "Error: Uninstallation of %1 failed: %2" 255 | msgstr "错误:卸载 %1 失败:%2" 256 | 257 | #: kpackagetool/main.cpp:36 258 | #, kde-format 259 | msgid "KPackage Manager" 260 | msgstr "KPackage 管理器" 261 | 262 | #: kpackagetool/options.h:11 263 | #, kde-format 264 | msgctxt "Do not translate " 265 | msgid "Generate a SHA1 hash for the package at " 266 | msgstr "生成位于 的包的哈希值。" 267 | 268 | #: kpackagetool/options.h:18 269 | #, kde-format 270 | msgid "For install or remove, operates on packages installed for all users." 271 | msgstr "供所有用户对包进行安装、移除和其他操作。" 272 | 273 | #: kpackagetool/options.h:27 274 | #, kde-format 275 | msgctxt "" 276 | "theme, wallpaper, etc. are keywords, but they may be translated, as both " 277 | "versions are recognized by the application (if translated, should be same as " 278 | "messages with 'package type' context below)" 279 | msgid "" 280 | "The type of package, corresponding to the service type of the package " 281 | "plugin, e.g. KPackage/Generic, Plasma/Theme, Plasma/Wallpaper, Plasma/" 282 | "Applet, etc." 283 | msgstr "" 284 | "包的类型,对应包插件的服务类型,例如 KPackage/Generic, Plasma/Theme, Plasma/" 285 | "Wallpaper, Plasma/Applet 等。" 286 | 287 | #: kpackagetool/options.h:36 288 | #, kde-format 289 | msgctxt "Do not translate " 290 | msgid "Install the package at " 291 | msgstr "安装位于 的包" 292 | 293 | #: kpackagetool/options.h:43 294 | #, kde-format 295 | msgctxt "Do not translate " 296 | msgid "Show information of package " 297 | msgstr "显示包 的信息" 298 | 299 | #: kpackagetool/options.h:50 300 | #, kde-format 301 | msgctxt "Do not translate " 302 | msgid "Upgrade the package at " 303 | msgstr "升级位于 的包" 304 | 305 | #: kpackagetool/options.h:56 306 | #, kde-format 307 | msgid "List installed packages" 308 | msgstr "列出已安装的包" 309 | 310 | #: kpackagetool/options.h:61 311 | #, kde-format 312 | msgid "List all known package types that can be installed" 313 | msgstr "列出所有可安装的已知包类型" 314 | 315 | #: kpackagetool/options.h:67 316 | #, kde-format 317 | msgctxt "Do not translate " 318 | msgid "Remove the package named " 319 | msgstr "移除名为 的包" 320 | 321 | #: kpackagetool/options.h:74 322 | #, kde-format 323 | msgid "" 324 | "Absolute path to the package root. If not supplied, then the standard data " 325 | "directories for this KDE session will be searched instead." 326 | msgstr "" 327 | "软件包根目录的绝对路径。如果未提供,则转而搜索本次 KDE 会话的标准数据目录。" 328 | 329 | #: kpackagetool/options.h:82 330 | #, kde-format 331 | msgctxt "Do not translate " 332 | msgid "Outputs the metadata for the package " 333 | msgstr "输出位于 包的元数据" 334 | 335 | #: kpackagetool/options.h:89 336 | #, kde-format 337 | msgctxt "Do not translate " 338 | msgid "Outputs the metadata for the package into " 339 | msgstr "输出软件包元数据到 " 340 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(kpackage) 2 | add_subdirectory(kpackagetool) 3 | 4 | ecm_qt_install_logging_categories( 5 | EXPORT KPACKAGE 6 | FILES kpackage.categories 7 | DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} 8 | ) 9 | -------------------------------------------------------------------------------- /src/Messages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources. 4 | # The results are stored in a pseudo .cpp file to be picked up by xgettext. 5 | lst=`find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` 6 | if [ -n "$lst" ] ; then 7 | $EXTRACTRC $lst >> rc.cpp 8 | fi 9 | 10 | # Run xgettext to extract strings from all source files. 11 | $XGETTEXT `find . -name \*.cpp -o -name \*.h -o -name \*.qml` -o $podir/libkpackage6.pot 12 | -------------------------------------------------------------------------------- /src/kpackage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-package.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-package.h) 2 | 3 | add_library(KF6Package) 4 | add_library(KF6::Package ALIAS KF6Package) 5 | 6 | set_target_properties(KF6Package PROPERTIES 7 | VERSION ${PACKAGE_VERSION} 8 | SOVERSION ${PACKAGE_SOVERSION} 9 | EXPORT_NAME Package 10 | ) 11 | 12 | target_sources(KF6Package PRIVATE 13 | package.cpp 14 | packagestructure.cpp 15 | packageloader.cpp 16 | packagejob.cpp 17 | private/packages.cpp 18 | private/packagejobthread.cpp 19 | ) 20 | 21 | ecm_qt_declare_logging_category(KF6Package 22 | HEADER kpackage_debug.h 23 | IDENTIFIER KPACKAGE_LOG 24 | CATEGORY_NAME kf.package 25 | OLD_CATEGORY_NAMES kf5.kpackage 26 | DESCRIPTION "kpackage (lib)" 27 | EXPORT KPACKAGE 28 | ) 29 | 30 | ecm_generate_export_header(KF6Package 31 | EXPORT_FILE_NAME kpackage/package_export.h 32 | BASE_NAME KPackage 33 | GROUP_BASE_NAME KF 34 | VERSION ${KF_VERSION} 35 | USE_VERSION_HEADER 36 | DEPRECATED_BASE_VERSION 0 37 | DEPRECATION_VERSIONS 38 | EXCLUDE_DEPRECATED_BEFORE_AND_AT ${EXCLUDE_DEPRECATED_BEFORE_AND_AT} 39 | ) 40 | 41 | target_link_libraries(KF6Package 42 | PUBLIC 43 | KF6::CoreAddons 44 | PRIVATE 45 | KF6::Archive 46 | KF6::I18n 47 | ) 48 | 49 | if (HAVE_DBUS) 50 | target_link_libraries(KF6Package 51 | PRIVATE 52 | Qt::DBus # notification 53 | ) 54 | target_compile_definitions(KF6Package PRIVATE -DHAVE_QTDBUS=1) 55 | else() 56 | target_compile_definitions(KF6Package PRIVATE -DHAVE_QTDBUS=0) 57 | endif() 58 | 59 | target_include_directories(KF6Package PUBLIC 60 | "$" 61 | ) 62 | target_include_directories(KF6Package INTERFACE 63 | "$" 64 | ) 65 | 66 | ########### install files ############### 67 | ecm_generate_headers(Package_CamelCase_HEADERS 68 | HEADER_NAMES 69 | Package 70 | PackageStructure 71 | PackageLoader 72 | PackageJob 73 | packagestructure_compat_p 74 | REQUIRED_HEADERS Package_HEADERS 75 | PREFIX KPackage 76 | ) 77 | 78 | ecm_generate_qdoc(KF6Package kpackage.qdocconf) 79 | 80 | install(FILES 81 | ${Package_HEADERS} 82 | ${CMAKE_CURRENT_BINARY_DIR}/kpackage/package_export.h 83 | DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPackage/kpackage COMPONENT Devel) 84 | 85 | install(FILES 86 | ${Package_CamelCase_HEADERS} 87 | DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPackage/KPackage COMPONENT Devel) 88 | 89 | install(TARGETS KF6Package EXPORT KF6PackageTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) 90 | if (NOT BUILD_SHARED_LIBS) 91 | install(TARGETS kpackage_common_STATIC EXPORT KF6PackageTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) 92 | endif() 93 | -------------------------------------------------------------------------------- /src/kpackage/config-package.h.cmake: -------------------------------------------------------------------------------- 1 | 2 | #define KPACKAGE_RELATIVE_DATA_INSTALL_DIR "@KPACKAGE_RELATIVE_DATA_INSTALL_DIR@" 3 | 4 | #define KDE_INSTALL_FULL_LIBEXECDIR_KF "@KDE_INSTALL_FULL_LIBEXECDIR_KF@" 5 | -------------------------------------------------------------------------------- /src/kpackage/kpackage-index.qdoc: -------------------------------------------------------------------------------- 1 | /*! 2 | \page kpackage-index.html 3 | \title KPackage 4 | 5 | Installation and loading of additional content (ex: scripts, images...) as packages. 6 | 7 | \section1 Using the Module 8 | 9 | \include {module-use.qdocinc} {using the c++ api} 10 | 11 | \section2 Building with CMake 12 | 13 | \include {module-use.qdocinc} {building with cmake} {KF6} {Package} {KF6::Package} 14 | 15 | \section1 API Reference 16 | 17 | \list 18 | \li \l{KPackage C++ Classes} 19 | \endlist 20 | */ 21 | -------------------------------------------------------------------------------- /src/kpackage/kpackage.qdoc: -------------------------------------------------------------------------------- 1 | /*! 2 | \module KPackage 3 | \title KPackage C++ Classes 4 | \ingroup modules 5 | \cmakepackage KF6 6 | \cmakecomponent Package 7 | 8 | \brief Installation and loading of additional content (ex: scripts, images...) as packages. 9 | */ 10 | -------------------------------------------------------------------------------- /src/kpackage/kpackage.qdocconf: -------------------------------------------------------------------------------- 1 | include($KDE_DOCS/global/qt-module-defaults.qdocconf) 2 | 3 | project = KPackage 4 | description = Installation and loading of additional content (ex: scripts, images...) as packages. 5 | 6 | documentationinheaders = true 7 | 8 | headerdirs += . 9 | sourcedirs += . 10 | 11 | outputformats = HTML 12 | 13 | navigation.landingpage = "KPackage" 14 | 15 | depends += \ 16 | kde \ 17 | qtcore 18 | 19 | qhp.projects = KPackage 20 | 21 | qhp.KPackage.file = kpackage.qhp 22 | qhp.KPackage.namespace = org.kde.kpackage.$QT_VERSION_TAG 23 | qhp.KPackage.virtualFolder = kpackage 24 | qhp.KPackage.indexTitle = KPackage 25 | qhp.KPackage.indexRoot = 26 | 27 | qhp.KPackage.subprojects = classes 28 | qhp.KPackage.subprojects.classes.title = C++ Classes 29 | qhp.KPackage.subprojects.classes.indexTitle = KPackage C++ Classes 30 | qhp.KPackage.subprojects.classes.selectors = class fake:headerfile 31 | qhp.KPackage.subprojects.classes.sortPages = true 32 | 33 | tagfile = kpackage.tags 34 | -------------------------------------------------------------------------------- /src/kpackage/packagejob.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2012 Sebastian Kügler 3 | SPDX-FileCopyrightText: 2023 Alexander Lohnau 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #include "packagejob.h" 9 | 10 | #include "config-package.h" 11 | #include "packageloader.h" 12 | #include "packagestructure.h" 13 | #include "private/package_p.h" 14 | #include "private/packagejobthread_p.h" 15 | #include "private/utils.h" 16 | 17 | #include "kpackage_debug.h" 18 | 19 | #if HAVE_QTDBUS 20 | #include 21 | #include 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace KPackage 30 | { 31 | struct StructureOrErrorJob { 32 | PackageStructure *structure = nullptr; 33 | PackageJob *errorJob = nullptr; 34 | }; 35 | class PackageJobPrivate 36 | { 37 | public: 38 | static StructureOrErrorJob loadStructure(const QString &packageFormat) 39 | { 40 | if (auto structure = PackageLoader::self()->loadPackageStructure(packageFormat)) { 41 | return StructureOrErrorJob{structure, nullptr}; 42 | } else { 43 | auto job = new PackageJob(PackageJob::Install, Package(), QString(), QString()); 44 | job->setErrorText(QStringLiteral("Could not load package structure ") + packageFormat); 45 | job->setError(PackageJob::JobError::InvalidPackageStructure); 46 | QTimer::singleShot(0, job, [job]() { 47 | job->emitResult(); 48 | }); 49 | return StructureOrErrorJob{nullptr, job}; 50 | } 51 | } 52 | PackageJobThread *thread = nullptr; 53 | Package package; 54 | QString installPath; 55 | }; 56 | 57 | PackageJob::PackageJob(OperationType type, const Package &package, const QString &src, const QString &dest) 58 | : KJob() 59 | , d(new PackageJobPrivate) 60 | { 61 | d->thread = new PackageJobThread(type, src, dest, package); 62 | d->package = package; 63 | 64 | connect(d->thread, &PackageJobThread::installPathChanged, this, [this](const QString &installPath) { 65 | d->package.setPath(installPath); 66 | }); 67 | 68 | // setupNotificationsOnJobFinished connects to jobThreadFinished, 69 | // don't connect to it again 70 | if (type == Install) { 71 | setupNotificationsOnJobFinished(QStringLiteral("packageInstalled")); 72 | } else if (type == Update) { 73 | setupNotificationsOnJobFinished(QStringLiteral("packageUpdated")); 74 | d->thread->update(src, dest, package); 75 | } else if (type == Uninstall) { 76 | setupNotificationsOnJobFinished(QStringLiteral("packageUninstalled")); 77 | } else { 78 | Q_UNREACHABLE(); 79 | } 80 | } 81 | 82 | PackageJob::~PackageJob() = default; 83 | 84 | void PackageJob::start() 85 | { 86 | if (d->thread) { 87 | QThreadPool::globalInstance()->start(d->thread); 88 | d->thread = nullptr; 89 | } else { 90 | qCWarning(KPACKAGE_LOG) << "The KPackage::PackageJob was already started"; 91 | } 92 | } 93 | 94 | PackageJob *PackageJob::install(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot) 95 | { 96 | auto structOrErr = PackageJobPrivate::loadStructure(packageFormat); 97 | if (auto structure = structOrErr.structure) { 98 | Package package(structure); 99 | package.setPath(sourcePackage); 100 | QString dest = packageRoot.isEmpty() ? package.defaultPackageRoot() : packageRoot; 101 | PackageLoader::invalidateCache(); 102 | 103 | // use absolute paths if passed, otherwise go under share 104 | if (!QDir::isAbsolutePath(dest)) { 105 | dest = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + dest; 106 | } 107 | auto job = new PackageJob(Install, package, sourcePackage, dest); 108 | job->start(); 109 | return job; 110 | } else { 111 | return structOrErr.errorJob; 112 | } 113 | } 114 | 115 | PackageJob *PackageJob::update(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot) 116 | { 117 | auto structOrErr = PackageJobPrivate::loadStructure(packageFormat); 118 | if (auto structure = structOrErr.structure) { 119 | Package package(structure); 120 | package.setPath(sourcePackage); 121 | QString dest = packageRoot.isEmpty() ? package.defaultPackageRoot() : packageRoot; 122 | PackageLoader::invalidateCache(); 123 | 124 | // use absolute paths if passed, otherwise go under share 125 | if (!QDir::isAbsolutePath(dest)) { 126 | dest = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + dest; 127 | } 128 | auto job = new PackageJob(Update, package, sourcePackage, dest); 129 | job->start(); 130 | return job; 131 | } else { 132 | return structOrErr.errorJob; 133 | } 134 | } 135 | 136 | PackageJob *PackageJob::uninstall(const QString &packageFormat, const QString &pluginId, const QString &packageRoot) 137 | { 138 | auto structOrErr = PackageJobPrivate::loadStructure(packageFormat); 139 | if (auto structure = structOrErr.structure) { 140 | Package package(structure); 141 | QString uninstallPath; 142 | // We handle the empty path when uninstalling the package 143 | // If the dir already got deleted the pluginId is an empty string, without this 144 | // check we would delete the package root, BUG: 410682 145 | if (!pluginId.isEmpty()) { 146 | uninstallPath = packageRoot + QLatin1Char('/') + pluginId; 147 | } 148 | package.setPath(uninstallPath); 149 | 150 | PackageLoader::invalidateCache(); 151 | auto job = new PackageJob(Uninstall, package, QString(), QString()); 152 | job->start(); 153 | return job; 154 | } else { 155 | return structOrErr.errorJob; 156 | } 157 | } 158 | 159 | KPackage::Package PackageJob::package() const 160 | { 161 | return d->package; 162 | } 163 | void PackageJob::setupNotificationsOnJobFinished(const QString &messageName) 164 | { 165 | // capture first as uninstalling wipes d->package 166 | // or d-package can become dangling during the job if deleted externally 167 | const QString pluginId = d->package.metadata().pluginId(); 168 | const QString kpackageType = readKPackageType(d->package.metadata()); 169 | 170 | auto onJobFinished = [=, this](bool ok, JobError errorCode, const QString &error) { 171 | #if HAVE_QTDBUS 172 | if (ok) { 173 | auto msg = QDBusMessage::createSignal(QStringLiteral("/KPackage/") + kpackageType, QStringLiteral("org.kde.plasma.kpackage"), messageName); 174 | msg.setArguments({pluginId}); 175 | QDBusConnection::sessionBus().send(msg); 176 | } 177 | #endif 178 | 179 | if (ok) { 180 | setError(NoError); 181 | } else { 182 | setError(errorCode); 183 | setErrorText(error); 184 | } 185 | emitResult(); 186 | }; 187 | connect(d->thread, &PackageJobThread::jobThreadFinished, this, onJobFinished, Qt::QueuedConnection); 188 | } 189 | 190 | } // namespace KPackage 191 | 192 | #include "moc_packagejob.cpp" 193 | -------------------------------------------------------------------------------- /src/kpackage/packagejob.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2012 Sebastian Kügler 3 | SPDX-FileCopyrightText: 2023 Alexander Lohnau 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef KPACKAGE_PACKAGEJOB_H 9 | #define KPACKAGE_PACKAGEJOB_H 10 | 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | namespace KPackage 17 | { 18 | class PackageJobPrivate; 19 | class Package; 20 | class PackageStructure; 21 | 22 | /*! 23 | * \class KPackage::PackageJob 24 | * \inheaderfile KPackage/PackageJob 25 | * \inmodule KPackage 26 | * 27 | * \brief KJob subclass that allows async install/update/uninstall operations for packages. 28 | */ 29 | class KPACKAGE_EXPORT PackageJob : public KJob 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | /*! 35 | * Error codes for the install/update/remove jobs 36 | * 37 | * \value InvalidPackageStructure Could not find/load the given package structure 38 | * \value RootCreationError Cannot create package root directory 39 | * \value PackageFileNotFoundError The package file does not exist 40 | * \value UnsupportedArchiveFormatError The archive format of the package is not supported 41 | * \value PackageOpenError Can't open the package file for reading 42 | * \value PluginIdInvalidError The plugin id is not specified in the metadata.json file or contains characters different from letters, digits, dots and 43 | * underscores 44 | * \value UpdatePackageTypeMismatchError A package with this plugin id was already installed, but has a different type in the metadata.json file 45 | * \value OldVersionRemovalError Failed to remove the old version of the package during an upgrade 46 | * \value NewerVersionAlreadyInstalledError We tried to update, but the same version or a newer one is already installed 47 | * \value PackageAlreadyInstalledError The package is already installed and a normal install (not update) was performed 48 | * \value PackageMoveError Failure to move a package from the system temporary folder to its final destination 49 | * \value PackageCopyError Failure to copy a package folder from somewhere in the filesystem to its final destination 50 | * \value PackageUninstallError Failure to uninstall a package 51 | */ 52 | enum JobError { 53 | InvalidPackageStructure = KJob::UserDefinedError + 1, 54 | RootCreationError, 55 | PackageFileNotFoundError, 56 | UnsupportedArchiveFormatError, 57 | PackageOpenError, 58 | PluginIdInvalidError, 59 | UpdatePackageTypeMismatchError, 60 | OldVersionRemovalError, 61 | NewerVersionAlreadyInstalledError, 62 | PackageAlreadyInstalledError, 63 | PackageMoveError, 64 | PackageCopyError, 65 | PackageUninstallError, 66 | }; 67 | 68 | ~PackageJob() override; 69 | /*! 70 | * Installs the given package. The returned job is already started 71 | */ 72 | static PackageJob *install(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot = QString()); 73 | /*! 74 | * Installs the given package. The returned job is already started 75 | */ 76 | static PackageJob *update(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot = QString()); 77 | /*! 78 | * Installs the given package. The returned job is already started 79 | */ 80 | static PackageJob *uninstall(const QString &packageFormat, const QString &pluginId, const QString &packageRoot = QString()); 81 | 82 | /*! 83 | * 84 | */ 85 | KPackage::Package package() const; 86 | 87 | private: 88 | friend class PackageJobThread; 89 | enum OperationType { 90 | Install, 91 | Update, 92 | Uninstall, 93 | }; 94 | void start() override; 95 | 96 | KPACKAGE_NO_EXPORT explicit PackageJob(OperationType type, const Package &package, const QString &src, const QString &dest); 97 | KPACKAGE_NO_EXPORT void setupNotificationsOnJobFinished(const QString &messageName); 98 | 99 | const std::unique_ptr d; 100 | friend PackageJobPrivate; 101 | }; 102 | 103 | } 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /src/kpackage/packageloader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010 Ryan Rix 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include "packageloader.h" 8 | #include "private/packageloader_p.h" 9 | #include "private/utils.h" 10 | 11 | #include "kpackage_debug.h" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "config-package.h" 24 | 25 | #include "package.h" 26 | #include "packagestructure.h" 27 | #include "private/packagejobthread_p.h" 28 | #include "private/packages_p.h" 29 | 30 | namespace KPackage 31 | { 32 | PackageLoader::PackageLoader() 33 | : d(new PackageLoaderPrivate) 34 | { 35 | } 36 | 37 | PackageLoader::~PackageLoader() 38 | { 39 | for (auto wp : std::as_const(d->structures)) { 40 | delete wp.data(); 41 | } 42 | delete d; 43 | } 44 | 45 | PackageLoader *PackageLoader::self() 46 | { 47 | static PackageLoader *s_packageTrader = new PackageLoader; 48 | return s_packageTrader; 49 | } 50 | 51 | Package PackageLoader::loadPackage(const QString &packageFormat, const QString &packagePath) 52 | { 53 | if (packageFormat.isEmpty()) { 54 | return Package(); 55 | } 56 | 57 | if (PackageStructure *structure = loadPackageStructure(packageFormat)) { 58 | Package p(structure); 59 | if (!packagePath.isEmpty()) { 60 | p.setPath(packagePath); 61 | } 62 | return p; 63 | } 64 | 65 | return Package(); 66 | } 67 | 68 | QList PackageLoader::listKPackages(const QString &packageFormat, const QString &packageRoot) 69 | { 70 | QList lst; 71 | 72 | // has been a root specified? 73 | QString actualRoot = packageRoot; 74 | 75 | PackageStructure *structure = d->structures.value(packageFormat).data(); 76 | // try to take it from the package structure 77 | if (actualRoot.isEmpty()) { 78 | if (!structure) { 79 | if (packageFormat == QLatin1String("KPackage/Generic")) { 80 | structure = new GenericPackage(); 81 | } else if (packageFormat == QLatin1String("KPackage/GenericQML")) { 82 | structure = new GenericQMLPackage(); 83 | } else { 84 | structure = loadPackageStructure(packageFormat); 85 | } 86 | } 87 | 88 | if (structure) { 89 | d->structures.insert(packageFormat, structure); 90 | actualRoot = Package(structure).defaultPackageRoot(); 91 | } 92 | } 93 | 94 | if (actualRoot.isEmpty()) { 95 | actualRoot = packageFormat; 96 | } 97 | 98 | QStringList paths; 99 | if (QDir::isAbsolutePath(actualRoot)) { 100 | paths = QStringList(actualRoot); 101 | } else { 102 | const auto listPath = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); 103 | for (const QString &path : listPath) { 104 | paths += path + QLatin1Char('/') + actualRoot; 105 | } 106 | } 107 | 108 | for (auto const &plugindir : std::as_const(paths)) { 109 | QDirIterator it(plugindir, QDir::Dirs | QDir::NoDotAndDotDot); 110 | std::unordered_set dirs; 111 | while (it.hasNext()) { 112 | it.next(); 113 | 114 | const QString dir = it.filePath(); 115 | if (!dirs.insert(it.fileInfo().fileName()).second) { 116 | continue; 117 | } 118 | Package package(structure); 119 | package.setPath(dir); 120 | if (package.isValid()) { 121 | // Ignore packages with empty metadata here 122 | if (packageFormat.isEmpty() || !package.metadata().isValid() || readKPackageType(package.metadata()) == packageFormat) { 123 | lst << package; 124 | } else { 125 | qInfo() << "KPackage in" << package.path() << readKPackageType(package.metadata()) << "does not match requested format" << packageFormat; 126 | } 127 | } 128 | } 129 | } 130 | return lst; 131 | } 132 | QList PackageLoader::listPackages(const QString &packageFormat, const QString &packageRoot) 133 | { 134 | // Note: Use QDateTime::currentSecsSinceEpoch() once we can depend on Qt 5.8 135 | const qint64 now = qRound64(QDateTime::currentMSecsSinceEpoch() / 1000.0); 136 | bool useRuntimeCache = true; 137 | if (now - d->pluginCacheAge > d->maxCacheAge && d->pluginCacheAge != 0) { 138 | // cache is old and we're not within a few seconds of startup anymore 139 | useRuntimeCache = false; 140 | d->pluginCache.clear(); 141 | } 142 | 143 | const QString cacheKey = packageFormat + QLatin1Char('.') + packageRoot; 144 | if (useRuntimeCache) { 145 | auto it = d->pluginCache.constFind(cacheKey); 146 | if (it != d->pluginCache.constEnd()) { 147 | return *it; 148 | } 149 | } 150 | if (d->pluginCacheAge == 0) { 151 | d->pluginCacheAge = now; 152 | } 153 | 154 | QList lst; 155 | 156 | // has been a root specified? 157 | QString actualRoot = packageRoot; 158 | 159 | // try to take it from the package structure 160 | if (actualRoot.isEmpty()) { 161 | PackageStructure *structure = d->structures.value(packageFormat).data(); 162 | if (!structure) { 163 | if (packageFormat == QLatin1String("KPackage/Generic")) { 164 | structure = new GenericPackage(); 165 | } else if (packageFormat == QLatin1String("KPackage/GenericQML")) { 166 | structure = new GenericQMLPackage(); 167 | } else { 168 | structure = loadPackageStructure(packageFormat); 169 | } 170 | } 171 | 172 | if (structure) { 173 | d->structures.insert(packageFormat, structure); 174 | Package p(structure); 175 | actualRoot = p.defaultPackageRoot(); 176 | } 177 | } 178 | 179 | if (actualRoot.isEmpty()) { 180 | actualRoot = packageFormat; 181 | } 182 | 183 | QSet uniqueIds; 184 | QStringList paths; 185 | if (QDir::isAbsolutePath(actualRoot)) { 186 | paths = QStringList(actualRoot); 187 | } else { 188 | const auto listPath = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); 189 | for (const QString &path : listPath) { 190 | paths += path + QLatin1Char('/') + actualRoot; 191 | } 192 | } 193 | 194 | for (auto const &plugindir : std::as_const(paths)) { 195 | QDirIterator it(plugindir, QStringList{QStringLiteral("metadata.json")}, QDir::Files, QDirIterator::Subdirectories); 196 | std::unordered_set dirs; 197 | while (it.hasNext()) { 198 | it.next(); 199 | 200 | const QString dir = it.fileInfo().absoluteDir().path(); 201 | if (!dirs.insert(dir).second) { 202 | continue; 203 | } 204 | 205 | const QString metadataPath = it.fileInfo().absoluteFilePath(); 206 | KPluginMetaData info = KPluginMetaData::fromJsonFile(metadataPath); 207 | 208 | if (!info.isValid() || uniqueIds.contains(info.pluginId())) { 209 | continue; 210 | } 211 | 212 | if (packageFormat.isEmpty() || readKPackageType(info) == packageFormat) { 213 | uniqueIds << info.pluginId(); 214 | lst << info; 215 | } else { 216 | qInfo() << "KPackageStructure of" << info << "does not match requested format" << packageFormat; 217 | } 218 | } 219 | } 220 | 221 | if (useRuntimeCache) { 222 | d->pluginCache.insert(cacheKey, lst); 223 | } 224 | return lst; 225 | } 226 | 227 | QList PackageLoader::listPackagesMetadata(const QString &packageFormat, const QString &packageRoot) 228 | { 229 | return listPackages(packageFormat, packageRoot); 230 | } 231 | 232 | QList 233 | PackageLoader::findPackages(const QString &packageFormat, const QString &packageRoot, std::function filter) 234 | { 235 | QList lst; 236 | const auto lstPlugins = listPackages(packageFormat, packageRoot); 237 | for (auto const &plugin : lstPlugins) { 238 | if (!filter || filter(plugin)) { 239 | lst << plugin; 240 | } 241 | } 242 | return lst; 243 | } 244 | 245 | KPackage::PackageStructure *PackageLoader::loadPackageStructure(const QString &packageFormat) 246 | { 247 | PackageStructure *structure = d->structures.value(packageFormat).data(); 248 | if (!structure) { 249 | if (packageFormat == QLatin1String("KPackage/Generic")) { 250 | structure = new GenericPackage(); 251 | d->structures.insert(packageFormat, structure); 252 | } else if (packageFormat == QLatin1String("KPackage/GenericQML")) { 253 | structure = new GenericQMLPackage(); 254 | d->structures.insert(packageFormat, structure); 255 | } 256 | } 257 | 258 | if (structure) { 259 | return structure; 260 | } 261 | 262 | const KPluginMetaData metaData = structureForKPackageType(packageFormat); 263 | if (!metaData.isValid()) { 264 | qCWarning(KPACKAGE_LOG) << "Invalid metadata for package structure" << packageFormat; 265 | return nullptr; 266 | } 267 | 268 | auto result = KPluginFactory::instantiatePlugin(metaData); 269 | if (!result) { 270 | qCWarning(KPACKAGE_LOG).noquote() << "Could not load installer for package of type" << packageFormat << "Error reported was: " << result.errorString; 271 | return nullptr; 272 | } 273 | 274 | structure = result.plugin; 275 | 276 | d->structures.insert(packageFormat, structure); 277 | 278 | return structure; 279 | } 280 | 281 | void PackageLoader::addKnownPackageStructure(const QString &packageFormat, KPackage::PackageStructure *structure) 282 | { 283 | d->structures.insert(packageFormat, structure); 284 | } 285 | 286 | void PackageLoader::invalidateCache() 287 | { 288 | self()->d->maxCacheAge = -1; 289 | } 290 | 291 | } // KPackage Namespace 292 | -------------------------------------------------------------------------------- /src/kpackage/packageloader.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010 Ryan Rix 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef KPACKAGE_LOADER_H 8 | #define KPACKAGE_LOADER_H 9 | 10 | #include 11 | 12 | #include 13 | 14 | namespace KPackage 15 | { 16 | class PackageLoaderPrivate; 17 | 18 | /*! 19 | * \class KPackage::PackageLoader 20 | * \inheaderfile KPackage/PackageLoader 21 | * \inmodule KPackage 22 | * 23 | * This is an abstract base class which defines an interface to which the package 24 | * loading logic can communicate with a parent application. The plugin loader 25 | * must be set before any plugins are loaded, otherwise (for safety reasons), the 26 | * default PackageLoader implementation will be used. The reimplemented version should 27 | * not do more than simply returning a loaded plugin. It should not init() it, and it should not 28 | * hang on to it. 29 | * 30 | **/ 31 | class KPACKAGE_EXPORT PackageLoader 32 | { 33 | public: 34 | /*! 35 | * Load a Package plugin. 36 | * 37 | * \a packageFormat the format of the package to load 38 | * 39 | * \a packagePath the package name: the path of the package relative to the 40 | * packageFormat root path. If not specified it will have to be set manually 41 | * with Package::setPath() by the caller. 42 | * 43 | * Returns a Package object matching name, or an invalid package on failure 44 | **/ 45 | Package loadPackage(const QString &packageFormat, const QString &packagePath = QString()); 46 | 47 | /*! 48 | * List all available packages of a certain type 49 | * 50 | * \a packageFormat the format of the packages to list 51 | * 52 | * \a packageRoot the root folder where the packages are installed. 53 | * If not specified the default from the packageformat will be taken. 54 | * 55 | * Returns metadata for all the matching packages 56 | */ 57 | QList listPackages(const QString &packageFormat, const QString &packageRoot = QString()); 58 | 59 | /*! 60 | * \sa listPackages() 61 | * \since 6.0 62 | */ 63 | QList listPackagesMetadata(const QString &packageFormat, const QString &packageRoot = QString()); 64 | 65 | /*! 66 | * List all available packages of a certain type. This should be used in case the package structure modifies the metadata or you need to access the 67 | * contained files of the package. 68 | * 69 | * \a packageFormat the format of the packages to list 70 | * 71 | * \a packageRoot the root folder where the packages are installed. 72 | * If not specified the default from the packageformat will be taken. 73 | * 74 | * \since 6.0 75 | */ 76 | QList listKPackages(const QString &packageFormat, const QString &packageRoot = QString()); 77 | 78 | /*! 79 | * List package of a certain type that match a certain filter function 80 | * 81 | * \a packageFormat the format of the packages to list 82 | * 83 | * \a packageRoot the root folder where the packages are installed. 84 | * If not specified the default from the packageformat will be taken. 85 | * 86 | * \a filter a filter function that will be called on each package: 87 | * will return true for the matching ones 88 | * 89 | * Returns metadata for all the matching packages 90 | * \since 5.10 91 | */ 92 | QList findPackages(const QString &packageFormat, 93 | const QString &packageRoot = QString(), 94 | std::function filter = std::function()); 95 | 96 | /*! 97 | * Loads a PackageStructure for a given format. The structure can then be used as 98 | * paramenter for a Package instance constructor 99 | * 100 | * \note The returned pointer is managed by KPackage, and should never be deleted 101 | * 102 | * \a packageFormat the package format, such as "KPackage/GenericQML" 103 | * 104 | * Returns the structure instance (ownership retained by KPackage) 105 | */ 106 | KPackage::PackageStructure *loadPackageStructure(const QString &packageFormat); 107 | 108 | /*! 109 | * Adds a new known package structure that can be used by the functions to load packages such 110 | * as loadPackage, findPackages etc 111 | * 112 | * \a packageFormat the package format, such as "KPackage/GenericQML" 113 | * 114 | * \a structure the package structure we want to be able to load packages from 115 | * 116 | * \since 5.10 117 | */ 118 | void addKnownPackageStructure(const QString &packageFormat, KPackage::PackageStructure *structure); 119 | 120 | /*! 121 | * Return the active plugin loader 122 | **/ 123 | static PackageLoader *self(); 124 | 125 | protected: 126 | PackageLoader(); 127 | virtual ~PackageLoader(); 128 | 129 | private: 130 | friend class Package; 131 | friend class PackageJob; 132 | KPACKAGE_NO_EXPORT static void invalidateCache(); 133 | 134 | PackageLoaderPrivate *const d; 135 | Q_DISABLE_COPY(PackageLoader) 136 | }; 137 | 138 | } 139 | 140 | Q_DECLARE_METATYPE(KPackage::PackageLoader *) 141 | 142 | #endif 143 | -------------------------------------------------------------------------------- /src/kpackage/packagestructure.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Aaron Seigo 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include "packagestructure.h" 8 | #include "kpackage_debug.h" 9 | #include "packagejob.h" 10 | #include "private/package_p.h" 11 | 12 | namespace KPackage 13 | { 14 | PackageStructure::PackageStructure(QObject *parent, const QVariantList & /*args*/) 15 | : QObject(parent) 16 | { 17 | Q_UNUSED(d) 18 | } 19 | 20 | PackageStructure::~PackageStructure() 21 | { 22 | } 23 | 24 | void PackageStructure::initPackage(Package * /*package*/) 25 | { 26 | } 27 | 28 | void PackageStructure::pathChanged(Package * /*package*/) 29 | { 30 | } 31 | 32 | } 33 | 34 | #include "moc_packagestructure.cpp" 35 | -------------------------------------------------------------------------------- /src/kpackage/packagestructure.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Aaron Seigo 3 | SPDX-FileCopyrightText: 2023 Alexander Lohnau 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef KPACKAGE_PACKAGESTRUCTURE_H 9 | #define KPACKAGE_PACKAGESTRUCTURE_H 10 | 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | namespace KPackage 19 | { 20 | /*! 21 | * \class KPackage::PackageStructure 22 | * \inheaderfile Package/PackageStructure 23 | * \inmodule KPackage 24 | * 25 | * \brief This class is used to define the filesystem structure of a package type. 26 | * 27 | * A PackageStructure is implemented as a dynamically loaded plugin, in the reimplementation 28 | * of initPackage the allowed fines and directories in the package are set into the package, 29 | * for instance: 30 | * 31 | * \code 32 | * package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); 33 | * package->setDefaultPackageRoot(QStringLiteral("plasma/wallpapers/")); 34 | * package->addDirectoryDefinition("images", QStringLiteral("images")); 35 | * package->addDirectoryDefinition("theme", QStringLiteral("theme")); 36 | * QStringList mimetypes{QStringLiteral("image/svg+xml"), QStringLiteral("image/png"), QStringLiteral("image/jpeg")}; 37 | * package->setMimeTypes("images", mimetypes); 38 | * \endcode 39 | */ 40 | class KPACKAGE_EXPORT PackageStructure : public QObject 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | /*! 46 | */ 47 | explicit PackageStructure(QObject *parent = nullptr, const QVariantList &args = QVariantList()); 48 | 49 | ~PackageStructure() override; 50 | 51 | /*! 52 | * Called when a the PackageStructure should initialize a Package with the initial 53 | * structure. This allows setting paths before setPath is called. 54 | * 55 | * \note one special value is "metadata" which can be set to the location of KPluginMetaData 56 | * compatible .json file within the package. If not defined, it is assumed that this file 57 | * exists under the top level directory of the package. 58 | * 59 | * \a package the Package to set up. The object is empty of all definition when 60 | * first passed in. 61 | */ 62 | virtual void initPackage(Package *package); 63 | 64 | /*! 65 | * Called whenever the path changes so that subclasses may take 66 | * package specific actions. 67 | */ 68 | virtual void pathChanged(Package *package); 69 | 70 | private: 71 | void *d; 72 | }; 73 | 74 | } // KPackage namespace 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/kpackage/packagestructure_compat_p.h: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2023 Alexander Lohnau 2 | // SPDX-License-Identifier: LGPL-2.0-or-later 3 | 4 | #ifndef KPACKAGE_PACKAGESTRUCTURE_COMPAT_P_H 5 | #define KPACKAGE_PACKAGESTRUCTURE_COMPAT_P_H 6 | 7 | #include 8 | #include 9 | 10 | class KConfigGroup; 11 | class KDesktopFile; 12 | namespace KPackagePrivate 13 | { 14 | template 15 | /*! 16 | * \internal 17 | * \a package KPackage which will have the desktop file metadata set to (if present) 18 | * \a customValueTypes Additional keys and their types that should be read from the desktop file 19 | */ 20 | void convertCompatMetaDataDesktopFile(KPackage::Package *package, const QMap &customValueTypes = {}) 21 | { 22 | if (const QString legacyPath = package->filePath("metadata"); !legacyPath.isEmpty() && legacyPath.endsWith(QLatin1String(".desktop"))) { 23 | DesktopFile file(legacyPath); 24 | const ConfigGroup grp = file.desktopGroup(); 25 | QJsonObject kplugin{ 26 | {QLatin1String("Name"), grp.readEntry("Name")}, 27 | {QLatin1String("Description"), grp.readEntry("Comment")}, 28 | {QLatin1String("Icon"), grp.readEntry("Icon")}, 29 | {QLatin1String("Version"), grp.readEntry("X-KDE-PluginInfo-Version")}, 30 | {QLatin1String("Id"), grp.readEntry("X-KDE-PluginInfo-Name")}, 31 | }; 32 | QJsonObject obj{ 33 | {QLatin1String("KPlugin"), kplugin}, 34 | {QLatin1String("KPackageStructure"), grp.readEntry("X-KDE-ServiceTypes")}, 35 | }; 36 | for (auto it = customValueTypes.begin(), end = customValueTypes.end(); it != end; ++it) { 37 | if (const QString value = grp.readEntry(it.key()); !value.isEmpty()) { 38 | if (QVariant variant(value); variant.convert(QMetaType(it.value()))) { // Make sure the type in resulting json is what the API caller needs 39 | obj.insert(it.key(), QJsonValue::fromVariant(variant)); 40 | } 41 | } 42 | } 43 | package->setMetadata(KPluginMetaData(obj, legacyPath)); 44 | } 45 | } 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/kpackage/private/package_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2009 Rob Scheepmaker 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef KPACKAGE_PACKAGE_P_H 8 | #define KPACKAGE_PACKAGE_P_H 9 | 10 | #include "../package.h" 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | namespace KPackage 20 | { 21 | class ContentStructure 22 | { 23 | public: 24 | ContentStructure() 25 | { 26 | } 27 | 28 | ContentStructure(const ContentStructure &other) 29 | { 30 | paths = other.paths; 31 | mimeTypes = other.mimeTypes; 32 | directory = other.directory; 33 | required = other.required; 34 | } 35 | 36 | ContentStructure &operator=(const ContentStructure &) = default; 37 | 38 | QStringList paths; 39 | QStringList mimeTypes; 40 | bool directory = false; 41 | bool required = false; 42 | }; 43 | 44 | class PackagePrivate : public QSharedData 45 | { 46 | public: 47 | PackagePrivate(); 48 | PackagePrivate(const PackagePrivate &other); 49 | ~PackagePrivate(); 50 | 51 | PackagePrivate &operator=(const PackagePrivate &rhs); 52 | 53 | void createPackageMetadata(const QString &path); 54 | QString unpack(const QString &filePath); 55 | void updateHash(const QString &basePath, const QString &subPath, const QDir &dir, QCryptographicHash &hash); 56 | QString fallbackFilePath(const QByteArray &key, const QString &filename = QString()) const; 57 | bool hasCycle(const KPackage::Package &package); 58 | bool isInsidePackageDir(const QString &canonicalPath) const; 59 | 60 | QPointer structure; 61 | QString path; 62 | QString tempRoot; 63 | QStringList contentsPrefixPaths; 64 | QString defaultPackageRoot; 65 | QHash discoveries; 66 | QHash contents; 67 | std::unique_ptr fallbackPackage; 68 | QStringList mimeTypes; 69 | std::optional metadata; 70 | bool externalPaths = false; 71 | bool valid = false; 72 | bool checkedValid = false; 73 | }; 74 | 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/kpackage/private/packagejobthread_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2009 Aaron Seigo 3 | SPDX-FileCopyrightText: 2012 Sebastian Kügler 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef KPACKAGE_PACKAGEJOBTHREAD_P_H 9 | #define KPACKAGE_PACKAGEJOBTHREAD_P_H 10 | 11 | #include "package.h" 12 | #include "packagejob.h" 13 | #include 14 | 15 | namespace KPackage 16 | { 17 | class PackageJobThreadPrivate; 18 | 19 | bool indexDirectory(const QString &dir, const QString &dest); 20 | 21 | class PackageJobThread : public QObject, public QRunnable 22 | { 23 | Q_OBJECT 24 | public: 25 | explicit PackageJobThread(PackageJob::OperationType type, const QString &src, const QString &dest, const KPackage::Package &package); 26 | ~PackageJobThread() override; 27 | 28 | void run() override; 29 | 30 | bool install(const QString &src, const QString &dest, const Package &package); 31 | bool update(const QString &src, const QString &dest, const Package &package); 32 | bool uninstall(const QString &packagePath); 33 | 34 | PackageJob::JobError errorCode() const; 35 | 36 | Q_SIGNALS: 37 | void jobThreadFinished(bool success, PackageJob::JobError errorCode, const QString &errorMessage = QString()); 38 | void percentChanged(int percent); 39 | void error(const QString &errorMessage); 40 | void installPathChanged(const QString &installPath); 41 | 42 | private: 43 | // OperationType says whether we want to install, update or any 44 | // new similar operation it will be expanded 45 | bool installDependency(const QUrl &src); 46 | bool installPackage(const QString &src, const QString &dest, const Package &package, PackageJob::OperationType operation); 47 | bool uninstallPackage(const QString &packagePath); 48 | PackageJobThreadPrivate *d; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/kpackage/private/packageloader_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010 Ryan Rix 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #ifndef KPACKAGE_PACKAGELOADER_P_H 8 | #define KPACKAGE_PACKAGELOADER_P_H 9 | 10 | #include "packagestructure.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace KPackage 16 | { 17 | class PackageLoaderPrivate 18 | { 19 | public: 20 | QHash> structures; 21 | // We only use this cache during start of the process to speed up many consecutive calls 22 | // After that, we're too afraid to produce race conditions and it's not that time-critical anyway 23 | // the 20 seconds here means that the cache is only used within 20sec during startup, after that, 24 | // complexity goes up and we'd have to update the cache in order to avoid subtle bugs 25 | // just not using the cache is way easier then, since it doesn't make *that* much of a difference, 26 | // anyway 27 | int maxCacheAge = 20; 28 | qint64 pluginCacheAge = 0; 29 | QHash> pluginCache; 30 | }; 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/kpackage/private/packages.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007-2009 Aaron Seigo 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #include "packages_p.h" 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include "kpackage/package.h" 14 | 15 | void GenericPackage::initPackage(KPackage::Package *package) 16 | { 17 | KPackage::PackageStructure::initPackage(package); 18 | 19 | package->setDefaultPackageRoot(QStringLiteral("kpackage/generic/")); 20 | 21 | package->addDirectoryDefinition("images", QStringLiteral("images")); 22 | package->addDirectoryDefinition("theme", QStringLiteral("theme")); 23 | const QStringList mimetypes{QStringLiteral("image/svg+xml"), QStringLiteral("image/png"), QStringLiteral("image/jpeg")}; 24 | package->setMimeTypes("images", mimetypes); 25 | package->setMimeTypes("theme", mimetypes); 26 | 27 | package->addDirectoryDefinition("config", QStringLiteral("config")); 28 | package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")}); 29 | 30 | package->addDirectoryDefinition("ui", QStringLiteral("ui")); 31 | 32 | package->addDirectoryDefinition("data", QStringLiteral("data")); 33 | 34 | package->addDirectoryDefinition("scripts", QStringLiteral("code")); 35 | package->setMimeTypes("scripts", QStringList{QStringLiteral("text/plain")}); 36 | 37 | package->addDirectoryDefinition("translations", QStringLiteral("locale")); 38 | } 39 | 40 | void GenericQMLPackage::initPackage(KPackage::Package *package) 41 | { 42 | GenericPackage::initPackage(package); 43 | 44 | package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); 45 | package->setRequired("mainscript", true); 46 | package->setDefaultPackageRoot(QStringLiteral("kpackage/genericqml/")); 47 | } 48 | 49 | #include "moc_packages_p.cpp" 50 | -------------------------------------------------------------------------------- /src/kpackage/private/packages_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Aaron Seigo 3 | 4 | SPDX-License-Identifier: LGPL-2.0-or-later 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "kpackage/packagestructure.h" 10 | 11 | class GenericPackage : public KPackage::PackageStructure 12 | { 13 | Q_OBJECT 14 | public: 15 | void initPackage(KPackage::Package *package) override; 16 | }; 17 | 18 | class GenericQMLPackage : public GenericPackage 19 | { 20 | Q_OBJECT 21 | public: 22 | void initPackage(KPackage::Package *package) override; 23 | }; 24 | -------------------------------------------------------------------------------- /src/kpackage/private/utils.h: -------------------------------------------------------------------------------- 1 | // SPDX-FileCopyrightText: 2021 Alexander Lohnau 2 | // SPDX-FileCopyrightText: 2021 Nicolas Fella 3 | // SPDX-License-Identifier: LGPL-2.1-or-later 4 | 5 | #pragma once 6 | 7 | #include "kpackage_debug.h" 8 | #include 9 | #include 10 | #include 11 | 12 | inline QString readKPackageType(const KPluginMetaData &metaData) 13 | { 14 | return metaData.value(QStringLiteral("KPackageStructure")); 15 | } 16 | 17 | inline KPluginMetaData structureForKPackageType(const QString &packageFormat) 18 | { 19 | const QString guessedPath = QStringLiteral("kf6/packagestructure/") + QString(packageFormat).toLower().replace(QLatin1Char('/'), QLatin1Char('_')); 20 | KPluginMetaData guessedData(guessedPath); 21 | if (guessedData.isValid() && readKPackageType(guessedData) == packageFormat) { 22 | return guessedData; 23 | } 24 | qCDebug(KPACKAGE_LOG) << "Could not find package structure for" << packageFormat << "by plugin path. The guessed path was" << guessedPath; 25 | 26 | const QList plugins = 27 | KPluginMetaData::findPlugins(QStringLiteral("kf6/packagestructure"), [packageFormat](const KPluginMetaData &metaData) { 28 | return readKPackageType(metaData) == packageFormat; 29 | }); 30 | return plugins.isEmpty() ? KPluginMetaData() : plugins.first(); 31 | } 32 | 33 | inline bool isVersionNewer(const QString &version1, const QString &version2) 34 | { 35 | const auto v1 = QVersionNumber::fromString(version1); 36 | const auto v2 = QVersionNumber::fromString(version2); 37 | return v2 > v1; 38 | } 39 | -------------------------------------------------------------------------------- /src/kpackagetool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(kpackagetool6) 2 | 3 | ecm_mark_nongui_executable(kpackagetool6) 4 | 5 | target_sources(kpackagetool6 PRIVATE 6 | main.cpp 7 | kpackagetool.cpp 8 | ) 9 | ecm_qt_declare_logging_category(kpackagetool6 10 | HEADER kpackage_debug.h 11 | IDENTIFIER KPACKAGE_LOG 12 | CATEGORY_NAME kf.package 13 | ) 14 | target_link_libraries(kpackagetool6 KF6::Archive KF6::Package KF6::I18n KF6::CoreAddons) 15 | 16 | install(TARGETS kpackagetool6 EXPORT KF6PackageToolsTargets ${KF_INSTALL_TARGETS_DEFAULT_ARGS}) 17 | -------------------------------------------------------------------------------- /src/kpackagetool/kpackagetool.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Aaron Seigo 3 | SPDX-FileCopyrightText: 2012 Sebastian Kügler 4 | 5 | SPDX-License-Identifier: LGPL-2.0-or-later 6 | */ 7 | 8 | #ifndef PACKAGETOOL_H 9 | #define PACKAGETOOL_H 10 | 11 | #include "package.h" 12 | #include "packagejob.h" 13 | #include 14 | 15 | class QCommandLineParser; 16 | class KJob; 17 | 18 | namespace KPackage 19 | { 20 | class PackageToolPrivate; 21 | 22 | class PackageTool : public QCoreApplication 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | PackageTool(int &argc, char **argv, QCommandLineParser *parser); 28 | ~PackageTool() override; 29 | 30 | void listPackages(const QString &kpackageType, const QString &path = QString()); 31 | void showPackageInfo(const QString &pluginName); 32 | void showAppstreamInfo(const QString &pluginName); 33 | QString resolvePackageRootWithOptions(); 34 | 35 | private Q_SLOTS: 36 | void runMain(); 37 | void packageInstalled(KPackage::PackageJob *job); 38 | void packageUninstalled(KPackage::PackageJob *job); 39 | 40 | private: 41 | PackageToolPrivate *d; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/kpackagetool/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Aaron Seigo 3 | SPDX-FileCopyrightText: 2013 Sebastian Kügler 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | /*! 9 | * kpackagetool6 exit codes used in this program 10 | 11 | 0 No error 12 | 13 | 1 Unspecified error 14 | 2 Plugin is not installed 15 | 3 Plugin or package invalid 16 | 4 Installation failed, see stderr for reason 17 | 5 Could not find a suitable installer for package type 18 | 6 No install option given 19 | 7 Conflicting arguments supplied 20 | 8 Uninstallation failed, see stderr for reason 21 | 9 Failed to generate package hash 22 | 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | #include "kpackagetool.h" 29 | #include "options.h" 30 | 31 | int main(int argc, char **argv) 32 | { 33 | QCommandLineParser parser; 34 | KPackage::PackageTool app(argc, argv, &parser); 35 | 36 | const QString description = i18n("KPackage Manager"); 37 | const auto version = QStringLiteral("2.0"); 38 | 39 | app.setApplicationVersion(version); 40 | parser.addVersionOption(); 41 | parser.addHelpOption(); 42 | parser.setApplicationDescription(description); 43 | parser.addOptions({Options::hash(), 44 | Options::global(), 45 | Options::type(), 46 | Options::install(), 47 | Options::show(), 48 | Options::upgrade(), 49 | Options::list(), 50 | Options::listTypes(), 51 | Options::remove(), 52 | Options::packageRoot(), 53 | Options::appstream(), 54 | Options::appstreamOutput()}); 55 | parser.process(app); 56 | 57 | // at least one operation should be specified 58 | if (!parser.isSet(QStringLiteral("hash")) && !parser.isSet(QStringLiteral("g")) && !parser.isSet(QStringLiteral("i")) && !parser.isSet(QStringLiteral("s")) 59 | && !parser.isSet(QStringLiteral("appstream-metainfo")) && !parser.isSet(QStringLiteral("u")) && !parser.isSet(QStringLiteral("l")) 60 | && !parser.isSet(QStringLiteral("list-types")) && !parser.isSet(QStringLiteral("r")) && !parser.isSet(QStringLiteral("generate-index")) 61 | && !parser.isSet(QStringLiteral("remove-index"))) { 62 | parser.showHelp(0); 63 | } 64 | return app.exec(); 65 | } 66 | -------------------------------------------------------------------------------- /src/kpackagetool/options.h: -------------------------------------------------------------------------------- 1 | #ifndef OPTIONS_H 2 | #define OPTIONS_H 3 | 4 | #include 5 | 6 | namespace Options 7 | { 8 | static QCommandLineOption hash() 9 | { 10 | static QCommandLineOption o{QStringLiteral("hash"), 11 | i18nc("Do not translate ", "Generate a SHA1 hash for the package at "), 12 | QStringLiteral("path")}; 13 | return o; 14 | } 15 | static QCommandLineOption global() 16 | { 17 | static QCommandLineOption o{QStringList{QStringLiteral("g"), QStringLiteral("global")}, 18 | i18n("For install or remove, operates on packages installed for all users.")}; 19 | return o; 20 | } 21 | static QCommandLineOption type() 22 | { 23 | static QCommandLineOption o{QStringList{QStringLiteral("t"), QStringLiteral("type")}, 24 | i18nc("theme, wallpaper, etc. are keywords, but they may be translated, as both versions " 25 | "are recognized by the application " 26 | "(if translated, should be same as messages with 'package type' context below)", 27 | "The type of package, corresponding to the service type of the package plugin, e.g. KPackage/Generic, Plasma/Theme, " 28 | "Plasma/Wallpaper, Plasma/Applet, etc."), 29 | QStringLiteral("type"), 30 | QStringLiteral("KPackage/Generic")}; 31 | return o; 32 | } 33 | static QCommandLineOption install() 34 | { 35 | static QCommandLineOption o{QStringList{QStringLiteral("i"), QStringLiteral("install")}, 36 | i18nc("Do not translate ", "Install the package at "), 37 | QStringLiteral("path")}; 38 | return o; 39 | } 40 | static QCommandLineOption show() 41 | { 42 | static QCommandLineOption o{QStringList{QStringLiteral("s"), QStringLiteral("show")}, 43 | i18nc("Do not translate ", "Show information of package "), 44 | QStringLiteral("name")}; 45 | return o; 46 | } 47 | static QCommandLineOption upgrade() 48 | { 49 | static QCommandLineOption o{QStringList{QStringLiteral("u"), QStringLiteral("upgrade")}, 50 | i18nc("Do not translate ", "Upgrade the package at "), 51 | QStringLiteral("path")}; 52 | return o; 53 | } 54 | static QCommandLineOption list() 55 | { 56 | static QCommandLineOption o{QStringList{QStringLiteral("l"), QStringLiteral("list")}, i18n("List installed packages")}; 57 | return o; 58 | } 59 | static QCommandLineOption listTypes() 60 | { 61 | static QCommandLineOption o{QStringList{QStringLiteral("list-types")}, i18n("List all known package types that can be installed")}; 62 | return o; 63 | } 64 | static QCommandLineOption remove() 65 | { 66 | static QCommandLineOption o{QStringList{QStringLiteral("r"), QStringLiteral("remove")}, 67 | i18nc("Do not translate ", "Remove the package named "), 68 | QStringLiteral("name")}; 69 | return o; 70 | } 71 | static QCommandLineOption packageRoot() 72 | { 73 | static QCommandLineOption o{QStringList{QStringLiteral("p"), QStringLiteral("packageroot")}, 74 | i18n("Absolute path to the package root. If not supplied, then the standard data" 75 | " directories for this KDE session will be searched instead."), 76 | QStringLiteral("path")}; 77 | return o; 78 | } 79 | static QCommandLineOption appstream() 80 | { 81 | static QCommandLineOption o{QStringLiteral("appstream-metainfo"), 82 | i18nc("Do not translate ", "Outputs the metadata for the package "), 83 | QStringLiteral("path")}; 84 | return o; 85 | } 86 | static QCommandLineOption appstreamOutput() 87 | { 88 | static QCommandLineOption o{QStringLiteral("appstream-metainfo-output"), 89 | i18nc("Do not translate ", "Outputs the metadata for the package into "), 90 | QStringLiteral("path")}; 91 | return o; 92 | } 93 | } 94 | 95 | #endif // OPTIONS_H 96 | --------------------------------------------------------------------------------