summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2008-02-16Move pmgraph_t struct and functions to their own header fileDan McGee6-38/+61
This will allow us to utilize this helpful type and functions in places besides dependency calculations. In addition, remove the public declaration of pmgraph_t in alpm.h- there is zero need to expose this internal type. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-16Merge branch 'maint'Dan McGee8-57/+56
Conflicts: lib/libalpm/be_files.c lib/libalpm/package.c
2008-02-15More small updates to German translationMatthias Gorissen1-3/+5
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-15Merge branch 'translations' into maintDan McGee2-44/+34
2008-02-14Ensure DESC infolevel is loaded before checking pkg->filenameDan McGee2-7/+4
This is the first step of fixing FS#9547. This should not break any existing code that may rely on this function behaving the way it did, and should be good for inclusion in a maint release. In addition, update pactest so it fills the FILENAME field in the DB entries it creates so we can move forward with a real fix to this issue. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-12Updated Czech translation for 3.1.2 releaseVojtěch Gondžala1-35/+34
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-02-12Update french translation.Chantry Xavier1-9/+0
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-02-12Move some translations to their generic language codeDan McGee4-3/+3
For our Czech, Polish, and Russian translations, they do not need to be at the more specific 'lang_COUNTRY' code, but can live at just plain 'lang'. This follows the pattern of most other translated programs out there as Roman pointed out on IRC. ru_RU: 2 (pacman and libalpm) ru: 128 for him, 131 for me (everything else) Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-12ensure chk_fileconflicts reads entire file listDan McGee1-4/+10
If the end of the pB list was reached before the end of pA, we failed to read any remaining files from the pA list. Add an additional loop to ensure all entries of pA are added to the return list regardless of whether we have reached the end of pB. This new loop also eliminates the now-unnecessary check for a null pB, as we need to ensure we are excluding directories in the resulting output anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-08Merge branch 'maint'Dan McGee1-6/+4
2008-02-08Remove alpm_sync_get_newversion functionNagy Gabor2-9/+0
sync->newversion shouldn't be public at all, and internally we access it directly. (Before pmsyncpkg_t clean-up the analogue of this field [type] was needed in replaces computation.) Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-08alpm_sync_sysupgrade splitNagy Gabor2-44/+66
This patch indroduces a new public alpm_sync_newversion, which scans for new version of a package in sync repos. Hopefully this will reduce code duplication in the future: * check-for-pacman-new-version from front-end can be easier * -Qu refactoring Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-07libalpm/add.c : safety check for fixing FS#9235.Chantry Xavier1-6/+4
Fixes FS#9235. We already had the following case in extract_single_file : /* cases 1,2,3: couldn't stat an existing file, skip all backup checks */ But we actually only did a lstat here. And if lstat worked, we did a stat without checking. When lstat works and stat fails, it means we have a broken symlink, like in FS#9235. We can actually treat this case like a non-existing file. The broken symlink will then be simply overwritten. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-06libalpm/package.c : add _alpm_pkgname_pkg_cmp function.Nagy Gabor3-4/+9
_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>
2008-02-06New remove option : -u / --unneeded (FS#6505).Nagy Gabor4-7/+49
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>
2008-01-27pmsyncpkg_t cleanupNagy Gabor3-70/+45
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>
2008-01-27Fix PM_ERR_CONFLICTING_DEPS handling in sync.cNagy Gabor1-13/+14
* 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>
2008-01-27New _alpm_conflict_dup functionNagy Gabor2-0/+12
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>
2008-01-27small sync.c code clean-upNagy Gabor1-16/+6
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>
2008-01-24libalpm/sync.c : conflicts resolving cleanup.Chantry Xavier1-153/+110
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>
2008-01-24Fix flip-flopped parameters to CALLOC macroDan McGee1-2/+2
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>
2008-01-24libalpm/cache.c : don't duplicate packages in pkgcache.Chantry Xavier2-13/+5
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>
2008-01-24Add new public alpm_checkdbconflicts function.Chantry Xavier4-5/+11
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>
2008-01-24small memleak fix in sync.c.Chantry Xavier1-1/+2
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-22conflict.c: move debug message out of inner loopDan McGee1-2/+2
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>
2008-01-22Fix memleak found by add004.pyDan McGee1-12/+8
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-22New --asexplicit optionNagy Gabor2-10/+10
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>
2008-01-22Move the deptest code from frontend to backend.Chantry Xavier6-6/+33
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>
2008-01-22Convert deltas to dynamic allocationDan McGee4-19/+28
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>
2008-01-19Merge branch 'maint'Dan McGee11-2188/+1783
2008-01-19Portuguese Brazilian translation update for pacman 3.1.1João Felipe Santos1-192/+170
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-18Corrections of German translationMatthias Gorissen1-78/+33
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16Spanish translation update for pacman 3.1.1Juan Pablo Gonzalez1-220/+159
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16Czech translation update for pacman 3.1.1Vojtěch Gondžala1-32/+23
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16English (British) translation update for pacman 3.1.1Jeff Bailes1-18/+32
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-16Hungarian translation update for pacman 3.1.1Nagy Gabor1-10/+0
Signed-off-by: Giovanni Scafora <linuxmania@gmail.com>
2008-01-15Update message files for 3.1.1 releaseDan McGee11-1749/+1477
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>
2008-01-15Merge branch 'maint'Dan McGee5-6/+14
2008-01-15Change the versioned provision format.Chantry Xavier2-3/+3
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>
2008-01-14FS#9183 : force correct permissions on tmp/.Jaroslaw Swierczynski3-3/+9
[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>
2008-01-13Ensure correct dir permissions in the database.Chantry Xavier1-0/+2
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>
2008-01-13Merge branch 'maint'Dan McGee3-11/+15
2008-01-13util.c : fix segfault when the cachedir isn't usable.Chantry Xavier1-2/+0
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>
2008-01-13memleak fix with new dynamic depend structureDan McGee1-1/+1
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-13libalpm/sync.c: don't duplicate packages for the sync->data field.Chantry Xavier1-35/+7
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>
2008-01-12small checkdeps speed-upNagy Gabor1-8/+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>
2008-01-12don't send CHECKDEPS_DONE event when NODEPS is set.Chantry Xavier1-1/+3
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12Store replaces in the local DB tooAaron Griffin1-28/+9
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> [Dan: might as well store 'force' too] Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-12Merge branch 'maint'Dan McGee5-8/+8
2008-01-12Add functions to manipulate pmdepend_t objectsDan McGee3-28/+44
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>