1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-25 14:00:43 +01:00
Commit graph

87 commits

Author SHA1 Message Date
33997bdb9e pkg2sqfs: fix size computation of directories
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:37:42 +02:00
00db5541e9 file list sort: remove duplicate directory entries
Can happen when merging multiple packages. But make sure they actually
are duplicates.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:43 +02:00
96d4d353d4 Remove unnecessary flush from unpacking loop
The uncompressor will know when end of file is reached. Flushing
prematurely won't help. Especially the way the loop was constructed,
using an external buffer that is a lot larger than the internal
buffer of the compressor will cause multiple erroneous flushes.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:43 +02:00
b30e912e97 pkg2sqfs: add command line option to set timestamp
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:43 +02:00
576491eae6 pkg2sqfs: add command line option to select compressor
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:41 +02:00
ac8e457c96 pkg2sqfs: set lzma dictionary size to block size
It's the default the kernel implementation expects if no options
are set.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:03 +02:00
214a5e917e Add a way to pass options to compressors
Currently only used by lzma compressor to set the dictionary size.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:03 +02:00
e123eaf433 pkg2sqfs: implement meta data compression
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:02 +02:00
f80e4e8d29 pkg2sqfs: implement data & fragment compression
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:02 +02:00
26b3683f7a Add block processing function to compressors
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:02 +02:00
765c836c3d Remove dependency on libbsd
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 14:08:02 +02:00
d94bd8ff17 pkg2sqfs: sort directory entries asciibetically
The squashfs kernel implementation relies on the following properties:
 - directory entries are ordered asciibetically by name
 - directory entries have consecutive inode numbers
 - inode numbers are assigned in that order

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-17 16:54:29 +02:00
cd79a4fccf make file list sorting more robust
If entries are sorted by length and some have the same length, sort
them asciibetically.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-17 16:30:01 +02:00
eadeee25d9 pkg2sqfs: move some functions to more approrpiate places
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-17 16:30:01 +02:00
025ab1007b pkg2sqfs: Add command line options for default inode settings
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-17 16:29:59 +02:00
db25ddc108 pkg2sqfs: always padd image file to device block size
The kernel implementation apparently requires that.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-17 16:29:22 +02:00
858779e42c Add pkg2sqfs utility stub
The goal is to transform a package file to a squashfs image. The mksquashfs
utility is a PITA with all kinds of idiotic not-thought-through corner
cases (e.g. the way "pseudo file definitions" have been tacked on, the
inabillity to set UID/GID for / *AND* have files not owned by root, the
way xattrs are handled, .....).

It would be preferable to fix mksquashfs itself, but the source code itself
is a horrid, unmaintained garbage pile. Its easier to write a small utility
instead that can turn a pkg file into a squashfs image in a way that
propperly treats file permissions and ownership, and is deterministic
(i.e. reproducable).

The utility currently generates an uncompressed squashfs image that
unsquashfs can unpack, but the kernel refuses the mount. The exact
problem still needs to be determined.

Furthermore, compression has to be implemented and some cleanup shoul
be done.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-17 01:33:57 +02:00
c78dc2255f pkg reader: try to read *entire* requested chunk
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-09 16:02:31 +02:00
aa6bbf2ef4 Move pkg-tool internal headers out of global include directory
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-05 12:36:47 +02:00
6cfd9a37bf Move all the package I/O code to libpkg library
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-05 12:33:50 +02:00
1205ca0f3b Move compressors to utility library
- Remove compressor registration interface. Doesn't work in a static
   library, since all the files containing no exported members are
   optimized away at link time.
 - Repack as seperate utility library.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-05 12:22:47 +02:00
63bad9786a Release version 0.3
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-31 13:39:21 +02:00
4d48e374d8 Add option to buildstrategy to produce a dot graph
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-30 23:40:19 +01:00
52f7bdc5c8 minor cleanup
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-30 18:31:40 +01:00
b7e81c081b cleanup: split package provider code out of buildstrategy.c
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-30 18:20:33 +01:00
46f340b20f cleanup: split source package code out of buildstrategy.c
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-30 17:57:34 +01:00
8a52ea6717 Allow multiple source packages to provide the same binary package
In build strategy, record a linked list of providers instead of just
one per binary package. Add an option to scan a preference list in
addition.

When looking up the provider and there is more than one, choose the
preferred one. Produce an error if none is given.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29 23:55:12 +01:00
b2f1b5ef58 cleanup: buildstrategy
Split utility function to get a source package by name out from
handle provides.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29 21:57:48 +01:00
48d74777e7 Fix buildstrategy command argument handlin
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-29 21:54:08 +01:00
680b1bb7f9 Bump version number
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 15:25:34 +01:00
db6c2118c4 Add missing colon to optarg listing flag
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 15:25:34 +01:00
19e2f8aa8c Fix file list removal of input line
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 14:57:59 +01:00
bba2e4c536 Update e-mail address
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 14:00:19 +01:00
d71366bbdd Distribute LICENSE and README.md with source packages
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 13:52:22 +01:00
e3edcea895 Add missing options to install documentation
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 13:51:44 +01:00
88f4dd00d7 Add README file
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 13:51:33 +01:00
1a84276bf6 Add writeup on package file structure
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 12:31:16 +01:00
f11c9df330 Add a pkg command for producing a dependency graph
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 00:56:32 +01:00
90667fbf8a Move dependency graph handling out of install command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-09 00:23:06 +01:00
f038cc52b3 cleanup: merge listing & format flags for dump and install commands
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 23:53:30 +01:00
20aea96396 Add license
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 18:18:31 +01:00
4a682b83f1 cleanup: reimplement process_file using foreach_line_in_file
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 17:32:59 +01:00
b688a39149 cleanup: move input file open/close into process_file function
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 17:32:59 +01:00
f7e4aec2ea Add utility function to iterate over lines in a file
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 17:32:59 +01:00
af7c6f09df Add buildstrategy command
Basically an improved port of the makeshift depgraph from the pygos build
system.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 00:39:05 +01:00
6dd9ae94bd Add simple hash table implementation
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-08 00:28:41 +01:00
00c8946497 pack: deduce package name from input file name
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-07 15:17:19 +01:00
55b2d2f0c0 Allow '+' characters in package names
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-01 09:58:44 +01:00
82c888bcbf install: make sure package dependencies have no trivial cycles
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-02-21 15:11:32 +01:00
98b655f133 Cleanup: split sort_by_dependencies function up
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-02-21 15:04:27 +01:00