AgeCommit message (Collapse)AuthorFilesLines
20 hoursopkg-unbuild: convert to shellHEADmasterChristian Hermann1-20/+73
The previous implementation relied on python, it shelled out anyway (using bashisms) to call ar/tar and couldn't handle paths != cwd. This rewrite * can handle packages elsewhere than cwd * prints a summary like opkg-build does ("Unbuilt <IPK> into <DEST>") * is written in valid POSIX shell syntax * is compatible with opkg-build's non-esoteric options * is linted with shellcheck. Tested with * different tar * gnu tar 1.32 * bsdtar 3.4.1 * busybox-tar 1.31.1 * toybox-tar 0.8.2 (but prints a warning: tar: './' not under '/tmp/dest/foo') * some opkg-build arguments, as of `opkg-build -o root -g root $args`, with * args= * args="-Z xz" * args="-c" * args="-c -Z xz" Signed-off-by: Christian Hermann <> Signed-off-by: Alejandro del Castillo <>
5 daysMake grep and sed arguments in opkg-feed Busybox compliantRex Keen1-5/+5
Signed-off-by: Rex Keen <> Signed-off-by: Alejandro del Castillo <> fix mangled test urlsAlejandro del Castillo1-11/+11
Email protection program incorrectly mangled the URLs used to test opkg-feeds. Correct the URLs to make the test pass. Signed-off-by: Alejandro del Castillo <>
2019-12-16makePackage: switch to python30.4.2Alejandro del Castillo1-1/+1
Signed-off-by: Alejandro del Castillo <>
2019-12-02opkg-utils: Switch to python3Haris Okanovic8-8/+8
Switch all py script shebangs to `#!/usr/bin/env python3`. Testing: Successfully ran the following on an IPK feed in $PWD: * opkg-make-index --checksum md5 --checksum sha256 -p Packages -m -l Packages.filelist . * opkg-graph-deps ./Packages * opkg-compare-indexes ./ ./ * opkg-list-fields font-alias_1.0.3-r2.3.204_all.ipk * opkg-show-deps -p Packages font-alias I'm not sure how to correctly run opkg-update-index and opkg-unbuild. I attempted to run both with `-h`, no parse errors. My motivation for this change is to add xz support to opkg filelists, which requires python3's version of tarfile. See previous commits in this series for details. However, this is probably a good change in general since python2 support is starting to dwindle. Signed-off-by: Haris Okanovic <> Signed-off-by: Alejandro del Castillo <> Add xz supportHaris Okanovic1-2/+6
Open data.tar.xz if gz payload is not present. This change allows xz payloads to be archived in filelist. However, only python3's tarfile has xz support. This therefore only works if opkg-make-index's shebang is overridden to run in python3. Signed-off-by: Haris Okanovic <> Signed-off-by: Alejandro del Castillo <> Decode subprocess string, python3 supportHaris Okanovic1-0/+1
String split fails on newline (\n) chars in python3 unless subprocess output string is decoded as text. This results in fn containing a bad filename with trailing newline (\n) char, which subsequently breaks open() in get_file_list(). Tested `opkg-make-index -l Packages.filelist ...` in python 2 and 3. Signed-off-by: Haris Okanovic <> Signed-off-by: Alejandro del Castillo <>
2019-11-25opkg-build: do not include current directoryAlejandro del Castillo1-1/+1
Current directory entry is not needed. Signed-off-by: Alejandro del Castillo <>
2019-11-25Fix opkg-build to handle errors correctlyRichard Purdie1-1/+2
We need opkg-build to fail if for example the tar command is passed invalid options. Without this, we see silently created empty packaged where data.tar is zero bytes in size. This creates hard to debug problems. An example is when reproducible builds are enabled and run on old hosts like centos7 which has tar < 1.28: Subprocess output:tar: unrecognized option '--clamp-mtime' Try `tar --help' or `tar --usage' for more information. This change does make the script bash specific but that shouldn't an issue for systems capable of building ipks. Signed-off-by: Richard Purdie <> Signed-off-by: Alejandro del Castillo <>
2019-11-07Add a utility script for listing and manipulating feedsRex Keen2-0/+743
Signed-off-by: Rex Keen <> Signed-off-by: Alejandro del Castillo <>
2019-10-18add SPDX license identifiersYann CARDAILLAC14-3/+14
Signed-off-by: Yann CARDAILLAC <> Signed-off-by: Alejandro del Castillo <>
2019-09-16opkg-build: clamp mtimes to SOURCE_DATE_EPOCHAlejandro del Castillo1-1/+8
For reproducible builds, clamp mtimes bigger than SOURCE_DATE_EPOCH to SOURCE_DATE_EPOCH (build generated files, usually). Fixes bugzilla 13450 Tested-by: Ross Burton <> Signed-off-by: Alejandro del Castillo <>
2019-05-31opkg-list-fields: fix to print the fields again0.4.1Martin Jansa1-2/+1
* printing opkg.Package directly doesn't return anything useful now <opkg.Package object at 0x7fd49e9f2780> * we need to call Package.print() function and specify which checksums to print, we can include both md5 and sha256 for opkg-list-fields * it was changed in this commit: commit 601d691dd80ef494aef069017edc5bf80aa883a1 Author: Alejandro del Castillo <> Date: Wed Dec 19 11:40:15 2018 -0600 opkg-make-index: add sha256sum support which replaced the modified __str__ function with print(self, checksum) Signed-off-by: Martin Jansa <> Signed-off-by: Alejandro del Castillo <>
2019-05-30Makefile: fixed for-loop in install receipeAlejandro del Castillo1-1/+1
The install receipe would have copied all the manpages to each of the section folders. This change will do what I believe the original author had intended. Signed-off-by: Joshua DeWeese <> Signed-off-by: Alejandro del Castillo <>
2019-05-14ArFile: add python3 compatibilityAlejandro del Castillo1-1/+1
Signed-off-by: Alejandro del Castillo <>
2019-02-21opkg-build: do not set mtime on data.tar.XAlejandro del Castillo1-1/+1
Opkg should make sure the binaries it creates are created in a repoducibe way, but it shouldn't modify the mtime of the binaries it consumes. Doing so has side effects, for exmaple, Python pyc files are invalidated. Signed-off-by: Alejandro del Castillo <>
2018-12-26opkg-build: use filelists as tar input0.4.0Alejandro del Castillo1-4/+6
OE parallelism means that the number of hard links may increase or decrease while a tar file is being created, which makes tar fail with error 1. To avoid this problem, use tar -T option, which uses filelists. Signed-off-by: Alejandro del Castillo <>
2018-12-26opkg-make-index: add sha256sum supportAlejandro del Castillo2-4/+29
Add a new --checksum option (default to md5). Signed-off-by: Alejandro del Castillo <>
2018-12-26opkg-make-index: use argsparse instead of getoptAlejandro del Castillo1-42/+27
Argsparse is a newer library, it makes the code cleaner and easier to expand. Only enabled short options, to leave the command line as it was with getopt. Signed-off-by: Alejandro del Castillo <>
2018-12-26opkg-make-index: fix pylint errors and warningsAlejandro del Castillo1-230/+247
Signed-off-by: Alejandro del Castillo <>
2018-11-19opkg-build: add support for lz4 compressorAlejandro del Castillo1-1/+5
Signed-off-by: Alejandro del Castillo <>
2018-11-16opkg-build: simplify date calculationAlejandro del Castillo1-4/+4
Avoid an integer to string conversion (and back) by directly supplying the Unix time as an integer to -mtime. Fixes bugzilla# 12580 Signed-off-by: Alejandro del Castillo <>
2018-11-13opkg-build: add compressor arguments command line argumentAlejandro del Castillo1-8/+17
If specified, overwrites the default compressor flags. Fixes bugzilla #12611 Signed-off-by: Alejandro del Castillo <>
2018-11-12update-alternatives: Fix link relocation supportNiko Mauno1-1/+1
Commit fcb26339000021eb9bb711aa264247aebcfdd4ae which added Debian-style support for link relocation tries to relocate symbolic link on host OS, resulting in following-like error when two alternative packages have symbolic link source located in different directories (/bin/rev -> /bin/busybox.nosuid and /usr/bin/rev -> /usr/bin/rev.util-linux): update-alternatives: renaming rev link from /bin/rev to /usr/bin/rev mv: cannot stat '/bin/rev': No such file or directory Fix the issue by prefixing 'olink' and 'link' variable references with path to targeted root filesystem's root directory. Signed-off-by: Niko Mauno <> Signed-off-by: Alejandro del Castillo <>
2018-10-22opkg-make-index: use ctime instead of mtimeStefan Agner1-3/+3
When using sstate, two parallel builds can produce two packages with the same mtime but different checksums. When later one of those two builds fetches the others ipk, the package index does not get udpated properly (since mtime matches). This ends up with messages such as: Downloading file:/../tmp/work/../image/...ipk. Removing corrupt package file /../sysroot/../var/cache/opkg/volatile/...ipk However, in that case, ctime is different. Use ctime instead of mtime to prevent failures like this. Suggested-by: Khem Raj <> Signed-off-by: Stefan Agner <> Acked-by: Richard Purdie <> Acked-by: Khem Raj <> Signed-off-by: Alejandro del Castillo <>
2018-10-05opkg-build: Add support for explicit pigzMike Crowe1-2/+6
oe-core has stopped[1] installing pigz as gzip. This means that in order to persuade opkg-build to use pigz it must be specified explicitly. Let's teach opkg-build to deal with being passed pigz as a compressor. We can't combine the check for whether -T is required because opkg-build calls both $compressor and gzip explicitly. Signed-off-by: Mike Crowe <> Signed-off-by: Alejandro del Castillo <>
2018-02-28opkg-build: Use local time for build_date, since opkg extracts files ↵Michael Hansen1-4/+4
assuming local time rather than UTC. Also increase resolution of build date down to the second, rather than clamping to midnight of the current date. Signed-off-by: Michael Hansen <> Signed-off-by: Alejandro del Castillo <>
2018-02-28Only use --sort=name on versions of tar which support it. This fixes ↵Michael Hansen1-3/+8
compatibility with bsdtar and old versions of GNU tar (e.g. RHEL6). Signed-off-by: Michael Hansen <> Signed-off-by: Alejandro del Castillo <>
2018-02-22opkg-build: improve ipk package reproducibilityGardon Lukasz1-1/+1
Implement timestamp recommendation from [1] - Enable deterministic archieve by setting zero timestamp and uids/guds with using 'D' in GNU ar tool [1] Signed-off-by: Gardon Lukasz <> Signed-off-by: Alejandro del Castillo <>
2018-02-07opkg-build: differentiate between compressorargs and zipargs0.3.6Juro Bystricky1-9/+9
control.tar.gz is always compressed with gzip. If data.tar is compressed by a compressor other than gzip, control.tar.gz may end up compressed with timestamp in the compressed image header. This would result in packages that are not binary reproducible. [YOCTO #11242] Signed-off-by: Juro Bystricky <> Signed-off-by: Alejandro del Castillo <>
2018-01-29opkg-build: improve package reproducibilityAlejandro del Castillo1-3/+15
Implements some of the recommendations by [1] - Set modification time to SOURCE_DATE_EPOCH env variable - Enable deterministic sorting of directory entries - Do not save timestamp on gzip compressed archive bugzilla #11242 [1] Signed-off-by: Alejandro del Castillo <>
2018-01-23update-alternatives: add support for link renamesAlejandro del Castillo1-2/+5
During package upgrades, the link location might change. For example: Package A: 'update-alternatives --install /bin/app app /some/real/path 100' Package B: 'update-alternatives --install /sbin/app app /some/other/path 100' Opkg disallows a link change and throws an error. Debian does allow the operation, changing the link to the new location. Add support to follow the debian update-alternatives behavior. bugzilla #8344 Signed-off-by: Alejandro del Castillo <>
2018-01-21update-alternatives: fix the sed pattern in remove_altJackie Huang1-1/+1
'\>' is to matches the end of a word, but the executable is not always a 'word', e.g. /usr/lib64/busybox/usr/bin/[ then such alternatives can not be removed. So change to use '\s' in the pattern since the following character of the $path is whitespace. Signed-off-by: Jackie Huang <> Signed-off-by: Alejandro del Castillo <> Add option to include all fieldsJeffrey Pautler2-14/+25
If the -f option is enabled, opkg-make-index will include user-defined fields in the package index rather than discarding them. This change is motivated by the fact that opkg now has support for user-defined fields in the package index. Signed-off-by: Jeffrey Pautler <> Signed-off-by: Alejandro del Castillo <> Remove reformatting of description fieldJeffrey Pautler1-6/+2
The Debian Policy Manual describes the format of the description field. This includes information about how lines might be wrapped by programs displaying this information, how to mark lines to not be wrapped, how to mark a line as blank, and how leading spaces on a multi-line description might be deleted. By reformatting the description field in, we are breaking many of these behaviors and taking control of formatting away from the author of the control file. Instead, we should simply copy the description field with no reformatting. Signed-off-by: Jeffrey Pautler <> Signed-off-by: Alejandro del Castillo <> Fix run-time error in call to ArFileJeffrey Pautler1-1/+1
Signed-off-by: Jeffrey Pautler <> Signed-off-by: Alejandro del Castillo <>
2017-09-11opkg-build*: fix empty package name in error messageAdam Trhon2-2/+2
When opkg-build detects illegal character in package name it prints an error message with this name. Due to a wrong variable name the package name in the error message is empty. The same error occurs in opkg-buildpackage as well. This patch fixes both. Signed-off-by: Adam Trhon <> Signed-off-by: Alejandro del Castillo <> Compatible for ipk which outer is tar朱穆穆1-2/+6
Signed-off-by: Zhu Mumu <> Signed-off-by: Alejandro del Castillo <>
2017-06-27opkg-build: make Section, Priority and Source fields optionalAlejandro del Castillo1-24/+0
This is consistent with Debian policy. Signed-off-by: Alejandro del Castillo <>
2017-01-30Check for optional terminator in archives0.3.5Rob Woolley1-1/+5
Archive files have an optional '/' terminator in the member file name field. (See /usr/include/ar.h) This change makes opkg-make-index more forgiving on packages created manually with alternative tools like CPack. Signed-off-by: Rob Woolley <> Signed-off-by: Alejandro del Castillo <>
2017-01-18Makefile: prefer defined bindir and mandir as installation dirsAlejandro del Castillo1-4/+4
Signed-off-by: Alejandro del Castillo <>
2016-12-30Added support to generate index file with multiple version per packagedesmond2-6/+19
Using the -a option with opkg-make-index, you can now generate an index file which will list multiple version of the same package. Added since opkg now supports specifying version of package. Signed-off-by: desmond <> Signed-off-by: Alejandro del Castillo <>
2016-12-30update-alternatives: warn when multiple providers have the same priorityChen Qi1-0/+3
Warn users when multiple providers of a utility have the same priority. Signed-off-by: Chen Qi <> Signed-off-by: Alejandro del Castillo <>
2016-10-07opkg-make-index: print summary on it's own line0.3.4Alejandro del Castillo1-1/+3
The Description field on the Packages file doesn't follow the same format used on the Control file. It is incorrectly processing the summary line (it treats it as part of the longer description). Add code to print the summary line on it's own. Fixes issue 9238 Signed-off-by: Alejandro del Castillo <>
2016-10-05opkg-build: Add a manpage in POD format.Andrew Shadura2-3/+85
Add a manpage for opkg-build and a corresponding Makefile snippet to build it using pod2man. Signed-off-by: Andrew Shadura <> Signed-off-by: Alejandro del Castillo <>
2016-10-05opkg-build: Add support for alternative compression schemes.Andrew Shadura1-6/+28
Add -Z with the same semantics as dpkg-deb -Z: Specify which compression type to use for data.tar member when building the package. Allowed values are gzip, bzip2 and xz. The default value is gzip. Signed-off-by: Andrew Shadura <> Signed-off-by: Alejandro del Castillo <>
2016-10-05opkg-build: Unify tabulation in the option parser.Andrew Shadura1-8/+8
Align case/esac options assuming tabulation size 8. Signed-off-by: Andrew Shadura <> Signed-off-by: Alejandro del Castillo <>
2016-06-23opkg-utils: remove opkg-compare-versions implementationsAlejandro del Castillo3-245/+6
Currently, there are three compare-versions implementations: 1) opkg-utils: opkg-compare-versions.c 2) opkg-utils: 3) opkg: internal To avoid confusion and avoid maintaining three codebases, remove the compare-versions functionality from opkg-utils and only keep the implementation on the opkg binary. Signed-off-by: Alejandro del Castillo <> remove dependency on python-future0.3.2Alejandro del Castillo1-1/+0
Python-future provides a python2 compatible object class (provides next method). Since method is not used, remove dependency. Signed-off-by: Alejandro del Castillo <> call __str__ instead of __repr__Alejandro del Castillo1-1/+1
Commit b9eec00a67f13ad9f9526caf591578b40d73a391 correctly renamed __repr__to __str__. A call site in write_packages_file was missed. Signed-off-by: Alejandro del Castillo <>