aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2024-02-14opkg: Fix memory leaks in config handlingHEADmasterPhilip Lorenz
* fields_filter is a CLI-only option but was never freed * The temporary buffer used to hold the tmpdir template was never freed when mkdtemp failed Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-14opkg: Add --install-recommends command line optionPhilip Lorenz
The command line option can be used to enforce installation of recommendations even when they are disabled via the "no_install_recommends" configuration option. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-14opkg: Split command line argument parsing into 2 stagesPhilip Lorenz
Currently, command line arguments are parsed before the configuration file is read, hence making it impossible to disable boolean options once they have been enabled via a configuration file option. To enable this functionality, this patch splits command line argument parsing into the following stages: 1. Parse all command line arguments needed for configuration file parsing. This includes verbosity settings, the offline root and the path to a custom configuration file. 2. Parse all other command line arguments. Stage 2 is only performed after the configuration file has been loaded thus allowing all options read from the configuration to be overridden again. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-14opkg: Clean up command line parsingPhilip Lorenz
The special value ':' will only be returned if the option string beings with the ':' modifier. As this isn't the case here it doesn't need to be handled specifically. Additionally, rephrase the error message printed when an unhandled return value is encountered. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-14libopkg: Split out config finalization from config loadingPhilip Lorenz
opkg_conf_load() currently loads the configuration from a file and then proceeds to finalize the config structure by filling in default values or building the final config values based on other config parameters (e.g. the offline root). To enable overwriting of config options from the command line the finalization phase is split out so it can be called only after the command line arguments have been processed for the second time. To retain API compatibility, opkg_conf_load() continues to read and finalize the config. If the staged approach is desired opkg_conf_read() followed by a opkg_conf_finalize() shall be used. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-14libopkg: Simplify cleanup of opkg_confPhilip Lorenz
Move freeing of resources claimed by opkg_config into a dedicated helper function. This allows reuse in the upcoming two stage argument parsing and also reduces the numbers of labels needed to perform the actual freeing of memory. This change is safe as the individual cleanup methods already check whether the resource that should be freed has actually been allocated. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-14libopkg: Drop spurious error checkPhilip Lorenz
"r" was never changed in between this and the previous check. Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-12tests: Fix typoPhilip Lorenz
The variable is named DEBUG_OPKG_CMDS Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-09configure.ac: warn when configuring internal solverAlex Stewart
The opkg internal solver is marked for deprecation in a future release, due to it being outdated, limited, buggy, and unmaintained. Builders are instead directed to use the previously-optional libsolv backend. Add a warning to the configure.ac, to warn builders about this misconfiguration. Also fix incidental spelling errors. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2024-02-08update autoconf scripts for ac_2.70 compatAlex Stewart
The autoconf version boundary 2.70 deprecated and obsoleted many functions from prior versions. On systems with autoconf>2.70, configuring opkg can throw warnings and errors about these deprecations. Run autoupdate on the autoconf scripts and make some manual adjustments to bring the scripts up to a modern standard. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-12-12libopkg: Use libgen.h to provide basename APIKhem Raj
Also ensure that copy of filename is passed into archive_entry_set_pathname so it can be operated upon by posix basename which expect non-const character pointer as input. This became evident with latest musl where basename declaration was dropped from string.h [1] [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-12-05configure.ac: bump version to 0.6.3+gitAlex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-12-05ROADMAP: updatev0.6.3Alex Stewart
The opkg project mailing list is now hosted on the lists.yoctoproject.org server. The google group has been deprecated. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-12-05CHANGELOG: update for 0.6.3 releaseAlex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-12-05configure.ac: bump version to 0.6.3Alex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-12-01docs: add SECURITY.mdAlex Stewart
Add a short document directing contributors on how to report security issues against the project. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-09-15tests: add test for CVE-2020-7982Alex Stewart
The opkg-lede fork was affected by a bug where it would not honor the package index MD5Sum field. As a result, malicious attackers that have MITM vector access to an opkg system could inject code into packages, as long as the overall package size does not change. Add a test to validate that our opkg fork is not vulnerable to this exploit. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-08-18migrate mailing list to lists.yoctoproject.orgAlex Stewart
Google Code/Groups is a legacy product which is not being actively maintained by Google, and it is becoming progressively more difficult to maintain the opkg-devel list there. Instead, move the canonical opkg mailing list for the yocto fork to the lists.yoctoproject.org site, where it can live with the other contemporary yocto projects. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-08-15opkg: set locale from system environment variablesPiotr Łobacz
A C program inherits its locale environment variables when it starts up. This happens automatically. However, these variables do not automatically control the locale used by the library functions, because ISO C says that all programs start by default in the standard ‘C’ locale. Fixes warnings: Warning when reading ar archive header: Pathname can't be converted from UTF-8 to current locale. (errno=84) [1] https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-07-12Add options to enable support for acl and xattrMaciej Liszewski
The libarchive library, which is being used by opkg supports ACLs and xattr already. More information can be read at this link: https://github.com/libarchive/libarchive/pull/691 Signed-off-by: Maciej Liszewski <m.liszewski@welotec.com> Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-07-12configure.ac: bump version to 0.6.2+gitAlex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-07-11Makefile.am: do not duplicate EXTRA_DIST dirsv0.6.2Alex Stewart
Automake is not very intelligent. If you add add a directory to the EXTRA_DIST variable with a trailing slash, then automake will copy the directory into a the dist archive under a path of itself. So the dist archive might contain: `/scripts/scripts/...` or `/tests/tests/...`. Remove the trailing slash to fix this behavior. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-07-11make-dist.sh: use new changelog fileAlex Stewart
The NEWS file has been replaced by CHANGELOG.md, for update-tracking. Update the make-dist.sh script to use the new file. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-07-11configure.ac: bump version to 0.6.2 for releaseAlex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-07-11CHANGELOG: update changelog for 0.6.2 releaseAlex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20remove obsolete scriptsAlex Stewart
The checkpatch.pl and test-branch.py files are obsolescent and no longer recommended for new developers to run on their patches. Remove the scripts, so that devs don't run them by mistake. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20ROADMAP: add an initial roadmapAlex Stewart
Add a document which espouses the larger-scale initiatives which would improve the project. This list is a combination of the tribal knowledge that I have learned as the project maintainer, and the historic TODOs and commentary of past maintainers. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20TODO: removeAlex Stewart
The TODO file contains some historic musings about things to improve in the codebase. For most entries, the discussion history has been lost and the entries themselves aren't enough to take discrete action. The exception is the request to improve the efficiency of the pkg_hash_best_installation_candidate function, which has been moved to this bugzilla. https://bugzilla.yoctoproject.org/show_bug.cgi?id=15006 Remove the file. There is some space in the project to keep a roadmap document with future initiatives that are more than individual enhancements or bugs, and that document is in-work. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20gitignore: ignore configure.linenoAlex Stewart
The configure.lineno file is autogenerated by ./configure and should not be source-controlled. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20tests: add READMEAlex Stewart
Add a README.md file to the tests/ subdirectory, with helpful information to developers about how to run and write the integrated test framework. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20Makefile.am: cleanup dist filesAlex Stewart
The recent changes to the project's developer documentation have broken compliance with how we have setup our dist content. Update the dist content to reflect the project's current file structure. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20configure.ac: declare the project as "foreign"Alex Stewart
GNU Automake asserts that projects should follow GNU "conventions" and include some standard files named AUTHORS, INSTALL, ChangeLog, et c. The intention here is probably to encourage users to distribute this information, but it is rather heavy-handed to require that they be specifically named in that fashion. As a result, automake will error if we try to rename or move these files. Declare `-Werror foreign` in the autoconf file, which declares that we are not a strictly GNU-compliant project in this regard, and squashes automake's objections. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20README: improve and enhanceAlex Stewart
The existing README doesn't provide very useful information to users who find the project. They learn that opkg is a "package management system" (whatever that means) derived from Ipkg (which they have never heard of), and little else of value. Instead, make the README a markdown formatted document answering basic questions like: What is opkg? How do I get it? How do I use it? and Where should I go for more information? Some of the answers to those questions aren't satisfying, but those are the subject of future initiatives. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20GettingStarted: removeAlex Stewart
The GettingStarted document contains a mix of sparse references to the upstream bug tracker/mailing list - which is now provided in the CONTRIBUTING.md - and some musing about future project initiatives, which would be better moved to another document. Remove it. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20RELEASE: move to MAINTAINING and updateAlex Stewart
The Release document provides an outdated view of what the release workflow looked like for opkg at some time. Move this information into the MAINTAINING.md document, and update it with better information. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20VersionPoilcy: move to MAINTAINING.mdAlex Stewart
The VersionPolicy doc describes an approximation of the semantic versioning policy that this fork follows. The policy is functionally similar to the popular SemVer spec outlined here (https://semver.org/spec/v2.0.0.html). So we should formally adopt that spec to align with community best-practices. There isn't a compelling reason that the version policy needs to be in its own file. Create a new MAINTAINING.md document for project maintenance information and move it there. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20INSTALL: removeAlex Stewart
The INSTALL file is auto-generated by the automake tooling, and should not be a part of source control. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20NEWS: rename to CHANGELOG.mdAlex Stewart
The NEWS file now represents as a modern-style markdown CHANGELOG, but uses the old-style "NEWS" name. Rename it to give the project a more *modern* appearance. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20ChangeLog: removeAlex Stewart
The ChangeLog file just redirects the user to the git-log, which is unhelpful. Remove it for cleanliness. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20ChangeLog.ipkg: move to docs/Alex Stewart
Move the very-historic Ipkg changelog to the docs/ directory. It is unlikely to be useful to new developers, and doesn't deserve top-directory prominence. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20AUTHORS: deprecateAlex Stewart
The AUTHORS file lists some historic project contributors/maintainers, but is rather out of date. Further, I think the open source community has largely moved away from keeping independent AUTHORS files, in favor of allowing the VCS history to track that information. For those reasons deprecate the AUTHORS file. The maintainers list has already been moved to the docs/CONTRIBUTING.md document, since that information is less-well tracked by git history and has some utility for contributors. Hopefully, no one feels slighted by this decision. If you really desire to have your contributions written out in source control, or if you had some copyright agreement which makes that a requirement, feel free to let me know and I'll reconcile your request. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-20CONTRIBUTING: reworkedAlex Stewart
The CONTRIBUTING file contents is out of date and doesn't give new developers a helpful starting point for contributing to the project. * Move the document to a new :docs/ directory, which will be the new home for developer documentation. * Rewrite sections to reflect the current standards for project contribution. * Remove sections about how to use git; most devs probably understand how to use it by now. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-18Define alignof using _Alignof when using C11 or newerKhem Raj
WG14 N2350 made very clear that it is an UB having type definitions within "offsetof" [1]. This patch enhances the implementation of macro alignof_slot to use builtin "_Alignof" to avoid undefined behavior on when using std=c11 or newer clang 16+ has started to flag this [2] Fixes build when using -std >= gnu11 and using clang16+ Older compilers gcc < 4.9 or clang < 8 has buggy _Alignof even though it may support C11, exclude those compilers too [1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm [2] https://reviews.llvm.org/D133574 Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2023-01-09opkg-key: Remove --no-options flag from gpg calls.Charlie Johnston
The opkg-key script was always passing the --no-options flag to gpg, which uses /dev/null as the options file. As a result, the opkg gpg.conf file was not getting used. This change removes that flag so that gpg.conf in the GPGHOMEDIR for opkg (currently /etc/opkg/gpg/) will be used if present. Signed-off-by: Charlie Johnston <charlie.johnston@ni.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2022-12-06configure.ac: bump version to 0.6.1+gitAlex Stewart
Use the `+git` suffix, instead of the `-snapshot` suffix because it doesn't require speculation about what the next release version will be. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2022-12-06NEWS: update for v0.6.1 releasev0.6.1Alex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2022-12-06configure.ac: bump version for 0.6.1 releaseAlex Stewart
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2022-10-19opkg.c: usage text spellingAlex Stewart
Fix a spelling mistake in the usage text. Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2022-08-15libopkg: track the number of packages installing a directoryShruthi Ravichandran
Create a dir-hash to track the number of packages installing the same directory or a symlink to a directory. This directory or symlink is deleted only when there is no other package using it. This is in line with how dpkg deletes directories. Fixes Bugzilla #10461. Signed-off-by: Shruthi Ravichandran <shruthi.ravichandran@ni.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>
2022-08-15libopkg: support multiple packages installing a directory or a symlink to oneShruthi Ravichandran
Multiple packages can install the same directory, or a symlink to a directory. Ensure that these entries are not removed from the filelists of packages that are installed following a package that first installs the directory or a symlink to a directory. This is later used to ensure that out-of-order package removals do not result in directory or symlink deletion. Fixes Bugzilla #10461. Signed-off-by: Shruthi Ravichandran <shruthi.ravichandran@ni.com> Signed-off-by: Alex Stewart <alex.stewart@ni.com>