Commit Graph

196 Commits

Author SHA1 Message Date
Xavier Chantry d030d12542 src/pacman/sync.c : cleanup of pacman_sync
By putting the search / group / info / list operations just after the -Sy
op, we can simplify several checks :
1) the check for "missing targets". Since we took care of the above
operations, we now have less cases to consider :
* -Syu or -Su : we can proceed
* -Sy : we can end now (this is actually a bugfix)
* -S : this op requires targets, so exit with an error
2) the check to see if a transaction is needed. If we arrive at the end of
the function, it is either because we have -Su or -S <targets> so we already
know a transaction is needed there.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 16:25:31 -05:00
Dan McGee b48f703aa6 Add missing NULL set in group printing
If we don't set the pkgname var to NULL, we run into all sorts of beautiful
segfault behavior when a group spans multiple repositories and we try to
print out the location of the former list. Easy fix.

This regression was introduced in bf86700369.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29 17:25:07 -05:00
Chantry Xavier d5278ebb3b Add SyncFirst option.
This patch offers a way to fix FS#9228.
By putting "SyncFirst = pacman" in pacman.conf, the version check will
happen before the transaction really starts, and before any replacements is
made.
Otherwise, no version check is done.

The sync301 pactest was updated to use this SyncFirst option.

Example session with SyncFirst = pacman, and a newer pacman version
available :
$ pacman -Su (or pacman -S <any targets>)
:: the following packages should be upgraded first :
    pacman
:: Do you want to cancel the current operation
:: and upgrade these packages now? [Y/n]

resolving dependencies...
looking for inter-conflicts...

Targets: pacman-x.y.z-t

Total Download Size:    x.xx MB
Total Installed Size:   x.xx MB

Proceed with installation? [Y/n] n

As Nagy previously noted, doing this check on any -S operations might look
intrusive, but it can be required.
For example, the case where you want to install a package with versioned
provisions, using a pacman version which didn't support that feature yet
(and there is already a newer pacman in sync db supporting it).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Chantry Xavier f43805d875 Cleanup usages of alpm_list_find and alpm_list_remove.
* remove obsolete and unused *_cmp helper functions like deppkg_cmp and
_alpm_grp_cmp

* new alpm_list_remove_str function, used 6 times in handle.c

* remove _alpm_prov_cmp / _alpm_db_whatprovides and replace them by
a more general alpm_find_pkg_satisfiers with a cleaner implementation.
before: alpm_db_whatprovides(db, targ)
after: alpm_find_pkg_satisfiers(alpm_db_getpkgcache(db), targ)

* remove satisfycmp and replace alpm_list_find + satisfycmp usage by
_alpm_find_dep_satisfiers.
before : alpm_list_find(_alpm_db_get_pkgcache(db), dep, satisfycmp)
after : _alpm_find_dep_satisfiers(_alpm_db_get_pkgcache(db), dep)

* remove _alpm_pkgname_pkg_cmp, which was used with alpm_list_remove, and
use _alpm_pkg_find + alpm_list_remove with _alpm_pkg_cmp instead.

This commit actually get rids of all complicated and asymmetric _cmp
functions. I first thought these functions were worth it, be caused it
allowed us to reuse list_find and list_remove. But this was at the detriment
of the clarity and also the ease of use of these functions, dangerous
because of their asymmetricity.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13 15:49:02 -05:00
Allan McRae 3c3cb001a4 Make all error messages use pm_fprintf
Tested using many easily generated error conditions.  Also added "malloc
failure" (conf.c) and "segmentation fault" (pacman.c) error messages for
translation.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
[Dan: fix trailing whitespace errors, other compilation issues]
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-11 20:05:28 -05:00
Dan McGee a13bf74979 pacman-side code cleanups
When taking a look at PATH_MAX usage, I found a few small things we can
clean up or fix.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-08 20:58:33 -05:00
Chantry Xavier ff9744aa1f Refactor the trans init and release code.
The calls to alpm_trans_init and alpm_trans_release (+ error checking) were
duplicated between remove.c, sync.c and upgrade.c
This patch introduces trans_init and trans_release functions in util.c to
have this code just once.

So instead of having to do the same change 3 times for fixing FS#10273, I
just had to do it once (so I did it too :))

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26 11:15:09 -05:00
Dan McGee 4004bf9caf Remove libdownload reference from pacman frontend
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-06 20:02:39 -05:00
Dan McGee 5f17ac8150 Enable display of multiple groups in -Ss and -Qs output
Not too complicated of a fix, but just adds some code to loop over the
entire group list and space it out.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:41:13 -05:00
Dan McGee 4b8ada818e Fix segfault on -Qs usage
This segfault creeped in as a result of commit bf867003. We were incorrectly
assuming the group member of our package was a pmgrp_t list when in fact it
is just a string list, which caused a segfault on any -Qs operation.

Also slightly cleanup the -Ss code (which was originally correct unlike the
-Qs code).

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-30 16:36:55 -05:00
Dan McGee bf86700369 Switch pmgrp_t to dynamic allocation, general group cleanup
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 14:51:51 -05:00
Chantry Xavier 3d10d460df Add new CleanMethod option.
As it was already mentioned several times, the new -Sc behavior in 3.1 is
great, but only when the package cache is not shared.

This option has two possible values : KeepInstalled and KeepCurrent
With KeepCurrent, -Sc will clean packages that are no longer available in
any sync db, rather than packages that are no longer in the local db. The
resulting behavior should be better for shared cache.

Ref :
http://www.archlinux.org/pipermail/pacman-dev/2008-February/011140.html

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23 13:38:23 -05:00
Chantry Xavier d734ebdde2 libalpm: clean up of md5sum functions.
test_delta_md5sum and test_pkg_md5sum were simple wrappers to test_md5sum,
and only used once, so not very useful. I removed them.
Also, test_md5sum and alpm_pkg_checkmd5sum functions were a bit duplicated,
so I refactored them with a new _alpm_test_md5sum function in libalpm/util.c

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-27 19:02:17 -06:00
Chantry Xavier 143135e666 Improve yesno function.
Add a preset paramater to yesno function saying which answer should be the
default. Ref:
http://www.archlinux.org/pipermail/pacman-dev/2007-June/008470.html

This allows us to answer no by default to some questions, like the -Scc one
mentioned in the above thread, and implemented by this patch.

Another advantage is that we don't have to repeat the [Y/n] in every
questions. It's only put once in yesno function. This highly reduces the
chances that YES and NO strings are translated, but not some questions,
which lead to obvious confusions.

Finally, the noconfirm variable only needs to be used in that yesno
function. So all other usages of it were removed.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-24 18:17:49 -06:00
Chantry Xavier a3e6a6b822 Move -Sy operation into its own transaction
This allows us to remove the sync_only flag, and also do the following
steps in the future :
1) refresh the database (if asked)
2) do other stuff (eg checking if a newer pacman version is available)
3) start the actual transaction

Currently when we detect a newer pacman version, we have to release the
current transaction and start a new one.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-20 18:58:43 -06:00
Chantry Xavier 7879e4bef7 Lock the database on -Sc operation.
This partly fixes FS#9609.

Weird things could happen when running -Sc while another instance was
already running. The cleancache function could delete packages that were
just being downloaded.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-19 22:08:06 -06:00
Chantry Xavier 6f3949e3da Add new sync_trans_init and sync_trans_release.
Factorize these two functions to avoid code duplication, especially since
they could be used for locking the database during -Sc and -Sy operation
too.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-19 22:07:44 -06:00
Dan McGee fc9d12bef0 When cleaning DBs, only look at directories
FS#9609 brought up an interesting issue where a user was prompted to remove
db.lck when running a -Sc operation concurrently with an -Syu operation
during a long download. Although there are other problems here, this fixes
the issue where files other than directories could be considered to be
databases. Fix this.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-19 08:47:05 -06:00
Chantry Xavier 96ee1bca24 Clarify the "failed to add target" errors.
Make the error message printed when addtarget fails consistent between
add.c, remove.c and sync.c.

The main problem was that the "failed to add target" in case of a removal
operation could sound confusing.  There was also a little output problem
with -U ("failed" was missing).

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-02 18:55:24 -06:00
Chantry Xavier 0775c38e72 Clarify the "cancel current operation" message.
Fixes FS#9295.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: 'new pacman' -> 'new pacman version']
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-27 11:50:30 -06:00
Chantry Xavier 47761d5aec Move the fallback on providers from backend to frontend.
This reverts commit e28973169d.
This code might fit better in the frontend than in the backend finally.
Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010150.html

I also changed it for fixing FS#8763 :
if there is exactly one provider, pacman will pull it and print a warning.
if there are several providers, pacman will list them and fail. It's up to
the user to pick one. Add sync501 pactest to reflect that.
2008-01-09 18:33:11 -06:00
Nathan Jones 7fdb2ee48a Check ignored packages in _alpm_sync_addtarget().
This will allow someone to install a group but ignore individual
packages inside the group.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-21 11:09:24 -06:00
Allan McRae e5cdac7d48 Only query pacman upgrade when performing actual upgrade
Fixes FS#7147.  Do not ask about upgrading pacman when -w and -p
flags are used.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-17 20:44:21 -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
Chantry Xavier b6acb30aae src/pacman/: use the FREELIST macro when possible.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-08 21:56:40 -06:00
Chantry Xavier c49b2a00d6 pacman/sync.c : improve the sync db cleanup feature.
This feature (introduced by b118ce55bd as a
part of -Sc) could actually be helpful in the 3.0 -> 3.1 transition, because
all sync dbs will be left in /var/lib/pacman/, while the updated ones will
go to /var/lib/pacman/sync/.
So it'll now clean everything in /var/lib/pacman/, and only the unused
databases in /var/lib/pacman/sync/ (with the exception of local/ and sync/
in both cases).

Note: This feature is undocumented. I wonder if moving it to another option,
something like -S --dbclean, wouldn't help for documenting it.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-05 19:57:35 -06:00
Dan McGee f42e223386 pacman/sync.c: mark sync_trans as static
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-03 22:50:33 -06:00
Nagy Gabor c15f7710de Unify dump_pkg_full in pacman [-Si, -Qip, -Qi and -Qii]
dump_pkg_sync is now a trivial wrapper for dump_pkg_full
Some smaller changes:
* string_display function added to util.c [prints None in case of empty string]
* Filename field added to -Qip
* rename License to Licenses
* 'Compressed Size' used instead of 'Download Size' for -Qip

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: fix whitespace errors, spacing issues, const modifiers]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-01 11:58:07 -06:00
Artyom 1e9a1a0292 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>
2007-11-25 14:33:32 -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
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
Chantry Xavier 829a7b904d 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>
2007-11-18 12:37:52 -06:00
Chantry Xavier b118ce55bd 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>
2007-11-18 12:37:16 -06:00
Chantry Xavier e28973169d 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>
2007-11-17 09:51:04 -06:00
Nagy Gabor 04b7d2ad14 Two memleak fixes in pacman.
Both memleak was an unfreed alpm_db_whatprovides list.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2007-11-17 09:39:12 -06:00
Aaron Griffin 434ea5bf61 Typo fix (sepArately)
Found by Giovanni Scafora <linuxmania@gmail.com>

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-11 09:52:17 -06:00
Aaron Griffin cc15d29db2 Missing quote in output
Found by Giovanni Scafora <linuxmania@gmail.com>

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-11-11 09:52:07 -06:00
Chantry Xavier 0686fec839 Remove the newline automatically added by alpm_logaction.
This way, _alpm_logaction behaves like _alpm_log, and gives more control.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-11-04 18:04:43 -06:00
Dan McGee 86ca39d15e Clean up usage of extern variables
Instead of declaring the extern variable in every *.c file, include it in
the header file that makes sense. This means handle.h for the handle, and
conf.h for the pacman side config object.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-04 12:05:22 -06:00
Nagy Gabor 0cff7c6bdf Add alpm_dep_get_string method
Public alpm_dep_get_string function is introduced, which converts a
pmdepend_t structure to printable string in %DEPENDS% format.  This
function is now used in pacman to print dependency error messages.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-25 07:10:08 -05:00
Dan McGee 0c4f7d821c Fix broken or missing includes
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-22 23:37:38 -05:00
Nathan Jones f5b77eb989 Add download size to target list.
This displays the download size, taking into account delta files and
cached files.

This closes FS#4182.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-19 19:30:06 -05:00
Chantry Xavier 98bcd1f5b1 Fix -Sy and -Sp operations.
When the -Sy operation failed, the lock wasn't removed because
alpm_trans_release wasn't called. This is fixed now.

Also, after my last change in commit 52e7e6d747 ,
Sp didn't do anything anymore.
That's because needs_transaction returned false for -Sp, so the sync transaction
wasn't run. However, the current implementation of -Sp requires a sync transaction.

Also, since a transaction creates the lock file at the beginning, and releases it
at the end, this mean that -Sp requires root access anyway..

I think I understand now why Aaron found that the current -Sp implementation is hackish :)

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-04 18:13:09 -05:00
Chantry Xavier 52e7e6d747 needs_transaction adjustments
I just moved the root path check out of needs_transaction, and put it directly
in pacman.c . I think this part is alright.

For the other problems, I thought about doing the transaction first, in a new
sync trans function, which will init and release a transaction.  And then doing
the commands like -Ss / -Sl / -Sg / -Si.

The problem is that for commands like -Sys / -Syl / etc, only the refresh part
of the transaction should be done.  So I had to introduce an ugly sync_only
hack.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-10-03 21:02:36 -05:00
Aaron Griffin b86479cf9b Allow --refresh specified for most -S options
Included options are -g, -i, -s, and -l
All of these will sync the DB if -y is specified and permissions are
appropriate.

Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2007-09-28 00:25:57 -05:00
Dan McGee 219808714f Add 'full' parameter to alpm_pkg_load
In most cases, we want to fully scan a package when we load it, which serves
as a integrity verification check. However, there are times when it is only
desired to read the metadata and nothing else, so allow the caller of pkg_load
to choose the behavior they need.

This pays big dividends in speeding up pacman cache cleaning functionality.
Old (729 packages):
real    1m43.717s
user    1m20.785s
sys     0m2.993s
New (729 packages):
real    0m25.607s
user    0m19.389s
sys     0m0.543s

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-28 00:16:43 -05:00
Dan McGee 16cb8e6e61 Reimplement pacman cache cleaning the right way
Partial cache cleaning was eliminated in a previous commit because it relied
on package naming conventions. Re-add it the correct way- we actually open
up each package in the cache and get a name and version out of it. If the
name and version match that of an installed package, keep it. If the package
is not installed or the version does not match the locally-installed version,
get rid of it.

This can easily be modified if some other heuristic of keeping and removing
packages is desired, or if we should clean out the cache dir of any files
that are not packages, etc.

The biggest current problem with this new approach- speed. Here is one run
on my local machine, going from 1643 to 729 packages in the cache (753 in
the local DB):
real    4m25.829s
user    3m22.527s
sys     0m6.713s

This is likely best addressed by the package loading scheme, which may be
loading the entirety of each package archive, which is a waste when we only
need the .PKGINFO file read.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-28 00:16:43 -05:00
Dan McGee f7bbfe4052 Remove package name dependency from libalpm
Previously, package names must match a specified scheme or they will cause
pacman add operations to fail. This is not a very intelligent or necessary
way to act, so remove the dependency on the name of the package to be
installed and read all relevant information from the metadata instead.

This does have one causality to be addressed later- pacman cache cleaning
functionality, which has never been phenomenal, just lost most capability.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-28 00:16:43 -05:00
Stefano Esposito 27acdc2c94 make alpm_strerror binding friendly
I'm currently working on python bindings for alpm written in pyrex. While
working i found that declaring alpm_strerror as
	char * alpm_strerror (void)
instead of
	char * alpm_strerror (int err)

and then using pm_errno in the implementation instead of err, could make it
more bindings-friendly.

Dan: cleaned up and added void to declaration. Instead of replacing existing
function, add a new function called 'alpm_strerrorlast(void)'.

Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-11 20:58:27 -05:00