summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
...
* | libalpm/package.c : add _alpm_pkgname_pkg_cmp function.Nagy Gabor2008-02-06
| | | | | | | | | | | | | | | | | | | | | | _alpm_pkgname_pkg_cmp(pkgname, pkg) returns true iff pkg's name is pkgname. This is useful if you want to remove a package from pmpkg_t* list, and you want to search for package name. This allows cleaning the -Ru code a bit, by removing the need of a dummy pkg. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | New remove option : -u / --unneeded (FS#6505).Nagy Gabor2008-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With --unneeded option 'pacman -R' doesn't stop in case of dependency error; it removes the needed-dependency targets from the target-list instead. See also: http://archlinux.org/pipermail/pacman-dev/2007-October/009653.html . The patch also adds a new causingpkg field to pmdepmissing_t which indicates the to-be-removed package which would cause a dependency break. This is needed, because miss->depend.name may be a provision. miss->causingpkg will be useful in -R dependency error messages too. [Xavier: renamed inducer to causingpkg, removed the _alpm_pkgname_pkg_cmp helper function as requested by Aaron. This might be added by a further commit. Other small cleanups, updated manpage and bash completion.] Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | pmsyncpkg_t cleanupNagy Gabor2008-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for sync044.py and reason001.py. Rename sync->data to sync->removes (alpm_list_t *) Replace pmsynctype_t sync->type by pmpkgreason_t sync->newreason The type field was set to UPGRADE or DEPEND or REPLACE. Instead of using type = UPGRADE or DEPEND, we now rather use a "pmpkgreason_t newreason" field directly (= explicit or depend) which allows a better handling of the install reason. And the REPLACE type is now deduced implicitly when the sync->removes list is not empty. 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>
* | Fix PM_ERR_CONFLICTING_DEPS handling in sync.cNagy Gabor2008-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | * eliminate asymmetry (innerconflict vs. outerconflict) * fix a memleak (in case of PM_ERR_MEMORY deps wasn't freed) * fix wrong pmconflict_t duplication (*retconflict = *conflict) Note: the new code introduces some code duplication which shall disappear by fixing FS#7524. 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>
* | New _alpm_conflict_dup functionNagy Gabor2008-01-27
| | | | | | | | | | | | | | Added function to cleanly duplicate a conflict. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | small sync.c code clean-upNagy Gabor2008-01-27
| | | | | | | | | | | | | | | | | | | | Remove unnecessary synclist_free function, and use our standard way (alpm_list_free_inner + alpm_list_free) instead. This slightly reduces code duplication. 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>
* | libalpm/sync.c : conflicts resolving cleanup.Chantry Xavier2008-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original patch from Nagy tried to resolve target vs target conflicts, and so broke the following pactests : sync040, sync041 and sync990 Nagy's proposal to solve this situation was to choose the interactive way, ask the user how to deal with it: either remove pkg1 or remove pkg2 or stop here. So he left this as a TODO. But instead of trying to resolve these conflicts or asking the user, I tried to find a more conservative way, looking at what the current pactests expected: If between the two conflicting packages, one provides the other, pacman will keep that one and remove the other from the target list. That breaks sync893 and sync897. But Dan agreed these two looked weird and should be changed. This commit should close FS#8897, FS#8899 and FS#9024. Reference: http://www.archlinux.org/pipermail/pacman-dev/2007-October/009745.html http://www.archlinux.org/pipermail/pacman-dev/2007-December/010393.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix flip-flopped parameters to CALLOC macroDan McGee2008-01-23
| | | | | | | | | | | | | | The mixup causes a fail in the build using --enable-debug on x86_64 but not i686, so none of us caught this right away. Fix it. FS#9297. Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm/cache.c : don't duplicate packages in pkgcache.Chantry Xavier2008-01-23
| | | | | | | | | | | | | | | | | | Edit _alpm_db_add_pkgincache to not duplicate packages, because this is not needed, is slower, and uses more memory. This made the max memory usage during base reinstall go from 10.4MB to 9.7MB. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add new public alpm_checkdbconflicts function.Chantry Xavier2008-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | This function has a limited purpose, but might be interesting to do a sanity check from a frontend (eg testdb). Also removed the private _alpm_checkconflicts function to avoid confusion. This function was used only once in libalpm, in sync.c, and was just a single line anyway. Having to do it manually makes it explicit that we are looking for two kind of conflicts (targ vs targ and db vs targ). Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | small memleak fix in sync.c.Chantry Xavier2008-01-23
| | | | | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | conflict.c: move debug message out of inner loopDan McGee2008-01-21
| | | | | | | | | | | | | | | | | | We have a debug message in the target vs. target file conflict check, and this is a bit rediculous when it comes to watching output from something like smoke001.py. Instead, put the output outside this inner loop so we only see it at most once per target, which is much more reasonable. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix memleak found by add004.pyDan McGee2008-01-21
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | New --asexplicit optionNagy Gabor2008-01-21
| | | | | | | | | | | | | | | | | | | | | | This is the symmetric of --asdeps, install packages explicitly. Documentation and completion files were updated accordingly. Added sync301.py and upgrade032.py pactest files to test this. I also made a little modification in ALLDEPS handling too. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | Move the deptest code from frontend to backend.Chantry Xavier2008-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deptest code (pacman -T) used by makepkg was mostly in the frontend. There were 2 drawbacks: 1) the public splitdep function returns a pmdepend_t struct, but the _alpm_dep_free function for freeing it is private. So there was a memleak. 2) there is a helper in the backend (satisfycmp in deps.c) which makes this function much easier. So this adds a new public alpm_deptest in libalpm/deps.c, which cleans pacman_deptest in pacman/deptest.c a lot. Besides, alpm_splitdep was made private, because the frontend no longer requires it, and _alpm_dep_free is also private. Finally the deptest001 pactest was extended. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Convert deltas to dynamic allocationDan McGee2008-01-21
| | | | | | | | | | | | | | | | Another elimination of a static length structure in libalpm. Should result in a little more memory saved during execution of packages with lots of deltas attached. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-01-18
|\|
| * Portuguese Brazilian translation update for pacman 3.1.1João Felipe Santos2008-01-19
| | | | | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
| * Corrections of German translationMatthias Gorissen2008-01-18
| | | | | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
| * Spanish translation update for pacman 3.1.1Juan Pablo Gonzalez2008-01-16
| | | | | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
| * Czech translation update for pacman 3.1.1Vojtěch Gondžala2008-01-16
| | | | | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
| * English (British) translation update for pacman 3.1.1Jeff Bailes2008-01-16
| | | | | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
| * Hungarian translation update for pacman 3.1.1Nagy Gabor2008-01-16
| | | | | | | | Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
| * Update message files for 3.1.1 releaseDan McGee2008-01-14
| | | | | | | | | | | | | | | | | | | | | | We are in string freeze for the 3.1.1 release. This commit updates all the message files to the latest code, and all translation updates should be based off of these po-files. Please attempt to keep the line number changes to a minimum- there should be no reason to update these po files with just new line numbers. That way we can more easily see exactly which translations were updated. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-01-14
|\|
| * Change the versioned provision format.Chantry Xavier2008-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the 'provname provver' format to 'provname=provver'. In .PKGINFO, the provisions are copied from the PKGBUILD without quotes. So the provision version was actually handled as a different provision... See FS#9171. Dan: Unfortunately we have to change our original specification for versioned provisions with this patch, but it ends up being the simpler and cleaner solution in the long run, and if there is any time to change it the time is now before many packages have been built. Keeping the ' ' based format would have required us to do special parsing in repo-add, as well as being susceptible to users not using quotes in their provides array. Hopefully this will resolve the issues we had with our initial plan. Sorry for the confusion. Acked-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * FS#9183 : force correct permissions on tmp/.Jaroslaw Swierczynski2008-01-13
| | | | | | | | | | | | | | [Xav: removed unneeded makepath_internal function, and fixed the permission value : 1777 -> 01777] Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure correct dir permissions in the database.Chantry Xavier2008-01-13
| | | | | | | | | | | | | | | | | | | | | | | | Fix for FS#9176. A previous commit (6e8daa553bbd5) already forced all database files to 644. Now the directories are also forced to 755. Additionally, repo-add now sets the umask to 022, just like makepkg does, to fix the problem at its root. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-01-13
|\|
| * util.c : fix segfault when the cachedir isn't usable.Chantry Xavier2008-01-13
| | | | | | | | | | | | | | | | | | | | | | | | For example, if the cachedir is a broken symlink or a non writable directory, pacman fallbacks to /tmp/. Just before doing that, it freed the handle->cachedirs list twice ! once in _alpm_filecache_setup, and once in alpm_option_set_cachedirs. So the first one was removed. Fixes FS#9186. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
| * small checkdeps speed-upNagy Gabor2008-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | In the old code 'alpm_list_diff(_alpm_db_get_pkgcache(db), dblist, _alpm_pkg_cmp);' was slow. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Xav: In my opinion, computing both dblist and modified in one for loop also makes the code clearer, besides being more efficient. Also renamed joined to targets since I also find that clearer.] Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
| * don't send CHECKDEPS_DONE event when NODEPS is set.Chantry Xavier2008-01-12
| | | | | | | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | memleak fix with new dynamic depend structureDan McGee2008-01-12
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm/sync.c: don't duplicate packages for the sync->data field.Chantry Xavier2008-01-12
| | | | | | | | | | | | | | | | | | Packages put in the sync->data field were always duplicated with pkg_dup, and then freed, This is not needed. Killing this duplication of packages made the memory usage during base reinstall go from 10.4 MB to 8.1 MB. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | Store replaces in the local DB tooAaron Griffin2008-01-12
| | | | | | | | | | | | Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: might as well store 'force' too] Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-01-11
|\|
| * Only notify of dependency check in removal if performedAllan McRae2008-01-11
| | | | | | | | | | | | | | | | | | Moves "checking dependencies..." notification into code block where dependency checking is performed to stop spurious notification. Reference: http://archlinux.org/pipermail/pacman-dev/2008-January/010714.html Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Fix library interfaceDan McGee2008-01-11
| | | | | | | | | | | | | | | | | | | | | | | | Two functions defined in alpm.h were not marked with SYMEXPORT, causing linking errors if they were used. In addition, remove the incorrect use of the 'alpm_' prefix from an internal function and replace it with '_alpm_'. Fixes FS#9155. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add functions to manipulate pmdepend_t objectsDan McGee2008-01-11
| | | | | | | | | | | | | | | | | | | | | | We didn't have a free function before, causing some memory leaks. We also need a dup function now that strings are not in the structure but are dynamically allocated. Also adapt pmdepmissing_t to use a pointer to a depend struct instead of an inclusive one so we can use the functions we created here. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Use dynamic string allocation in package structuresDan McGee2008-01-11
|/ | | | | | | | | | | | | | This also affects all structures with static strings, such as depmiss, conflict, etc. This should help a lot with memory usage, and hopefully make things a bit more "idiot proof". Currently our pactest pass/fail rate is identical before and after this patch. This is not to say it is a perfect patch- I have yet to pull valgrind out. However, this should be quite safe to use in all situations from here on out, and we can start plugging the memleaks. Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Move the fallback on providers from backend to frontend.Chantry Xavier2008-01-09
| | | | | | | | | | | This reverts commit e28973169d2e5eda8b64ebdda11ece0dc761d978. 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.
* Remove upgradedelay and all code associated with itDan McGee2008-01-08
| | | | | | | | It wasn't even implemented correctly, and it really doesn't have a use if packagers just do their job correctly anyway for a distro. Let's not try to solve a problem with the wrong solution now. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unused date element from pmpkg_t structDan McGee2008-01-08
| | | | | | | We had an unused date element in the pmpkg_t struct (not builddate or installdate). Kill it off and fix the one function that was using it. Signed-off-by: Dan McGee <dan@archlinux.org>
* conflict.c : fix for FS#8156, detect conflict between symlink and dir.Chantry Xavier2008-01-06
| | | | | | | | | | | | | | | The previous fileconflict check (package vs filesystem) skipped the conflict when the file on the filesystem was a directory or a symlink to a directory, no matter what the file in the package was. Now, the conflict will only be skipped if the file in the package is a directory (so compatible with a dir or a dir symlink on the filesystem). So in the case of 8156 (new fileconflict003 pactest for this case), instead of silently ignoring the extraction of the test symlink, pacman will now fail because of a file conflict between the test symlink in the pkg2 package and the test directory on the filesystem. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Don't stat cachedir immediatelyDan McGee2008-01-05
| | | | | | | | | | | | By attempting to stat the cachedir when we load the pacman config, pacman bails out if it is a non-existant directory, even if it will never be needed. This is unfortunate as it is only used for sync transactions anyway. Instead, wait until we need it in _alpm_filecache_setup to actually do anything. Reported as FS#9096. Signed-off-by: Dan McGee <dan@archlinux.org>
* sync.c: add sanity check so we don't dereference a null pointerDan McGee2008-01-05
| | | | | | | | | | Originally noticed in FS#9024, but was fixed in previous changes anyway. However, it doesn't hurt to still check it. Also add a pactest from Chantry Xavier for the original problem to ensure we can't reproduce it. Signed-off-by: Dan McGee <dan@archlinux.org>
* conflict.c : fix for upgrade042.Chantry Xavier2008-01-05
| | | | | | | | | | | Thanks to the proactive backup handling, we don't need to add the moving file to the skip_add list. The backup handling will make sure nothing gets overwritten. Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010610.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* add.c : fix upgrade026 pactest.Chantry Xavier2008-01-05
| | | | | | | | | | | | | | | This was the case of the bash packaging error where a file was removed from the package but not the backup array. I just added a sanity check so that only the files from the backup array that are also in the filelist are used. I had to edit upgrade026 pactest slightly : it required the file to be copied to .pacsave instead of moved. But just moving it should be enough, as we agreed on the ML : http://www.archlinux.org/pipermail/pacman-dev/2007-December/010440.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Update of German translationMatthias Gorissen2008-01-05
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Small code cleanups with indents/spacesDan McGee2008-01-01
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>