summaryrefslogtreecommitdiff
path: root/src/pacman/add.c
Commit message (Collapse)AuthorAge
* Remove frontend add code that is no longer necessaryDan McGee2008-03-08
| | | | | | | | | | | Change the pacman_upgrade stub function to do what pacman_add used to do so we can eliminate pacman_add. Move the code to the more-descriptive name of upgrade.c. Note that we have made no changes to the backend libalpm, where an ADD type transaction could still be supported. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove done and failed msg when loading targets.Chantry Xavier2008-02-25
| | | | | | | | | | | | | This change is similar to the one made in 3017b71cb5cde3aef7e0efb5f49843cccf759956. We had a "loading package data..." message, followed by either "failed" or "done", but it didn't take into account that other warnings / questions could be displayed between. Ref: http://archlinux.org/pipermail/pacman-dev/2008-January/010971.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Add gettext call to 2 'failed' messagesDan McGee2008-02-16
| | | | | Noticed-by: Vojtěch Gondžala <vogo@seznam.cz> Signed-off-by: Dan McGee <dan@archlinux.org>
* Clarify the "failed to add target" errors.Chantry Xavier2008-02-02
| | | | | | | | | | | | 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>
* two string fixes.Chantry Xavier2008-01-20
| | | | | | | * added a newline to a conflict message in add.c * removed the trailing dot in a replace message in callback.c. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Update GNU GPL boilerplate and copyright datesDan McGee2007-12-10
| | | | | | | 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>
* src/pacman/: use the FREELIST macro when possible.Chantry Xavier2007-12-08
| | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix several memleaks, mostly related to errors handling.Chantry Xavier2007-11-25
| | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add the pmconflict_t type.Nagy Gabor2007-11-18
| | | | | | | | | | | | | | | | | | 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>
* Simple s/conflict/fileconflict/ renaming.Chantry Xavier2007-11-18
| | | | | | | | | | | | | | | | | | | | 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>
* War on whitespaceDan McGee2007-11-16
| | | | | | Run the kernel's cleanfile script on all of our source files. Signed-off-by: Dan McGee <dan@archlinux.org>
* Clean up usage of extern variablesDan McGee2007-11-04
| | | | | | | | 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>
* Add alpm_dep_get_string methodNagy Gabor2007-10-25
| | | | | | | | 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>
* make alpm_strerror binding friendlyStefano Esposito2007-09-11
| | | | | | | | | | | | | | | | | 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>
* new pmdepend_t / pmdepmissing_t accessors.Chantry Xavier2007-07-16
| | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove some use of goto in the pacman frontendDan McGee2007-06-17
| | | | | | | 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>
* Remove some more diskspace checking holdover stuffDan McGee2007-06-13
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix up things after the last few changesDan McGee2007-06-09
| | | | | | | | | * Readd default logmask of ERROR and WARNING * Remove DOWNLOAD log level as it no longer applies * Add 'no targets' logic back in where it applies * Switch some prints in parseconfig to ERROR Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove hardcoded defines from libalpmDan McGee2007-06-04
| | | | | | | | Remove any use of the former path variables defined by the Makefiles or config.h. These are now runtime configurable only with pacman.conf (or by using flags on the command line). Signed-off-by: Dan McGee <dan@archlinux.org>
* Move DB and cache dirs away from there dependence on ROOTDIRDan McGee2007-05-31
| | | | | | | | | | | | | | | | | | | This change allows us to use all autoconf specified paths, most notably $(localstatedir). It is quite a change and touches a lot of files, as all references to the DB and cache were done with the ROOTDIR as a prefix. * add --lock command-line option to pacman to specify the location of the lockfile (this can now be specified at configure time by setting the $localstatedir path). * Rip quite a few settings out of configure.ac as they are now picked by setting the paths during configure or make. * Fix bug with /tmp fallback for sync downloads not working correctly (related to root location, now the system tmp dir is used). * Simplified the parameters to some libalpm functions, and added get/set for the new lockfile option. * Renamed several of the DEFS to names without the PM_ prefix. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove output.c and output.hDan McGee2007-04-26
| | | | | | | One function was left in this set of files after the earlier cleansing, so I moved yesno to util.c. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove ERR calls from the codeDan McGee2007-04-26
| | | | | | | | All ERR() calls have been replaced with fprintf(stderr, ...). Still to be done- fix all the newline issues that are sure to pop up. What fun! Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove MSG output macro (#define and in code)Dan McGee2007-04-26
| | | | | | | | This is the first step of converting output to standard functions such as printf, and eventually allowing compiliation with the -pedantic flag as is done on the libalpm side. Signed-off-by: Dan McGee <dan@archlinux.org>
* Move log.c/h -> output.c/h to properly reflect what is containedDan McGee2007-04-26
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Pacman side code consolidation- unify callback functions to one fileDan McGee2007-04-26
| | | | | | | | | | Some more major code reorginization here. The download progress callback function has been renamed and moved to callback.c, which is the former trans.c with the download and log callbacks added. In addition, this allows util.c to be cleaned up as fill_progress can now be static in callback.c. We've also cut two more source files out. Signed-off-by: Dan McGee <dan@archlinux.org>
* add.c and remove.c cleanupDan McGee2007-04-25
| | | | | | | Unification and cleanup of the add.c and remove.c code. It looks remarkably similar, so this may be a candidate for functionalization at a later time. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove more unnecessary stuffDan McGee2007-04-25
| | | | | | | | | * Remove libintl.h from most files, as we only need to include it once in util.h where _() is defined. * Remove other unnecessary header inclusions. * Remove a macro that was only used once and replaced it with actual code. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary includes of downloadprog.hDan McGee2007-04-25
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove single-function upgrade.cDan McGee2007-04-25
| | | | | | | | Move pacman_upgrade into add.c, at least for now. It really doesn't need its own file. For the long term, we may want to move this whole file back to upgrade.c if we deprecate the add operation. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge single-function header files on pacman sideDan McGee2007-04-25
| | | | | | | Having a seperate header file for add, remove, query, etc. seemed overkill. Merge them all into a common pacman.h and fix the necessary #includes. Signed-off-by: Dan McGee <dan@archlinux.org>
* This commit looks much more monumental than it is. Almost all just #includeDan McGee2007-03-05
| | | | | | | | reordering and adding ones that were forgotten (noticed when trying to compile after reordering). * Updated the HACKING file to include information on #include usage. * print -> vprint in "making dir" function in pactest.
* * Just a note for future referenceAaron Griffin2007-03-01
|
* * conflicts are returned with the full path, so prepending root is redundantAaron Griffin2007-02-23
|
* * Updated a too-verbose message in pacman/add.c. (shouldn't be an issue withiDan McGee2007-02-14
| | | | | | translations, but may want to update at some point) * More libalpm/conflict.c changes. Optimized more, hopefully won't need too much more than this.
* * Added archive verification when loading package metadata for -u and -AAaron Griffin2007-02-04
| | | | | | | operations (now aborts on a corrupt archive) * Fixed the pm_fprintf newline error that was plaguing us. It seems a line resetting 'neednl' was removed a while back (by me). This causes all the output errors we've been seeing
* Add newlines to error messagesDan McGee2007-02-03
|
* * Tried to clean up newline display a bit in the frontend.Dan McGee2007-02-01
| | | | | | * Removed useless buildstring function from util.h; replaced all calls of it with list_display. * Made list_display output 2 spaces instead of 1 between each item.
* Debug logging changes:Aaron Griffin2007-01-31
| | | | | | | | | | | | | | | | * The --debug params were goofy. New setup allows --debug without params, --debug=<level> where level 1=debug output, 2=debug and download output, 3=debug, download, and function tracing output. This seems more sane to me. * Removed PM_LOG_FLOW1 and PM_LOG_FLOW2. They were just confusing. When adding new functions, it is near impossible to determin if your output should be "flow1" or "flow2" without tracking all the way up the call chain. Rarely would one ever say "ok, lets just show "flow2" output. These have both been replaced with PM_LOG_DEBUG * Removed the need for the root parameter on alpm_initialize. it is now defaulted to PM_ROOT just like dbpath and cachedir. This allows alpm to be initialized BEFORE option parsing in the front end, saving us some duplicate variables in the frontend. * Cleaned up front end variables due to early alpm_initialize call.
* More uninitialized stuff... I believe these were removed at some point. ShouldAaron Griffin2007-01-31
| | | | be fixed.
* * Shuffled some of the alpm_list free funtions - still not perfect, but betterAaron Griffin2007-01-24
| | | | | | | | | | * Added alpm_list_remove_node for single list node removal * Proper error checking/output for failed db_read/db_write (missing files) * Invalid packages (missing files) are now removed from the package cache * -Qs and -Ss output now look the same * config.rpath causes errors on one machine I had, so I added it to CVS * Fixed a "clobbered memory" issue when installing groups - only the outer list should be free'd, not the contained data
* This mainly deals with code clarity- removing currently unneededAaron Griffin2007-01-24
| | | | | | | | | | optimizations in order to make the code much more readable and type-checkable. Every enum in the library now has it's own type that should be used instead of the generic 'unsigned char'. In addition, several #define statements dealing with constants were converted to enums. Signed-off-by: Dan McGee <dpmcgee@gmail.com>
* Preliminary checkin for alpm_list conversionAaron Griffin2007-01-19
| | | | | | | | | * renamed pmlist_t -> alpm_list_t * made alpm_list_t a public type (alpm_list.h header) * removed additional storage for registered DBs in pacman source * some code cleanup * removed duplicate (pm)list_display functions from pacman source * misc code cleanup
* * Completed getinfo api changes (pmmissing_t, pmtrans_t, etc)Aaron Griffin2006-11-22
| | | | | | | | * Modified some dependancy checking * Changed "performing local database upgrade" message to be more clear * Change 'usize' to 'isize' in database files * Scriptlet output is now sent to pacman's log file * Limited some debugging output to be more clear
* * Fixed a double free which happened in 2 cases in --syncAaron Griffin2006-11-22
|
* * repo-add script - to add entries to a db file directly from package data ↵Aaron Griffin2006-11-20
| | | | | | | | | | (no PKGBUILD) * libalpm api changes - move from a _getinfo(p, WHAT_WE_WANT) scheme to a typesafe _get_what_we_want(p) scheme [not 100% complete yet] * some const correctness changes * removal of PM_* types in alpm.h in favor of the pm*_t types used throughout libalpm
* * Numerous mini valgrind fixes.Aaron Griffin2006-11-14
| | | | | | | | | | * Addition of hacky architecture check in the _splitname function * Removal of libfetch from the archlinux proper - it has been renamed to libdownload and can be found at http://phraktured.net/libdownload * Merge of _some_ of the Frugalware makepkg change - this may still be incomplete * Removal of libftp from cvs proper * PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he)
* Merged frugalware changes. Added a few other minor things too, but there's alotAaron Griffin2006-10-15
| | | | to list. The diff should show you 8)
* first stage of i18n stuff from VMiklosJudd Vinet2006-05-15
|
* added support for the PM_CONFLICT structure to handle file conflictsAurelien Foret2006-02-05
|
* added missing retval values in trans_release error casesAurelien Foret2006-01-27
|