summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2008-04-02Set handle->logstream to null after fclose()Dan McGee1-0/+1
We correctly closed the logfile stream when recalling set_logfile, but did not NULL out the dead pointer once we did this. Fix the problem which was the cause of FS#10056. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-29Duplicate the result of archive_entry_pathname.Chantry Xavier1-2/+2
After the libarchive upgrade from 2.4.12 to 2.4.14, our usage of archive_entry_pathname became dangerous. We were using the result of that function even after calls to archive_entry_set_pathname. With 2.4.14, the entryname becomes wrong after these calls, and so all the future use of entryname are bogus. entryname is used quite a lot for logging, so that's not so bad. But it's also used for the backup handling, so that's not very cool. For example, reinstalling a package with backup entries will erase all the md5 entries from the DB, because they won't be found back. entryname is now a static string so that we can easily keep the result of archive_entry_pathname. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> [Dan: fixed version numbers in commit message] Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-28Use pkgcache instead of db_scan in remove.cNagy Gabor1-4/+4
This should be a notable speed-up (apart from kernel cache). Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-23memleak fix: ensure backup fname isn't lost if unusedDan McGee2-0/+4
The _alpm_backup_split function always alloced memory for the fname, and we let it disappear in a specific case (upgrade026.py). Fix the issue. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-09Remove a bogus comment from libalpm/remove.cNagy Gabor1-1/+0
We do the opposite. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2008-03-07New alpm_version functionNagy Gabor2-0/+6
Now pacman frontend uses this function instead of the compile-time libalpm version number. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: fix one more spot where LIB_VERSION was used] Signed-off-by: Dan McGee <dan@archlinux.org> (cherry picked from commit 49197b7492d61bf1fc6bef59a708f4f586f32edb)
2008-03-05Update Czech translationVojtěch Gondžala1-2/+2
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-04Remove a bogus commentNagy Gabor1-1/+0
This comment was created for the old provision version format and needless. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-04Kill all of the line numbers from the translationsDan McGee12-1774/+916
Hopefully the last of the huge commits ever. This also adds the c-format tag to all of the translated messages. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-04Disable the line number in .po files.Chantry Xavier1-1/+1
Add the --no-location xgettext option to disable the line numbers. They are not very useful, and generate a huge number of pointless line changes on every update. Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011332.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-03-04Convert Hungarian translation translation to UTF-8Dan McGee1-140/+140
The issue was discussed in this thread on the mailing list: http://archlinux.org/pipermail/pacman-dev/2008-March/011324.html In addition, the GNU gettext manual states that translation encoding is completely separate from the encoding used by the users of the translation. It makes sense for our project to use UTF-8 for all translations, regardless of the preferred encoding used by users of a certain language. This allows all contributors to more easily edit a translation file if necessary and not have to worry about codepage issues. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-03-01Set a missing pm_errno in _alpm_pkg_load()Nagy Gabor1-1/+1
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-26Update simplified chinese (zh_CN) translation.甘露(Lu.Gan)1-9/+9
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-26fix two broken translated strings.Chantry Xavier1-2/+2
Using c-format on every strings allowed me two found two broken ones. One was harmless, but the other caused a segfault, as reported in FS#9658. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-26xgettext : change pass-c-format flag to c-format.Chantry Xavier1-2/+2
Currently xgettext apparently attempts to autodetect c format strings (eg a string with a %s) to decide whether to use c-format flag or not. If we use --flag=_:1:c-format instead of --flag=_:1:pass-c-format, the c-format will be applied everywhere. I couldn't find this documented anywhere though. But the pass prefix is mentioned here : http://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#xgettext-Invocation "Specifies additional flags for strings occurring as part of the argth argument of the function word. The possible flags are the possible format string indicators, such as ‘c-format’, and their negations, such as ‘no-c-format’, possibly prefixed with ‘pass-’." And c-format is documented there : http://www.gnu.org/software/gettext/manual/html_node/c_002dformat-Flag.html#c_002dformat-Flag "This situation happens quite often. The printf function is often called with strings which do not contain a format specifier. Of course one would normally use fputs but it does happen. In this case xgettext does not recognize this as a format string but what happens if the translation introduces a valid format specifier? The printf function will try to access one of the parameters but none exists because the original code does not pass any parameters." And that's exactly what happened with FS#9658. So using c-format for every string will prevent this issue from happening again. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-25libalpm/sync.c : fix poorly worded debug message.Chantry Xavier1-1/+1
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-24Update Russian translationSergey Tereschenko1-3/+3
Some corrections from the previous translation. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-22Add new Simplified Chinese translation甘露(Lu.Gan)2-0/+656
Thanks a lot! Now we get to fix the breakage this causes in output messages. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-19Final updates to Polish translationMateusz Herych1-172/+161
Good job on the group effort guys, thanks for getting this one complete. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-18Update libalpm russian translation.Sergey Tereschenko1-178/+168
Cleaned up by Oleg Finkelshteyn. Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-18Do not warn about up to date package when downloading onlyAllan McRae1-2/+4
Stops the "<pkg> is up to date -- reinstalling" message when using the download only flag. Ref: http://archlinux.org/pipermail/pacman-dev/2008-January/010952.html Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
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-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-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-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-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-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-12Only notify of dependency check in removal if performedAllan McRae1-2/+2
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>
2008-01-11Fix library interfaceDan McGee4-6/+6
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>
2008-01-10Move the fallback on providers from backend to frontend.Chantry Xavier1-26/+2
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.
2008-01-08Remove upgradedelay and all code associated with itDan McGee5-42/+0
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>
2008-01-08Remove unused date element from pmpkg_t structDan McGee2-3/+3
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>
2008-01-06conflict.c : fix for FS#8156, detect conflict between symlink and dir.Chantry Xavier1-5/+12
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>
2008-01-06Don't stat cachedir immediatelyDan McGee2-8/+3
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>
2008-01-06sync.c: add sanity check so we don't dereference a null pointerDan McGee1-6/+8
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>