pacman.git
16 years ago_alpm_checkconflicts splitmaster
Nagy Gabor [Tue, 20 Nov 2007 08:57:38 +0000 (20 09:57 +0100)]
_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>
16 years agopacman/query.c : -Qo optimization.
Chantry Xavier [Sun, 25 Nov 2007 22:13:56 +0000 (25 16:13 -0600)]
pacman/query.c : -Qo optimization.

I didn't understand why realpath was called on every files of every filelist
in query_fileowner :
ppath = resolve_path(path);

It turns out this is needed for the diverted files. For example, cddb_get
installs /usr/lib/perl5/site_perl/5.8.8/CDDB_get.pm which actually ends in
/usr/lib/perl5/site_perl/current/CDDB_get.pm .

And for making pacman -Qo /usr/lib/perl5/site_perl/current/CDDB_get.pm ,
realpath has to be called on both the target, and the file in the filelist.

However, realpath is costly, and calling it on every single file resulted
in a poor -Qo performance. Worst case :
pacman -Qo /lib/libz.so.1  0.35s user 1.51s system 99% cpu 1.864 total

So I did a little optimization to avoid calling realpath as much as
possible: first compare the basename of each file.

Result:
src/pacman/pacman -Qo /lib/libz.so.1  0.24s user 0.05s system 99% cpu 0.298
total

Obviously, the difference will be even bigger at the first run (no fs
cache), though it's quite scary on my system : 1.7s vs 40s previously.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoMove mbasename from pacman.c to util.c
Chantry Xavier [Sun, 25 Nov 2007 22:13:30 +0000 (25 16:13 -0600)]
Move mbasename from pacman.c to util.c

This function can be useful in other places.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix for sync1003 and sync1004 pactests
Nagy Gabor [Sun, 12 Aug 2007 20:26:54 +0000 (12 22:26 +0200)]
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>
16 years agoAdd -q/--quiet option for controlling output.
Artyom [Wed, 7 Nov 2007 07:05:33 +0000 (7 01:05 -0600)]
Add -q/--quiet option for controlling output.

Currently this only affects -Ss, -Sl, and -Q to output less information (only
package names).

In the future, we can reuse this flag for other things as well.

[Aaron: rewritten as a front-end flag]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
[Dan: squashed commits together]
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix memleak when querying package file(s)
Dan McGee [Sun, 25 Nov 2007 20:12:00 +0000 (25 14:12 -0600)]
Fix memleak when querying package file(s)

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoForce mode of all database files to 644
Aaron Griffin [Thu, 15 Nov 2007 01:22:06 +0000 (14 19:22 -0600)]
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>
16 years agoAdditionally search for non-regex strings on a db search operation
Aaron Griffin [Thu, 15 Nov 2007 06:07:31 +0000 (15 00:07 -0600)]
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>
16 years agoMake the download failure message more clear
Aaron Griffin [Thu, 15 Nov 2007 19:19:49 +0000 (15 13:19 -0600)]
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>
16 years agoFix several memleaks, mostly related to errors handling.
Chantry Xavier [Wed, 21 Nov 2007 18:51:46 +0000 (21 19:51 +0100)]
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>
16 years agoFix a memleak in _alpm_sync_free.
Chantry Xavier [Wed, 21 Nov 2007 16:10:20 +0000 (21 17:10 +0100)]
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>
16 years agoRemove -F/--freshen operation
Dan McGee [Wed, 21 Nov 2007 17:25:50 +0000 (21 11:25 -0600)]
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>
16 years agoAdd some additional files to .gitignore
Dan McGee [Wed, 21 Nov 2007 16:35:27 +0000 (21 10:35 -0600)]
Add some additional files to .gitignore

*.lineno - these show up when you use a shell less-featured than bash
cscope.*.out - These show up when you build reverse databases using -q

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoImproved 'dependency cycle' warning
Nagy Gabor [Wed, 21 Nov 2007 00:03:08 +0000 (21 01:03 +0100)]
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>
16 years agoRemove duplicated get_upgrades function, use sysupgrade instead.
Chantry Xavier [Fri, 24 Aug 2007 22:10:40 +0000 (25 00:10 +0200)]
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>
16 years agodoc: use source highlighter on PKGBUILD guide, update wrong example text
Dan McGee [Wed, 21 Nov 2007 01:06:37 +0000 (20 19:06 -0600)]
doc: use source highlighter on PKGBUILD guide, update wrong example text

Note that if you are building manpages with asciidoc now, you must also
have source-highlight installed for it to correctly generate everything.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoTurn HACKING into an asciidoc document
Dan McGee [Wed, 21 Nov 2007 00:58:09 +0000 (20 18:58 -0600)]
Turn HACKING into an asciidoc document

Add some hints so we can use asciidoc on the HACKING document. It is still
readable as text, but a simple 'asciidoc HACKING' command will give you a
nice pretty guide now.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoNew alpm_list_join function
Nagy Gabor [Tue, 20 Nov 2007 08:11:40 +0000 (20 09:11 +0100)]
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>
16 years agoUpdate PKGBUILD manpage with versioned conflicts.
Chantry Xavier [Mon, 19 Nov 2007 17:23:04 +0000 (19 18:23 +0100)]
Update PKGBUILD manpage with versioned conflicts.

As the b96922679e4ed14aa687bf194b766d82a1d10577 commit showed with two
pactests (which were renamed to depconflict110/111), versioned conflicts are
now possible.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd missing header includes for setlocale
Dan McGee [Tue, 20 Nov 2007 17:01:56 +0000 (20 11:01 -0600)]
Add missing header includes for setlocale

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoSpruce up HACKING a bit
Dan McGee [Mon, 19 Nov 2007 21:46:02 +0000 (19 15:46 -0600)]
Spruce up HACKING a bit

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoVersioned provisions.
Nagy Gabor [Fri, 16 Nov 2007 21:37:57 +0000 (16 22:37 +0100)]
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>
16 years agoFix sh and scriptlet interaction
Dan McGee [Sun, 18 Nov 2007 22:49:02 +0000 (18 16:49 -0600)]
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>
16 years agoAdd the pmconflict_t type.
Nagy Gabor [Sun, 18 Nov 2007 13:25:43 +0000 (18 14:25 +0100)]
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>
16 years agoSimple s/conflict/fileconflict/ renaming.
Chantry Xavier [Sun, 18 Nov 2007 09:29:55 +0000 (18 10:29 +0100)]
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>
16 years agoMinor rephrasing of the question asked by -Sc.
Chantry Xavier [Sat, 17 Nov 2007 22:35:22 +0000 (17 23:35 +0100)]
Minor rephrasing of the question asked by -Sc.

Suggested by stonecrest on irc :
'I think "uninstalled" would be better, as it implies that the package was once
installed and since removed. Otherwise a user might wonder why there are
non-installed pkgs in cache'

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
16 years agoPOSIX shell does not specify meaning of source operation
Dan McGee [Sun, 18 Nov 2007 17:23:10 +0000 (18 11:23 -0600)]
POSIX shell does not specify meaning of source operation

Just use '.' operator instead. Oops.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoExtend the -Sc operation to also clean up unused sync databases.
Chantry Xavier [Sat, 17 Nov 2007 21:52:03 +0000 (17 22:52 +0100)]
Extend the -Sc operation to also clean up unused sync databases.

We discussed this with stonecrest on IRC :
20:46   stonecrest >> someone brings up a good point.. why aren't repos that aren't in the pacman.conf removed from /var/lib/pacman?
20:46   stonecrest >> i have 118mb and 24 dirs in there, but only 5 repos at present
21:26   stonecrest >> shining: i guess you could prompt the user on deleting every dir in /var/lib/pacman.. since it shouldn't happen that often except for
                      the first time
21:30   stonecrest >> could be part of pacman -Sc.. what else were you thinking?

I already heard about this before, but it sounded dangerous to me. I didn't even think about a simple prompt.
I also didn't know where this code would fit. And it fits well with -Sc, I borrowed most of the code from sync_cleancache.

Example session :

Cache directory: /var/cache/pacman/pkg/
Do you want to remove non-installed packages from cache? [Y/n] n
Database directory: /var/lib/pacman/
Do you want to remove unused repositories? [Y/n]
Do you want to remove /var/lib/pacman/sync/pacman-git? [Y/n]
Do you want to remove /var/lib/pacman/sync/deltatest? [Y/n]
Database directory cleaned up

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agolibalpm/deps.c : improves IgnorePkg handling in resolvedeps.
Nagy Gabor [Sun, 12 Aug 2007 21:41:30 +0000 (12 23:41 +0200)]
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>
16 years agoRemove the IgnorePkg handling from alpm_pkg_compare_version.
Chantry Xavier [Fri, 16 Nov 2007 14:34:04 +0000 (16 15:34 +0100)]
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>
16 years agoDon't filter package files output based on dir/file status
Dan McGee [Sat, 17 Nov 2007 18:56:31 +0000 (17 12:56 -0600)]
Don't filter package files output based on dir/file status

This caused more problems than it solved, especially with -Qlp output
and files that are new to the new package.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agopacman/sync.c : remove duplicated fallback on providers.
Chantry Xavier [Sat, 17 Nov 2007 13:05:48 +0000 (17 14:05 +0100)]
pacman/sync.c : remove duplicated fallback on providers.

The fallback on providers when a target is not found was already made in the backend :
libalpm/sync.c , _alpm_sync_addtarget .
So I removed it from the frontend.

The sync500 pactest proves this fallback still works correctly.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoRemove provide.c and provide.h .
Chantry Xavier [Sat, 17 Nov 2007 12:06:44 +0000 (17 13:06 +0100)]
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>
16 years agoGeneralized alpm_list_find.
Nagy Gabor [Fri, 16 Nov 2007 19:50:58 +0000 (16 20:50 +0100)]
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>
16 years agoTwo memleak fixes in pacman.
Nagy Gabor [Fri, 16 Nov 2007 21:48:29 +0000 (16 22:48 +0100)]
Two memleak fixes in pacman.

Both memleak was an unfreed alpm_db_whatprovides list.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
16 years agoFix memleak in _alpm_trans_free with package lists
Dan McGee [Sat, 17 Nov 2007 15:39:00 +0000 (17 09:39 -0600)]
Fix memleak in _alpm_trans_free with package lists

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agolibalpm: use FREELIST when possible
Dan McGee [Sat, 17 Nov 2007 03:15:49 +0000 (16 21:15 -0600)]
libalpm: use FREELIST when possible

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoWar on whitespace
Dan McGee [Sat, 17 Nov 2007 02:18:45 +0000 (16 20:18 -0600)]
War on whitespace

Run the kernel's cleanfile script on all of our source files.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agolibalpm: simplify sync db lastupdate
Dan McGee [Fri, 16 Nov 2007 17:51:26 +0000 (16 11:51 -0600)]
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>
16 years agoAdd new mirror (FS#8638)
Dan McGee [Thu, 15 Nov 2007 14:07:45 +0000 (15 08:07 -0600)]
Add new mirror (FS#8638)

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix a would-be memleak with the new compute requiredby stuff
Dan McGee [Thu, 15 Nov 2007 14:05:10 +0000 (15 08:05 -0600)]
Fix a would-be memleak with the new compute requiredby stuff

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoEnsure -Si and -Qi output show correct dependencies
Dan McGee [Tue, 13 Nov 2007 06:37:11 +0000 (13 00:37 -0600)]
Ensure -Si and -Qi output show correct dependencies

Because alpm_pkg_get_depends() no longer returns strings as the data, we
need to first convert the returned structures to printable strings before
we can print the list.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agolibalpm: change graph malloc to MALLOC macro
Dan McGee [Thu, 15 Nov 2007 04:51:47 +0000 (14 22:51 -0600)]
libalpm: change graph malloc to MALLOC macro

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix alpm_list_copy_data
Dan McGee [Thu, 15 Nov 2007 04:51:16 +0000 (14 22:51 -0600)]
Fix alpm_list_copy_data

So I spent a good 4 hours tracking a bug down tonight due to
alpm_list_copy_data not actually doing what I expected to do. We can't find
the size of an object we don't know the type of, so rewrite it so we pass
in the size explicitly. This was making _alpm_pkg_dup fail and causing all
sorts of other issues.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoMove alpm_splitdep usage to db_read
Dan McGee [Tue, 13 Nov 2007 05:01:14 +0000 (12 23:01 -0600)]
Move alpm_splitdep usage to db_read

Holy inefficient batman! For a pacman -Qt operation (when we are using
compute_requiredby and not database entries), splitdep was being called ~1.3
million times on my local database. By splitting when we read the DB, we
drop this number to around 1700 and save a LOT of time in doing so (a 5x
increase in pacman -Qt speed here).

Note that the depends alpm_list_t in the package struct is no longer a
string list, but a list of pmdepent_t objects.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agotestdb: remove requiredby checking
Dan McGee [Tue, 13 Nov 2007 03:28:13 +0000 (12 21:28 -0600)]
testdb: remove requiredby checking

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoRemove REQUIREDBY checks from pactest
Dan McGee [Tue, 13 Nov 2007 01:45:03 +0000 (12 19:45 -0600)]
Remove REQUIREDBY checks from pactest

Remove any checks dealing with requiredby from pactest (but not actually
from the pactests themselves). Of course, we should probably find a new way
to check requiredby values of packages since there is no guarantee our code
is working perfectly.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoRemove REQUIREDBY usage from libalpm
Dan McGee [Tue, 13 Nov 2007 01:40:08 +0000 (12 19:40 -0600)]
Remove REQUIREDBY usage from libalpm

Instead of using the often-busted REQUIREDBY entries in the pacman database,
compute them each time they are required. This should help many things:

1. Simplify the codebase
2. Prevent future database corruption
3. Ensure when we do use requiredby, it is always correct
4. Shrink the pmpkg_t memory overhead

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agonew trans001.py pactest
Nagy Gabor [Wed, 14 Nov 2007 19:02:47 +0000 (14 20:02 +0100)]
new trans001.py pactest

The pactest demonstrates what happens if fileconflict was found after the
removal part of a sync transaction.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agonew add043.py pactest
Nagy Gabor [Wed, 14 Nov 2007 18:56:41 +0000 (14 19:56 +0100)]
new add043.py pactest

Currently alpm_depcmp uses pkg->version as a version number for provisions,
which is odd.  The failure of the pactest demonstrates this.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoalpm_list_add == alpm_list_add_last
Nagy Gabor [Wed, 14 Nov 2007 11:42:15 +0000 (14 12:42 +0100)]
alpm_list_add == alpm_list_add_last

It's time to define that alpm_list_add(list, foo) adds 'foo' to the end of
'list' and returns with 'list', because:
1. list is a list, not a set.
2. sortbydeps _needs_ an alpm_list_add definition to work properly.

As a first step, I used this definition in recursedeps.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: punctuation cleanup in commit message and code comments, added comment
to alpm_list_add]
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoMake it easier to ignore multiple packages.
Nathan Jones [Wed, 14 Nov 2007 00:32:56 +0000 (13 19:32 -0500)]
Make it easier to ignore multiple packages.

This makes --ignore and --ignoregroup able to accept multiple
packages/groups by separating each with a comma.

For instance: pacman -Su --ignore kernel26,udev,glibc

This was requested in the comments of FS#8054.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd help for --ignoregroup.
Nathan Jones [Tue, 13 Nov 2007 23:38:11 +0000 (13 18:38 -0500)]
Add help for --ignoregroup.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
[Dan: split usage line into two lines for clarity]
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agopacman-optimize: add note saying sync would be helpful
Dan McGee [Wed, 14 Nov 2007 02:56:15 +0000 (13 20:56 -0600)]
pacman-optimize: add note saying sync would be helpful

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agorepo-add: Ensure only adding package's deltas.
Nathan Jones [Mon, 12 Nov 2007 21:54:50 +0000 (12 16:54 -0500)]
repo-add: Ensure only adding package's deltas.

repo-add was adding the delta files of any package that started with the
same package name plus a hyphen.

In this example, deltatest-libs delta files were added to the deltatest
package:

$ repo-add deltatest.db.tar.gz deltatest-1.0.2-1-i686.pkg.tar.gz
==> Extracting database to a temporary location...
==> Adding package 'deltatest-1.0.2-1-i686.pkg.tar.gz'
  -> Removing existing package 'deltatest-1.0.2-1'...
  -> Creating 'desc' db entry...
  -> Computing md5 checksums...
  -> Creating 'depends' db entry...
  -> Creating 'deltas' db entry...
  -> Added delta 'deltatest-1.0.2rc3-1_to_1.0.2-1-i686.delta'
  -> Added delta 'deltatest-libs-1.0.0-1_to_1.0.1-1-i686.delta'
==> Creating updated database file /tmp/deltatest.db.tar.gz

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoconfigure: Doxygen is disabled by default; manpages are included in dist
Dan McGee [Tue, 13 Nov 2007 05:36:20 +0000 (12 23:36 -0600)]
configure: Doxygen is disabled by default; manpages are included in dist

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoEnforce const correctness on dep functions and rewrite alpm_dep_get_string
Dan McGee [Tue, 13 Nov 2007 04:48:15 +0000 (12 22:48 -0600)]
Enforce const correctness on dep functions and rewrite alpm_dep_get_string

Add some const specifiers to the dep functions that can have them. In
addition, rewrite alpm_dep_get_string to use snprintf and cover all of
the bases (operators).

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoReturn libalpm version number to being dot-separated
Dan McGee [Tue, 13 Nov 2007 01:10:43 +0000 (12 19:10 -0600)]
Return libalpm version number to being dot-separated

I think I goofed this up when making the big overhaul of configure.ac.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd pactest for IgnoreGroup.
Nathan Jones [Mon, 12 Nov 2007 21:54:30 +0000 (12 16:54 -0500)]
Add pactest for IgnoreGroup.

Also tell pactest to reset IgnoreGroup like it does for IgnorePkg.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate valgrind.supp to ignore ld 2.X dl_relocate
Dan McGee [Tue, 13 Nov 2007 06:12:57 +0000 (13 00:12 -0600)]
Update valgrind.supp to ignore ld 2.X dl_relocate

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix display of -Qip output when a package file is given
Dan McGee [Sun, 11 Nov 2007 21:02:33 +0000 (11 15:02 -0600)]
Fix display of -Qip output when a package file is given

Too many fields were being shown on -Qip output, and sizes were not always
correct (-Qi and -Qip output on the same package did not agree).

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoRemove 'Total Package Size'
Dan McGee [Sun, 11 Nov 2007 20:14:07 +0000 (11 14:14 -0600)]
Remove 'Total Package Size'

Having 'Total Installed Size' and 'Total Download Size' makes this size
unnecessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix memleak with new alpm_list_reverse usage
Dan McGee [Sun, 11 Nov 2007 18:59:45 +0000 (11 12:59 -0600)]
Fix memleak with new alpm_list_reverse usage

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd a horrible little hack to get symlink001.py to pass again
Dan McGee [Sun, 11 Nov 2007 17:30:16 +0000 (11 11:30 -0600)]
Add a horrible little hack to get symlink001.py to pass again

This really doesn't give us any regressions in behavior, so it is safe to
do although quite ugly. Tell the conflict checking code to ignore symlinks
to dirs so that they are not seen as conflicts.

Hopefully this entire commit will get factored out soon enough.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd two requiredby pactests
Chantry Xavier [Sun, 11 Nov 2007 16:52:51 +0000 (11 10:52 -0600)]
Add two requiredby pactests

One currently should succeed (006), and 005 fails.

requiredby005.py is originally from Nagy Gabor <ngaba@petra.hos.u-szeged.hu>.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoEnsure list tail pointer is updated when we remove tail node
Dan McGee [Sun, 11 Nov 2007 16:47:28 +0000 (11 10:47 -0600)]
Ensure list tail pointer is updated when we remove tail node

Commit 2ee90ddae23dd86c68223c0d6c49f0b92d62429d did a special check to see
if we were removing the head node, but not the tail node. Add a special case
for the tail node to ensure all relevant pointers get updated.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoIncorrect usage of alpm_db_whatprovides in sync.c
Nagy Gabor [Sat, 10 Nov 2007 17:11:40 +0000 (10 18:11 +0100)]
Incorrect usage of alpm_db_whatprovides in sync.c

 The old code thought that alpm_db_whatprovides returns with a list of strings (package names).
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoTypo fix (sepArately)
Aaron Griffin [Fri, 9 Nov 2007 08:45:22 +0000 (9 02:45 -0600)]
Typo fix (sepArately)

Found by Giovanni Scafora <linuxmania@gmail.com>

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
16 years agoMissing quote in output
Aaron Griffin [Fri, 9 Nov 2007 08:16:08 +0000 (9 02:16 -0600)]
Missing quote in output

Found by Giovanni Scafora <linuxmania@gmail.com>

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
16 years agolibalpm: fix lstat wrapper to actually use newpath
Dan McGee [Sun, 11 Nov 2007 15:37:59 +0000 (11 09:37 -0600)]
libalpm: fix lstat wrapper to actually use newpath

Commit b55abdce7aebb142ce79da3aa3645afe7693a3c4 introduced an lstat wrapper
function that never dereferences paths with a trailing slash, but still
called lstat on path instead of newpath. Oops!

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoRemove unused and broken alpm_list_remove_node function
Dan McGee [Sun, 11 Nov 2007 15:36:03 +0000 (11 09:36 -0600)]
Remove unused and broken alpm_list_remove_node function

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd a missing newline in sync confirmation output
Dan McGee [Sun, 11 Nov 2007 15:28:35 +0000 (11 09:28 -0600)]
Add a missing newline in sync confirmation output

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd a symlink-based pactest
Dan McGee [Fri, 9 Nov 2007 14:40:09 +0000 (9 08:40 -0600)]
Add a symlink-based pactest

This passes with both the upcoming 3.1 devel tree and the 3.0.6 pacman code.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate bash completion
Dan McGee [Fri, 9 Nov 2007 06:23:25 +0000 (9 00:23 -0600)]
Update bash completion

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate Hungarian translation
Nagy Gabor [Fri, 9 Nov 2007 06:01:45 +0000 (9 00:01 -0600)]
Update Hungarian translation

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agopacman: remove leftover help string for -Rh
Dan McGee [Fri, 9 Nov 2007 05:59:02 +0000 (8 23:59 -0600)]
pacman: remove leftover help string for -Rh

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoImplement TotalDownload option.
Nathan Jones [Sat, 10 Nov 2007 00:54:19 +0000 (9 19:54 -0500)]
Implement TotalDownload option.

Setting this option will change the download progress to show the amount
downloaded, download rate, ETA, and download percent of the entire
download list rather than per each individual file.

The progress bar is still based on the completion of the current file
regardless if the TotalDownload option is set.

This closes FS#7205.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd TotalDownload option.
Nathan Jones [Sat, 10 Nov 2007 00:54:18 +0000 (9 19:54 -0500)]
Add TotalDownload option.

This will be used in the next commit.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoImplement IgnoreGroup.
Nathan Jones [Sat, 10 Nov 2007 01:13:29 +0000 (9 20:13 -0500)]
Implement IgnoreGroup.

This option acts as if IgnorePkg was set on each package in the group.

This closes FS#1592.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd IgnoreGroup and --ignoregroup option.
Nathan Jones [Sat, 10 Nov 2007 01:13:28 +0000 (9 20:13 -0500)]
Add IgnoreGroup and --ignoregroup option.

This will be used in the next commit.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agomakeworld: gettext support
Giovanni Scafora [Fri, 9 Nov 2007 18:43:48 +0000 (9 19:43 +0100)]
makeworld: gettext support

Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agomakepkg: remove .pacsave files when uninstalling dependencies
Roman Kyrylych [Sun, 11 Nov 2007 14:25:44 +0000 (11 16:25 +0200)]
makepkg: remove .pacsave files when uninstalling dependencies

Signed-off-by: Roman Kyrylych <roman@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoSimplify callback DONE event handling
Dan McGee [Fri, 9 Nov 2007 05:41:05 +0000 (8 23:41 -0600)]
Simplify callback DONE event handling

Move them all to a single fallthrough case statement since they all print
"done".

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd missing 'done' printout
Dan McGee [Fri, 9 Nov 2007 05:39:07 +0000 (8 23:39 -0600)]
Add missing 'done' printout

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoSmall manpage updates
Dan McGee [Fri, 9 Nov 2007 05:38:32 +0000 (8 23:38 -0600)]
Small manpage updates

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix some issues with localized dates/epoch usage
Dan McGee [Fri, 9 Nov 2007 05:18:07 +0000 (8 23:18 -0600)]
Fix some issues with localized dates/epoch usage

Commit 47622eef4dd8fd86a0aa0e3ebdb7b33f7c9d6804 introduced localized times
in the metadata by way of storing the UNIX epoch value instead of a hard
coded date string. However, it missed a few things:
* If we weren't in the C/POSIX/en_US locale, the date parsing would fail
  as it tried to use the abbreviations of the locale being used. Fix this
  by switching the LC_TIME value before we parse a date.
* We used ctime to print the date value, which is always the C locale
  string. Instead, use strftime to print a localized date string.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoGet rid of the footnotes section in generated manpages
Dan McGee [Fri, 9 Nov 2007 03:56:53 +0000 (8 21:56 -0600)]
Get rid of the footnotes section in generated manpages

We really don't need it since it is just links. However, we do need to figure
out how to get our old links to show up right.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agodoc: update links in footer.txt so they are actual links
Dan McGee [Fri, 9 Nov 2007 03:17:59 +0000 (8 21:17 -0600)]
doc: update links in footer.txt so they are actual links

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate Italian Translation
Giovanni Scafora [Fri, 9 Nov 2007 03:16:07 +0000 (8 21:16 -0600)]
Update Italian Translation

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate PKGBUILD.5 with missing devel variable descriptions
Dan McGee [Thu, 8 Nov 2007 15:33:05 +0000 (8 09:33 -0600)]
Update PKGBUILD.5 with missing devel variable descriptions

The lack of descriptions on some of the variables was causing issues with
documentation generation. Adding text to them fixes this.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoSync asciidoc.conf with GIT repository changes
Dan McGee [Thu, 8 Nov 2007 15:31:58 +0000 (8 09:31 -0600)]
Sync asciidoc.conf with GIT repository changes

We got our file from the GIT repository originally, so keep it up to date.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoCorrectly handle version comparisons for SVN/CVS/etc PKGBUILDS.
Scott Horowitz [Thu, 8 Nov 2007 07:26:01 +0000 (8 00:26 -0700)]
Correctly handle version comparisons for SVN/CVS/etc PKGBUILDS.

Retrieve SVN/CVS/etc revision number before checking if the
package has already been built. This allows building a newer
version of a developmental package without having to use -f.
Now -f will only be needed if the latest SVN/CVS/etc revision
is the same as the built package.

Signed-off-by: Scott Horowitz <stonecrest@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate the PKGBUILD example in the manpages
Dan McGee [Thu, 8 Nov 2007 00:58:04 +0000 (7 18:58 -0600)]
Update the PKGBUILD example in the manpages

The old one was old. Use something a bit more recent and a bit simpler as
well so it actually looks OK in the manpage.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoChange -fstack-protector flag to -fstack-protector-all
Dan McGee [Tue, 6 Nov 2007 22:07:33 +0000 (6 16:07 -0600)]
Change -fstack-protector flag to -fstack-protector-all

We only use it with --enable-debug, so we might as well go all out and try
to find any attempt of stack smashing.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoUpdate en_GB translation
Jeff Bailes [Tue, 6 Nov 2007 14:24:39 +0000 (6 08:24 -0600)]
Update en_GB translation

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoAdd STRDUP macro to mirror MALLOC/CALLOC
Aaron Griffin [Wed, 7 Nov 2007 04:50:21 +0000 (6 22:50 -0600)]
Add STRDUP macro to mirror MALLOC/CALLOC

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
16 years agoMaintain list tail pointers in the head node
Aaron Griffin [Tue, 6 Nov 2007 06:55:45 +0000 (6 00:55 -0600)]
Maintain list tail pointers in the head node

List head nodes contain null 'prev' pointer, which we can (ab)use to maintain a
back reference to the tail pointer of the list.

While list additions are not _significantly_ improved, they are still sped up.

Original
   $ time pacman -Qo /usr/bin/wtpt
   /usr/bin/wtpt is owned by lcms 1.17-2

   real    0m3.623s
   user    0m1.883s
   sys     0m1.473s

New
   $ time pacman -Qo /usr/bin/wtpt
   /usr/bin/wtpt is owned by lcms 1.17-2

   real    0m2.006s
   user    0m0.263s
   sys     0m1.627s

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
16 years agoComment out paths by default in pacman.conf
Dan McGee [Tue, 6 Nov 2007 03:20:16 +0000 (5 21:20 -0600)]
Comment out paths by default in pacman.conf

Now that all paths are defined to reasonable defaults at compile time by
pacman, we shouldn't force users to have RootDir, DBPath, etc. in their
default pacman.conf although these options are always available.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agolibalpm/db.c: change two warnings to errors
Dan McGee [Tue, 6 Nov 2007 02:57:43 +0000 (5 20:57 -0600)]
libalpm/db.c: change two warnings to errors

These two warnings really indicate failure, so the message they print should
do so as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
16 years agoFix mercurial complaining about directory already existing
Sebastian Nowicki [Mon, 5 Nov 2007 07:37:37 +0000 (5 16:37 +0900)]
Fix mercurial complaining about directory already existing

Signed-off-by: Dan McGee <dan@archlinux.org>