Remove versioncmp.c by moving all functions to locations that make sense.
Move replacement functions (for building without glibc) into util.c where
they belong, and do proper checks for them instead of using __sun__, etc.
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove unused buildtype field from pmpkg_t struct and anything associated
with it, as it is unused at the moment. If we need to readd it, it is an
easy revert of this commit.
Signed-off-by: Dan McGee <dan@archlinux.org>
The three chk_ functions overlap for packages both in targets and in the
database. This caused the same conflict to be found in both direction
(A conflicts with B, and B conflicts with A).
This patch avoids this duplication. which shouldn't be needed, but other
changes might be required for that to work correctly.
This also has the unexpected side effect to hide the failure of sync022
pactest, for FS #7415. That's maybe not a good thing though..
Note from Dan: sync022 does succeed, but a sync023 pactest added to check
regressions also seems to pass. This may be a valid fix to this 'problem'
sync022 was meant to find.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Because of this commit:
ea1fef69ad
we lost a lot of gettext-ized messages on the libalpm side. Remove them
in order to clean out these files a bit.
Signed-off-by: Dan McGee <dan@archlinux.org>
There is no real reason to burden our translators with these messages, as
anyone helping to debug these will probably want them in English.
Signed-off-by: Dan McGee <dan@archlinux.org>
We shouldn't translate log messages to pacman.log so it is consistant and
can be parsed by other tools. Remove all gettext _() around these strings.
Signed-off-by: Dan McGee <dan@archlinux.org>
Move the translations from src/pacman/po to just po/ so we can include the
scripts gettext translations in the same message catalog as that of the
pacman frontend. The libalpm message catalog, for now, will remain a separate
existence.
Signed-off-by: Dan McGee <dan@archlinux.org>
I ran flawfinder and sparse over the pacman source code and found a few
things that were worth fixing (and were quick fixes).
Signed-off-by: Dan McGee <dan@archlinux.org>
Adds the ARCHIVE_EXTRACT_NO_OVERWRITE libarchive flags
for extracting files and directories.
This will prevent symlinks for being overwritten by directories.
All other files that need to be extracted should already have
been deleted previously by pacman.
This flag is not used for extracting files in backup array
to /tmp/alpm_XXXX, because this file is created by mkstemp first,
and so needs to be overwritten by the file from the archive.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
With libarchive 2.2.3 (previously 1.3.1), archive_read_extract now returns ARCHIVE_WARN
when a package is extracted as user, because for example, UID=0 or SUID bit can't be set.
This patch makes pacman not treating these warnings as errors anymore,
but simply ignoring them.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
I previously introduced some patches to make just about every path in
pacman/libalpm configurable; doing this with the lockfile seemed a bit too
far and we really should just place the lockfile where it belongs- with the
DB that needs locking.
More details in this thread:
http://archlinux.org/pipermail/pacman-dev/2007-June/008499.html
Signed-off-by: Dan McGee <dan@archlinux.org>
The scriptlet calling had some unneeded complexity for the time being
which we aren't using here. Let's get rid of it until we find a good way
to implement it correctly.
Signed-off-by: Dan McGee <dan@archlinux.org>
First reported here:
http://bbs.archlinux.org/viewtopic.php?pid=261861
Newly created files were done with the standard umask, so those that are
extracted seperately and copied to a .pacnew extension will have the wrong
permissions. This should hopefully fix this.
Signed-off-by: Dan McGee <dan@archlinux.org>
The alpm_splitdep function formerly overwrote the input string, causing
a few issues. Fix this.
Signed-off-by: Nagy Gabor <ngaba@petra.hos.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
For future possibilities, don't extract any files that start with '.'.
This will allow us to add features such as the ChangeLog viewing without
having to wait to include these files in packages, because older versions
of pacman will be forward compatable with 'hidden' files at the root level
of the package.
Signed-off-by: Dan McGee <dan@archlinux.org>
This was a bad way to fix a problem upstream. Doing this resulted in
symlink permissions being applied to files installed on the system, leaving
some binaries with 77 permission, etc.
This reverts commit 4e6b7c1cde.
This function is an absolute disaster, so we'll take it one step at a time
here. This was a quick once-over of the whole thing, trying to straighten
out some of the spaghetti code and fix some mistakes that others found.
We are now down to two failing pactests again: sync300 and upgrade051.
Signed-off-by: Dan McGee <dan@archlinux.org>
This should hopefully allow multiple cache dirs to be specified in
pacman.conf and/or on the command line, and allow pacman to test
each one for the package file. The first one found to be writeable is
used as the download cache.
Signed-off-by: Dan McGee <dan@archlinux.org>
* Readd default logmask of ERROR and WARNING
* Remove DOWNLOAD log level as it no longer applies
* Add 'no targets' logic back in where it applies
* Switch some prints in parseconfig to ERROR
Signed-off-by: Dan McGee <dan@archlinux.org>
Remove the logmask functionality from the backend as it has been moved to
the frontend, and change the logging callback function to use pm_printf.
In addition, make much better use of va_list- use the args list instead
of a arbitrarily chosen string to print to in the logging functions.
Signed-off-by: Dan McGee <dan@archlinux.org>
Add some 'const' keywords all over the code to make it a bit more strict on
what you can and can't do with data. This is especially important when we
return pointers to the pacman frontend- ideally this would always be
untouchable data.
Signed-off-by: Dan McGee <dan@archlinux.org>
'inline' keyword in C99 is not correctly recognized, so compilation fails on
the warning it spits. This fixes this.
Signed-off-by: Dan McGee <dan@archlinux.org>
The db variable was left unset when calling alpm_db_register, leading
to a failure to ever register a sync db. Also added a check to ensure
DBPath was set when trying to register a database.
Signed-off-by: Dan McGee <dan@archlinux.org>