This can decrease package size by optimizing PNG image size. Images are
just stored with better compression and/or filter options. The actual
image content is not altered.
Additionally this can automatically fix broken PNG images which caused
some trouble lately.
Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Allan McRae <allan@archlinux.org>
Commit 9e5e86aa was supposed to fix this. Instead I picked another [[ -f ]]
statement in the same region and added the hardlink test to it instead, thus
not fixing the bug.
Signed-off-by: Allan McRae <allan@archlinux.org>
If the call to alpm_logaction failed it would overwrite pm_errno,
leading to error messages unrelated to the actual reason the transaction
failed.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This fixes the issue where if the user explicitly set the name of the cloned source
to eg. foo.git, the directory name in $SRCDEST would be foo.git as expected, but the
clone in $srcdir would be stripped of the .git suffix.
Signed-off-by: Lukáš Jirkovský <l.jirkovsky@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Prevents the need to rename the file if we end up keeping it and ensures
that pacnew files always reflect the most recent version by overwriting
stale copies.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Leave user files in place and save new config files with a .pacnew
extension. This reduces the complexity of file extraction and respects
the principle that pacman shouldn't modify files it didn't create.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
If an error occurs the actual path being extracted is more useful than
the original path from the package file list. The original path is
still used for checks that use it directly.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
alpm's database files (.INSTALL, .MTREE, etc.) should be extracted no
matter what; skip mtree/needbackup/noextract/noupgrade checks for them.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
key points to a statically allocated string so it can't be NULL and
empty keys are rejected by the callback.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Reduces the number of errors the ini parser must handle to make it more
suitable for sharing with the backend.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Storing repo information removes the need for the final callback. This
allows the call signature to be re-purposed for indicating read errors.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
This will allow pacman to parse its config file in a single pass and
removes the need for the *_SET siglevels in alpm that were only required
for pacman's siglevel inheritance.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
It was allocating the required size rather than the calculated new size,
resulting in pathological incremental reallocations.
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
The files_size variable contains the current capacity (in bytes) and
should not be used to calculate the next length increment. It only works
because _alpm_greedy_grow currently results in incremental growth.
Signed-off-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
If an already used array is passed array_build, some entries from the old
array could be carried over if the old array was longer than the new one.
Clear the destination array before adding elements to it to prevent this
issue.
Fixes: https://bugs.archlinux.org/task/43387
Signed-off-by: Allan McRae <allan@archlinux.org>
die prints "at $scriptname line $linenumber." if the string does not
end with "\n". This information is not of much use for us and it makes
testing harder because we'd to remove it there.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
I suspect this is just wrong -- you never need to quote the replacement
side of a PE. In bash 4.3, this is essentially a no-op, but because of
a bug in bash 4.2, we get embedded quotes as a result of this
replacement. The relevant changelog item in bash is:
Fixed a bug that caused single quotes that resulted from $'...' quoting
in the replacement portion of a double-quoted ${word/pat/rep} expansion
to be treated as quote characters.
But this doesn't apply to us. Let's just drop the excessive quoting...
Signed-off-by: Allan McRae <allan@archlinux.org>
When a shared library uses an absolute symlink for its its .so file, the check
if the shared version of a static library exists fails. Test for the presence
of a broken symlink too.
Signed-off-by: Allan McRae <allan@archlinux.org>