Age | Commit message (Collapse) | Author | Files | Lines |
|
When calling a function of the alpm_option_get_* group, you get a segfault
if you don't call alpm_initialize() first. With this patch those functions
set pm_errno to PM_ERR_HANDLE_NULL and return an error value if handle ==
NULL.
(Dan: modified to meet pacman coding standards)
Signed-off-by: Stefano Esposito <stefano.esposito87@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
My two previous hacks related to this part
(8038190c7c4786e1c49494eea1b40cdddcbd5136 and
b15a5194d1a8485a2769560e49e6ff03e1862533) were caused by the lack of
understanding of a feature introduced a while ago:
Better control over CTRL-C interruptions -- do not leave the DB in an
inconsistent state (54008798efcc9646f622f6b052ecd83281d57cda).
Now I have been looking at this commit, and the added feature is indeed
interesting. The main problem I had with it is that it does a rather
unusual use of alpm_trans_release, which caused a few problems that I tried
to fix in a weird way. I think these problems were caused by the fact that
there weren't any difference between "interrupt transaction" and "release a
transaction which failed" actions from the alpm_trans_release POV. So I
decided to add a new function instead, alpm_trans_interrupt, which is
called on Ctrl+C, and which only sets trans->state to STATE_INTERRUPTED so
that remove_commit and add_commit can exit cleanly at a safe moment. This
allowed me to revert my two previous hacks as well.
Also ensure we handle SIGINT correctly in all cases- if a transaction is
not ongoing, then we can free the transaction and exit quickly.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This reverts commit dfc85cb5f516ffbcff557522e9703c5c7d88b047
and b6f3fe6957d0206485eac98fb2120578b75d0058.
This DB check is already in testdb (among others).
Also testdb now uses the db path set at make time by default,
so specifying the db path is optional.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
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>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Fixes 'make dist' target as sha1.c and md5driver.c no longer exist.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
One string in de.po differed pretty strongly with its translated version.
It may still be totally wrong as far as translations go, but it compiles
now. Get translater to check.
Also, ensure the proper dbpath gets set in the db when it's created.
Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Suppose a package foo depends on foo1, foo2, ..., foon.
Doing pacman -Rc foo1 foo2 ... foon added foo n times to the removal list,
because what checkdeps return is something like :
foo1 is requiredby foo
foo2 is requiredby foo
...
foon is requiredby foo
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Introduce two new methods into the API - alpm_db_register_sync and
alpm_db_register_local, which replace the functionality of
alpm_db_register. db_register_local always returns the local DB, and
db_register_sync will always try to register a sync DB. This conceptually
separates the local DB from sync DBs in the code. Also updated the pacman
frontend to use the new functions. In addition, this changes the location
of all sync DBs in the filesystem from $DBPATH/$REPO to $DBPATH/sync/$REPO,
This removes the silly limitation that a sync DB couldn't be named 'local',
along with structurally separating sync DBs and the local DB in the
filesystem.
Signed-off-by: Travis Willard <travis@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
During last refactoring, a "continue" somehow became a "return(0)" :)
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
This allows us to remove the hack in the frontend where we added a newline
to everything coming out of the pm_printf functions, and instead let the
developer put newlines where they want them. This should be the last hangover
of that auto-newline stuff.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
As reported by JGC in FS #7652, the check for EACCES is not exactly correct.
We need to check for the ETXTBSY error as well. This is necessary on FreeBSD.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
A bunch of changes related to my first "real" install of pacman-git into
/usr/local and trying to use it.
* Shift some uses of free -> FREE in libalpm.
* Move stat and sanity checks of config paths into libalpm from the
config and argument parsing in pacman.c.
* Fix issue where dbpath still was not defined early enough due to its
requirement for being used in alpm_db_register. This should be rewritten
so it doesn't have this dependency, but this will work for now.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This patch cleans up and fix the _alpm_trans_update_depends function
and ensure that all requiredby fields are filled in case of multiple satisfiers
(previously, the handling of mutliple satisfiers in that function was inconsistent).
This makes a special case handling of requiredby in commit_single_pkg() obsolete,
and so allows cleaning that code as well.
Also fixed upgrade056 pactest because :
1) the requiredby fields were wrong, and this wouldn't happen with the fixed _alpm_trans_update_depends().
2) this is a very unusual case anyway (and handling all corner cases combined to a broken database
seems nearly impossible to achieve).
References :
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008919.html
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008920.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
In order to best resolve bug 6404, move some cachedir handling stuff out of
sync.c and into util.c and create two new functions: filecache_find and
filecache_setup. sync.c was rewritten to use these, and alpm_fetch_pkgurl
now also uses these routines.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
In my opinion, a commiting transaction that failed isn't equivalent
to a prepared transaction.
Some things could have been done in the meantime.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
* Move alpm md5 functions to lib/libalpm/util.c
* Remove unneeded includes for md5.h
* Replace md5 implementation with one from http://www.xyssl.org
Dan: clean up XySSL code by removing parts we don't use, and add a note
saying what changed.
Dan: fix alpm_get_md5sum, off by one error on the malloc call and other
small things.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
There's no need for a second hashing algorithm. MD5 serves the purpose
of verifying that a package file hasn't been corrupted during download.
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This basically moves the code from alpm_release, which was mostly about
unregistering all databases, to a safer alpm_db_unregister_all.
This allows to avoid modifying the dbs_sync list while iterating over it,
and and also prevent alpm_release from looping infinitely when a database
can't be unregistered.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
This prevents alpm_release to loop infinitely in case of
an interrupted transaction, where the database wasn't
unregistered.
alpm_release should probably also be fixed, as it can
still loop if db_unregister fails for another reason.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
We were using a void *data element in pmpkg_t before, which is unsafe by its
nature of being untyped. Reimplement data as origin_data being a union that
can hold either a path to a package file or a pointer to a cache database,
and make the other necesary updates in the code to reflect this. See package.h
for details.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Remove the commented desc_localized stuff, we can find it later in version
control. Also remove some unnecessary includes of the stat header and
use -fstack-protector-all which is a bit more broad.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
A side effect of the previous commit ( ea9a756eeaca7398c0860b55f8abe2932ad195bd )
is that it's now possible to use versioned conflicts.
Add two new conflict pactests for showing it.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
I didn't like the patch proposed by Nagy for the sync1002 pactest here:
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008971.html
So here is another attempt of fixing it.
In case of the DEPENDSONLY flag :
1) pass an empty list to resolvedeps instead of the list of targets
2) empty the trans->packages targets list before adding the resolved deps.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
Put all of the public functions at the top and inside the Doxygen packages
group.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
That function wasn't big, but this might be useful
for later refactoring of the search for satisfier code.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The _alpm_sortbydeps function has two main part :
1) initialization of the graph structure
2) the sorting itself
So it didn't seem bad to move the first part to a second function.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
.gitignore works recursively, so we don't need Makefile and Makefile.in
in all of the subdirectory .gitignore files.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This is a full refactoring of _alpm_add_commit into multiple functions and a
better layout for later. Some highlights:
* No regressions in pactest performance.
* Much cleaner layout. add_commit is split into four functions:
upgrade_remove, extract_single_file, commit_single_pkg, _alpm_add_commit
* No more super-functions, the heaviest (extract_single_file) is finally
under 400 lines, with much improved commenting as well.
* Incorporation of Andrew Fyfe's ideas for fixing FS #7484. Try to handle
all possible cases of extraction combinations with files, symlinks, dirs,
and non-existant entries on the filesystem. This should make our dealings
with libarchive fall more into our control.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
This replaces the former -D operation that was undocumented and rather
hacky. It can be used with add, upgrade, or sync transactions and will affect
all packages installed. Should close FS #7193.
Also tell makepkg to use this new flag.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
The resolvedeps function was a bit negligent, as showed by the sync011 pactest.
Reference :
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008782.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
|
|
This fixes the failure of the requiredby004 pactest in a not so pretty way,
but it gets the job done. I purposely used the extremely long name of
PM_TRANS_TYPE_REMOVEUPGRADE to be both clear and in the hope that someone
else will figure out a better solution.
Original idea from Nagy Gabor, patch updated and cleaned for current code.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
remove _alpm_ldconfig call from _alpm_sync_commit,
since sync operation causes an upgrade transaction,
where ldconfig is already run.
Reference:
http://www.archlinux.org/pipermail/pacman-dev/2007-April/008132.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
In 1c9f30b9fab998e2d89dd307a90122618d746cb6
This change should be done AFTER the TODO in recursedeps is implemented.
Then we'll be able to first sort the list, then call recursedeps which keeps
it sorted. For now, the sorting should still be done as the last step.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Patch from Nagy that makes removedeps use alpm_depcmp.
I also renamed removedeps to recursedeps, as it can have
a more general usage, and added an include_explicit argument,
so we can control if packages explictly installed are added or not.
Note: Small changes made by me (Dan) as well- mostly some English grammar
correction and a few other cleanups.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
|