summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2007-09-28Remove package name dependency from libalpmDan McGee1-114/+6
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-28document the -Qii option.Chantry Xavier1-1/+1
I suppose -Qii could be used for other things than displaying the list of backup files, but currently, it's the only one, so that's how I documented it.. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-26Preliminary support for optdependsDan McGee1-0/+1
Add some alpm functions for getting optdepends, have makepkg include them in the PKGINFO file, and have a pacman -Qi operation display the raw string as stored by libalpm. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-17trans.c : reworking of transaction interruptionsChantry Xavier1-3/+8
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>
2007-09-17Remove the DB consistency check from pacman and libalpm.Chantry Xavier5-43/+23
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>
2007-09-12Add testdb util for finding inconsistencies in the database.Chantry Xavier3-1/+194
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-12make alpm_strerror binding friendlyStefano Esposito5-32/+32
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-12Make some small changes recommended by splintDan McGee4-22/+24
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-07Add a few missing includes, caught while compiling on cygwinDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-27separate local from sync dbs on filesystemTravis Willard1-8/+2
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>
2007-08-26pacman/sync.c : kill extra newline with groups on -Ss operation.Chantry Xavier1-1/+1
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-24libalpm: add newlines to all strings passed to log callbackDan McGee1-2/+0
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>
2007-08-22pacman.c: clarify reason for doing 2 strcmp operationsDan McGee1-0/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-22Various valgrind mem leak fixesDan McGee1-2/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-22Add a default cachedir if one wasn't specifiedDan McGee2-0/+7
Use the default cachedir (specified at compile time) if one wasn't specified on the command line or in the config file. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-22Post trial install changes, round oneDan McGee3-55/+57
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>
2007-08-16Fix some errors spit out by -WextraDan McGee3-8/+7
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16Remove support for SHA1 from pacman.Andrew Fyfe1-17/+4
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>
2007-08-16pacman.c: Alphabetize listing of query optionsDan McGee1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-16new query options : explicit (-Qe) and deps (-Qd).Chantry Xavier3-8/+29
The t shortcut for --test was removed, the orphan option (previously -Qe) was renamed to -Qt, -Qe lists all packages installed explictly, and -Qd lists all packages installed as dependencies. Besides, t can be combined with either e or d. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-16libalpm/query.c : makes orphans and foreign options as filters.Chantry Xavier1-129/+76
The --foreign and --orphans functions now behave as a filter for the other options. This cleans the code a bit, and will make easier the adding of new filter options, like explicit (show only explictly installed packages) or depends (show only packages installed as dependencies). Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-08-16src/util: Clean up headers and a few fixesDan McGee3-19/+14
Remove some unnecessary headers in the two utilities as well as fix a possible non-null termination issue in vercmp. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-08-14Code cleanupDan McGee2-2/+0
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>
2007-08-13pacman/sync.c : return 0 on succesful search, 1 otherwise.Chantry Xavier1-1/+4
Closes FS#7690. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-23Cleanup of pacman.c and addition of default paths to frontendDan McGee2-40/+54
Instead of barfing when the root path and db path haven't been defined, have pacman set them to some sane defaults when they aren't specified on either the command line or the config file. Also do some cleaning of error output and Doxygen comments. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-16Remove unnecessary entries from .gitignore filesDan McGee2-4/+0
.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>
2007-07-16new pmdepend_t / pmdepmissing_t accessors.Chantry Xavier4-19/+23
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15Add --asdeps option to pacmanDan McGee3-11/+12
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>
2007-07-12Fix previous makepkg patch, and some pacman output.Andrew Fyfe1-3/+3
makepkg: We still need the source files in $srcdir because PKGBUILDS need access to noextract() files and other file not handled by by extract_source(). (eg config files) query.c: Fix some output formating. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-07-12Remove 'buildtype' from libalpm and pacmanDan McGee1-3/+1
Remove unused buildtype field from pmpkg_t struct and anything associated with it, as it is unused at the moment. If we need to readd it, it is an easy revert of this commit. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-11Use mbstowcs instead of strlen where applicableSergej Pupykin1-3/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-10Remove gettext calls from all PM_LOG_DEBUG messagesDan McGee1-22/+22
There is no real reason to burden our translators with these messages, as anyone helping to debug these will probably want them in English. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-10Cleanup of pacman_deptest()Andrew Fyfe1-10/+7
Clean up some left over code from http://projects.archlinux.org/git/gitweb.cgi?p=pacman.git;a=commitdiff;h=7653bb93997f52848b54ab80868cd6da52808a75 Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-09Change the exit code for pacman_deptest().Andrew Fyfe1-1/+1
Changed the exit code for missing deps from 1 to 127 because 1 is used for other errors. makepkg breaks if pacman exits with 1 for any reason other than a missing dep. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-07-09Remove gettext from any alpm_logaction callsDan McGee2-5/+5
We shouldn't translate log messages to pacman.log so it is consistant and can be parsed by other tools. Remove all gettext _() around these strings. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-06First step of moving translations from src/pacman/po to po/Dan McGee17-11353/+0
Move the translations from src/pacman/po to just po/ so we can include the scripts gettext translations in the same message catalog as that of the pacman frontend. The libalpm message catalog, for now, will remain a separate existence. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-02pacman/query.c : return after a query on all packages.Chantry Xavier1-0/+1
Previously, the following error was displayed even after a valid and successful query operation on all packages, like -Q , -Ql, -Qi, -Qil : no targets specified (use -h for help) Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-07-02pacman/packages.c : print an error for files that can't be stated.Chantry Xavier1-3/+8
The -Ql operation is supposed to print all files but directories. stat was used for detecting directories. However, when stat failed, (because the file doesn't exist or is not readable), the files were still displayed just like the others. Now, these files are printed on stderr, with the corresponding error message. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-06-28Remove lockfile configuration from frontend, make it job of libalpmDan McGee2-11/+0
I previously introduced some patches to make just about every path in pacman/libalpm configurable; doing this with the lockfile seemed a bit too far and we really should just place the lockfile where it belongs- with the DB that needs locking. More details in this thread: http://archlinux.org/pipermail/pacman-dev/2007-June/008499.html Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-28pacman.c: make parseconfig a bit more robustDan McGee1-12/+21
Don't let parseconfig overwrite settings that parseargs already made. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-28Remove scriptlet START and DONE commands that we don't useDan McGee1-14/+0
The scriptlet calling had some unneeded complexity for the time being which we aren't using here. Let's get rid of it until we find a good way to implement it correctly. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-17Remove some use of goto in the pacman frontendDan McGee2-30/+48
Refactor the goto cleanup; statements out of add.c and remove.c, and move what the cleanup: label did into a function. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-13Clean up pacman/sync.c and organize it a bitDan McGee2-11/+40
Re-add some checks for a valid target list. In addition, move variable declarations to the most local scope possible, which should help in finding errors that were previously uncaught. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-13Remove some more diskspace checking holdover stuffDan McGee2-24/+3
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-13Functionalize query.c and pacman_queryDan McGee1-111/+168
Move a lot of the operations that pacman query performs into their own functions for ease of following the flow and for possible later merges with their sync counterparts. We need to think less in terms of operations and more in term of overall concepts. Also (re)introduced checks for the target list on a -Q operation, ensuring that we only call certain query operations when it is sane to do so. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-12pacman util.h: Add missing stdarg.h includeDan McGee1-0/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-11Implement simple topological sort algorithm for sortbydepsNagy Gabor1-2/+2
Based on the "depth first search" algorithm, for more infos visit: http://en.wikipedia.org/wiki/Topological_sorting The previous algorithm used by sortbydeps was too slow, and to work around it the number of steps needed to get correct result was reduced greatly. So it produced wrong results in several cases : 1) smoke001.py 2) http://bugs.archlinux.org/task/7229 More here: http://archlinux.org/pipermail/pacman-dev/2007-April/008057.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-11Ensure correct and consistent usage of depmissChantry Xavier2-3/+3
See comment from Nagy here : http://www.archlinux.org/pipermail/pacman-dev/2007-April/008134.html This also makes easier correct usage of checkdeps in sync.c, which fixes sync901 pactest (and so bug 6057). Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09pacman.c: Refine error messages used by parseconfigDan McGee1-7/+14
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-06-09Allow multiple CacheDirs to be specifiedDan McGee2-5/+13
This should hopefully allow multiple cache dirs to be specified in pacman.conf and/or on the command line, and allow pacman to test each one for the package file. The first one found to be writeable is used as the download cache. Signed-off-by: Dan McGee <dan@archlinux.org>