Commit Graph

822 Commits

Author SHA1 Message Date
Nagy Gabor 47f4c5a480 Updated Hungarian translation
* Updated libalpm translation
* Regenerated hu.po files, because the 'call-for-translators version' was outdated

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-19 13:30:04 -06:00
Giovanni Scafora 16ed9ad19b Updated Italian Translation
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>

	modified:   lib/libalpm/po/it.po
	modified:   po/it.po
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-18 18:27:23 -06:00
Giovanni Scafora a11b2065af Updated Italian Translation for pacman 3.1
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-17 20:43:12 -06:00
Dan McGee ce424a356f Check for errors on descfile extraction
If /tmp was full during the early stages of package extraction, we were
unable to extract the package description file with the call to
archive_read_data_into_fd(archive, fd) becuase we never checked the return
code. Add a check to ensure the extraction was successful and print and
return an error if it was not instead of falling through to a possibly
untrue error message.

This should fix FS #8885.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-16 22:45:57 -06:00
Aaron Griffin 9558639d80 popen does NOT require /bin/sh in a subchroot
I appears that when chrooted, the /bin/sh used by popen is that of the parent
process. This is true until the process forks once chrooted, which we do not
want to do.

As such, this actually makes things nicer. We don't need a /bin/sh in a chroot
to run install scriptlets, and don't need to check for it in the root directory

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 23:03:16 -06:00
Aaron Griffin 565d2eeed5 Correct scriptlet usage pattern
The new pattern is as follows:
    . /path/to/scriptlet
    post_upgrade X Y

This requires less frameworking in the install scripts (the three lines that
shift and eval a function are nasty)

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 23:02:07 -06:00
Dan McGee 9781d0d637 Update GNU GPL boilerplate and copyright dates
Update the GPL boilerplate to direct people to the GNU website for a copy of
the license, as well as bump all of Judd's copyrights to 2007.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 22:55:39 -06:00
Dan McGee 7249c08bdf Improve changelog handling through addition of open/read/close functions
Thanks to Allan for inspiring all this work on what was one little TODO item
in the codebase. :)

Change changelog handling so we can now dump a changelog from both installed
packages and package files (fixes FS#7371). We do this by moving all of the
machinery to the backend where it should have been in the first place.

The changelog reading is now done through a open/read/close interface
similar to the fopen/fread/fclose functions (can you guess how it is done?).
It is buffered by the frontend, so programs using the library can read as
much or as little as they want at a time.

Unfortunately, I could not implement a changelog_feof function due to some
shortcomings of libarchive. However, I left the stub code in there,
commented out, in case it becomes possible later or anyone wants to take a
stab at it.

Original-work-by: Allan McRae <mcrae_allan@hotmail.com>
Improved-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-09 11:33:08 -06:00
Chantry Xavier 2ef78355fc _alpm_unpack: return 1 when the file is not found.
If _alpm_unpack has a specific file to extract (not NULL), but doesn't find
it, it'll now return 1, for indicating the failure.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-08 21:54:46 -06:00
Chantry Xavier 97fe3d3f5a libalpm/server.c : fix segfault when downloading failed.
The alpm_list_free(complete) needs to be done OUTSIDE the loop walking
through the server list.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-07 09:45:20 -06:00
Nagy Gabor 43eacf2852 Remove duplicated PM_TRANS_CONV_INSTALL_IGNOREPKG message
Now alpm_checkdeps first search for literals, then search for no-literal satisfiers

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: fix spelling of INTALL, fix line wrapping]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-05 11:28:47 -06:00
Chantry Xavier 87d95f14f7 libalpm/backup.c : simple refactoring.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-12-04 17:59:45 -06:00
Giovanni Scafora 0d1cb03756 Update it translation for 3.1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-03 09:11:34 -06:00
Jeff Bailes 4ce004a846 Update en_GB translation for 3.1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 22:36:18 -06:00
Dan McGee 3170106149 Update all translation files in anticipation of 3.1 release
Update all of the pot and po files with the latest messages available.

Translators- you are encouraged to do this as well every time you update the
translation, and the directions in 'translation-help' should help. Also feel
free to delete all the old translations that end up at the bottom of these
files and only clutter things up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 21:44:40 -06:00
Chantry Xavier 594f1fbbb1 alpm_list : change the alpm_list_find* to return the matching item.
alpm_list_find and alpm_list_find_ptr will now return a void *, and
alpm_list_find_str will return a char *, instead of an int.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 18:12:41 -06:00
Dan McGee 0b6d73a5b4 Remove _alpm_depmiss_isin
This is unneeded now that commit 2ed6b482d2
has eliminated the last user of this function.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 17:25:34 -06:00
Dan McGee 7341d09541 Add 4 new pactests to get better code coverage by pactest
I started playing around with gcov today and it showed a few places in the
code that we don't test at all. This is the start of ensuring that we
execute most of the code in our codebase.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 17:24:22 -06:00
Chantry Xavier 250331a636 Add new --needed option for -S.
During a pacman operation such as a group install, pacman can ask several
questions such as "local version is up to date. Upgrade anyway?". They are
usually all answered either by yes or by no:
* yes when you want to reinstall all the targets.
* no when you only want to install the missing ones (either because you are
installing a group, or because you are copying a pacman -S line from wiki or
whatever).

So instead of asking this question for each target, it is now now configured
with a flag.  Yes will be the default -S behavior, No will be achieved with
the --needed flag.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 11:14:13 -06:00
Chantry Xavier 22c2043160 Minor fixes in sync.c and deps.c.
* memleak found by Nagy in checkdeps
* an useless line found by Nagy in resolvedeps
* data wasn't set to the missing dependencies in sync_prepare
* use the MALLOC macro in resolvedeps

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-01 11:10:22 -06:00
Aaron Griffin 5f811dc020 Ensure 0644 permissions for install and changelog files
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-01 10:43:16 -06:00
Dan McGee cff1e2a58f Remove alpm_depcmp DEBUG output
alpm_depcmp is simple enough that we shouldn't need constant debug logging,
and the logging we do have in there negatively impacts our speed regardless
of whether we actually are seeing it or not. If it ever needs debugging, it
would be trivial to reimplement it by just temporarily reverting this
commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-30 23:02:06 -06:00
Dan McGee e95e346ac7 Remove some null checks in _alpm_checkdeps
Hopefully these are unnecessary, as they were probably added originally to
cover up a problem instead of finding the root cause. I'd rather fail hard
in these cases anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-30 22:57:47 -06:00
Nagy Gabor 2ed6b482d2 alpm_checkdeps clean-up
No bugfixes, just makes the code human-readable

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-30 21:17:04 -06:00
Nagy Gabor 72f40b3876 _alpm_checkconflicts split
_alpm_innerconflicts: check for target<->target conflicts
_alpm_outerconflicts: check for target<->localpkg conflicts
This will be useful in sync.c clean-up and in testdb.c

As an application the patch also fixes a misleading message (and a memleak)
in add.c

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25 16:14:16 -06:00
Nagy Gabor 7d37d9278d Fix for sync1003 and sync1004 pactests
checkdeps and resolvedeps now take both a remove list and an install list as
arguments, allowing dependencies to be calculated correctly.

This broke the sync990 pactest, but this pactest used dependencies and
provides in an unusual way, so it has been changed.

Dan: the sync990 pactest was just plain wrong. It didn't satisfy the
dependencies correctly, so should never have succeeded.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: some variable renaming, clarification in commit message]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25 15:29:37 -06:00
Aaron Griffin 6e8daa553b Force mode of all database files to 644
In the case of a packaging error where install or changelog had bad permissions,
pacman respected the original permissions without trying to fix it - this means
that some operations (changelog) artificially required root permissions to run

In addition, minor function housekeeping on _alpm_unpack

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-25 14:03:13 -06:00
Aaron Griffin c7879e77a7 Additionally search for non-regex strings on a db search operation
This closes out FS#6500 and covers cases where the package names contain regex
characters (i.e. the case of dvd+rw-tools)

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-25 14:02:25 -06:00
Aaron Griffin 7af1f66441 Make the download failure message more clear
Use the word "disk" in place of the host name for local files

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-25 14:02:03 -06:00
Chantry Xavier 8d9ee923ec Fix several memleaks, mostly related to errors handling.
* The frontend calls alpm_trans_prepare(&data), and in case of errors,
receive the missing dependencies / conflicts / etc in the data pointer.
It apparently needs to free this structure totally with :
alpm_list_free_inner(data, free)
alpm_list_free(data)

So I added alpm_list_free_inner(data, free) in
pacman/{sync.c,remove.c,add,c}

* in _alpm_sync_prepare, the deps and asked lists were not freed in case
of errors (unresolvable conflicts).
Besides the code for handling this case was duplicated.

* in _alpm_remove_commit, free was used instead of alpm_list_free for
newfiles.

* newline fix in pacman/sync.c

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25 14:01:19 -06:00
Chantry Xavier 8bee526d28 Fix a memleak in _alpm_sync_free.
An alpm_list_free call was missing.
Also make use of alpm_list_free_inner in both _alpm_sync_free and
_alpm_trans_free.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-25 14:00:38 -06:00
Dan McGee f5d2150e9d Remove -F/--freshen operation
This operation made sense in the days before sync DBs existed, but it no
longer has the same usefulness it once did.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-21 11:51:17 -06:00
Nagy Gabor 7cf28a7595 Improved 'dependency cycle' warning
From now on libalpm informs user about packages which will be
installed/removed in wrong order.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-21 10:25:52 -06:00
Chantry Xavier 83fa6aa289 Remove duplicated get_upgrades function, use sysupgrade instead.
The alpm_get_upgrades was exactly the same as find_replacements +
_alpm_sync_sysupgrade, except that it automatically made the eventual
replacements, without asking the user : Replace %s with %s/%s? [Y/n]

The replace question, asked in find_replacements. can now be skipped by
using a NULL trans argument, so that we get the same behavior as with
alpm_get_upgrades.

So alpm_db_get_upgrades() can now be replaced by
alpm_sync_sysupgrade(db_local, syncdbs).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-21 00:05:05 -06:00
Nagy Gabor 4696ad6cad New alpm_list_join function
This O(1) function joins 2 lists.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-20 23:31:40 -06:00
Dan McGee aa942a126b Add missing header includes for setlocale
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-20 11:01:56 -06:00
Nagy Gabor 84ebf82319 Versioned provisions.
This patch introduces versioned provisions in "provision 1.0-1" format.
_alpm_db_whatprovides was modified accordingly (added sync500.py),
alpm_depcmp was modified accordingly (add043.py passes now; added add044.py
and add045.py).

Notes:
alpm_db_search now uses the whole versioned %PROVIDES% string in its search.
debug logging was simplified in alpm_depcmp.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Xavier: fixed a few typos, duplicate const strings with strdup before
modifying them, put some debugging back in alpm_depcmp, minor code cleanups
(var/function renaming), added a note in PKGBUILD man page.]
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: made strcmp checks clearer, added a comment]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-18 20:05:51 -06:00
Dan McGee 23b4e0270b Fix sh and scriptlet interaction
dash doesn't pass positional parameters to sourced scripts, causing install
scripts to fail. Instead of sourcing the script, make it executable and
call it directly which allows positional parameters to be passed correctly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-18 16:49:02 -06:00
Nagy Gabor 2aa7e69da9 Add the pmconflict_t type.
pmdepmissing_t was used for two totally different things :
missing dependencies, and dependency conflicts.
So this patch simply adds a type for dep conflicts,
and convert the code to use it.

This fix the TODO in conflict.c :
/* TODO WTF is a 'depmissing' doing indicating a conflict? */

Additionally, the code in conflict.c now eliminates the duplicated conflicts.
If pkg1 conflicts with pkg2, and pkg2 conflicts with pkg1, only one of them will be stored.

However the conflict handling in sync_prepare (sync.c) is still very asymetrical, and very ugly too.
This should be improved in the future (there is already a pending patch from Nagy that cleans it a lot).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-11-18 12:42:39 -06:00
Chantry Xavier 65fb99133d Simple s/conflict/fileconflict/ renaming.
The names related to conflicts are misleading :
For dependencies conflicts, the type is pmdepmissing,
and the function names contain just "conflict".

For file conflicts, the type is pmconflict,
and some functions contained just "conflict", some others "fileconflict".

So this is the first step for improving the situation.
Original idea/patch from Nagy, but the patch already didn't apply anymore,
so I did it again.
The main difference is that I kept the conflictype, with the following renaming :

pmconflicttype_t -> pmfileconflicttype_t
PM_CONFLICT_TYPE_TARGET -> PM_FILECONFLICT_TARGET
PM_CONFLICT_TYPE_FILE -> PM_FILECONFLICT_FILESYSTEM

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-11-18 12:42:34 -06:00
Dan McGee 5f0c241987 POSIX shell does not specify meaning of source operation
Just use '.' operator instead. Oops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-18 12:37:29 -06:00
Nagy Gabor 55a7455135 libalpm/deps.c : improves IgnorePkg handling in resolvedeps.
resolvedeps will now search for other satisfiers
when we don't let it add a package from IgnorePkg.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-11-18 12:37:16 -06:00
Chantry Xavier 8f824e70bb Remove the IgnorePkg handling from alpm_pkg_compare_version.
And check the IgnorePkg handling is done correctly in the other places.
For example, -Qu and -Su will automatically skip the ignored packages (-Su will print a warning),
but -S will install ignored packages anyway, because it was asked explicitly.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-11-18 12:37:16 -06:00
Chantry Xavier c8be7540a5 Remove provide.c and provide.h .
This file only contained one private function : _alpm_db_whatprovides .
And the public alpm_db_whatprovides was in db.c , so I moved everything there.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: updated POTFILES.in as well]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-17 09:50:05 -06:00
Nagy Gabor d311ad067f Generalized alpm_list_find.
The old alpm_list_find was renamed to alpm_list_find_ptr, and a new
alpm_list_find was introduced, which uses the fn comparison-function
parameter in its decision.
Now both alpm_list_find_ptr (a new ptrcmp helper function was also
added) and alpm_list_find_str are just an alpm_list_find call.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: made ptrcmp a static function]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-17 09:44:48 -06:00
Dan McGee 3d10786394 Fix memleak in _alpm_trans_free with package lists
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-17 09:39:00 -06:00
Dan McGee cfcc550e2a libalpm: use FREELIST when possible
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-16 21:15:49 -06:00
Dan McGee 2322909703 War on whitespace
Run the kernel's cleanfile script on all of our source files.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-16 20:18:45 -06:00
Dan McGee 3cd684b41d libalpm: simplify sync db lastupdate
Legacy code is hitting the trash here. Remove unnecessary _alpm_time2string
time storage abstraction in favor of just writing the time_t value to the
disk.

The only drawback is that everyone's sync DBs will have to be updated at
least once so that the lastupdate values are stored right. :)

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-16 11:51:26 -06:00
Dan McGee 4ce13e2398 Fix a would-be memleak with the new compute requiredby stuff
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-15 08:05:10 -06:00