summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Refactor the trans init and release code.Chantry Xavier2008-04-26
| | | | | | | | | | | | | The calls to alpm_trans_init and alpm_trans_release (+ error checking) were duplicated between remove.c, sync.c and upgrade.c This patch introduces trans_init and trans_release functions in util.c to have this code just once. So instead of having to do the same change 3 times for fixing FS#10273, I just had to do it once (so I did it too :)) Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Kill compute_requiredby usage in can_remove_package()Nagy Gabor2008-04-25
| | | | | | | | | | | | | In the can_remove_package function, we don't need to compute the whole requiredby list, we just need to find one member of it that doesn't belong to the targets list. That way we get a small speedup and remove the only usage of alpm_pkg_compute_requiredby in the backend, so that it can be tweaked for frontend usage. 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>
* Merge branch 'maint'Dan McGee2008-04-19
|\ | | | | | | | | | | Conflicts: pactest/pmtest.py
| * pactest : Use tarfile module.Chantry Xavier2008-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, tar was called manually with os.system. This caused one fork per package/db creation, which is costly, especially on cygwin. Besides, it also caused some problems with directory with whitespaces (that could also be fixed with quotes, but well..) Using tarfile module is cleaner and more efficient, and still easy enough. Benchmark (time make check) : - windows / cygwin prepatch: real 6m36.360s user 2m28.914s sys 2m35.866s postpatch: real 5m25.428s user 1m26.029s sys 2m0.006s - linux prepatch: real 1m22.629s user 0m31.498s sys 0m18.899s postpatch: real 1m11.465s user 0m26.382s sys 0m12.986s Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
| * pactest: Add quotes for directory with whitespacesChantry Xavier2008-04-17
| | | | | | | | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Give libalpm native support for both libdownload and libfetchDan McGee2008-04-19
| | | | | | | | | | | | | | | | | | This should remove the need for any additional patching to run on platforms that have libfetch available but not libdownload. It isn't the prettiest, but we have kept our libdownload impact down to just a few files, so it can be easily done. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove unnecessary NULL check in FREE() macroDan McGee2008-04-19
| | | | | | | | | | | | | | free() is designed to do nothing if it is passed a NULL pointer, so there is no need to check for it on our end. Change/fix the macro. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-04-15
|\|
| * Slight changes to fix warnings from autoconf 2.62Dan McGee2008-04-15
| | | | | | | | | | | | | | Two variables needed the _cv_ or warnings were spit out saying they were not cache vars. Signed-off-by: Dan McGee <dan@archlinux.org>
| * More non-Linux build updates, mostly DarwinDan McGee2008-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Darwin's binary format does support symbols with differing visibilities, but it does not support the protected or internal visibilities- only hidden. For Darwin only, we should fall back to this visibility to prevent warnings from the compiler and because it is close enough for our library purposes. See http://gcc.gnu.org/viewcvs/*checkout*/trunk/gcc/config/darwin.c, search for the "darwin_assemble_visibility" function for more details. Also add pacman.static.exe to gitignore. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Fix gettext on non-Linux platformsDan McGee2008-04-14
| | | | | | | | | | | | | | | | | | Linux includes all the gettext stuff in glibc, so there is no need for the libintl links which we failed to include in our linker variables. Update the makefiles which should enable NLS support on all platforms, including OS X and Cygwin. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix compilation errors on x86_64Dan McGee2008-04-14
| | | | | | | | | | | | | | | | Things must have gotten stricter with GCC 4.3 on the '%zd' printf string and this is the first I've tried to compile there. Fix the problem by using size_t instead of int. Signed-off-by: Dan McGee <dan@archlinux.org>
* | remove.c: refactor into functionsK. Piche2008-04-14
| | | | | | | | | | | | | | | | Pulled two loops out of _alpm_remove_prepare and gave them their own functions. Signed-off-by: K. Piche <kevin@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Some comments for _alpm_unpack.K. Piche2008-04-14
| | | | | | | | | | Signed-off-by: K. Piche <kevin@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | add.c: added some tracing and improved some variable localityK. Piche2008-04-14
| | | | | | | | | | | | Signed-off-by: K. Piche <kevin@archlinux.org> [Dan: removed one logger] Signed-off-by: Dan McGee <dan@archlinux.org>
* | Memory allocation and other small cleanupsDan McGee2008-04-10
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-04-10
|\|
| * Correctly use the fd returned my mkstemp()Dan McGee2008-04-08
| | | | | | | | | | | | | | | | | | | | | | | | | | There were a few issues with this code: 1. We already had an open fd to a file, but never used it to our benefit. Use the libarchive convienence method to write the current file contents straight to a file descriptor. 2. The real problem cropped up on Windows where the locking semantics caused the old way of extraction to fail because we had an open file descriptor. By using the file descriptor and closing it ASAP, we prevent these failures. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove unnecessary import in dload.hDan McGee2008-04-10
| | | | | | | | | | | | | | We no longer expose any of libdownload in our public functions, so no need to include this header anymore. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Update configure.ac to current codeDan McGee2008-04-07
| | | | | | | | | | | | | | | | Remove a few functions and things that were unnecessary, update the help line calls to the current function name, and make the small change to pacman.c for the signal handler return type that is defined in config.h. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-04-07
|\|
| * Add check for swprintf() and a workaround when it is missingDan McGee2008-04-07
| | | | | | | | | | | | | | | | | | We use this function once in our codebase, but fortunately the workaround is relatively easy. swprintf() is not available on Cygwin so the compile failed there, but we can do a series of mbstowcs() calls that produce the same end result as the swprintf() call. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Add *.exe ignores for certain other platformsDan McGee2008-04-07
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Quote filenames in find expression in pacdiffAllan McRae2008-04-06
| | | | | | | | | | | | | | | | | | | | | | | | From 41cc28f560bf9843d81ce5fb62b884b6325d06a0 Mon Sep 17 00:00:00 2001 From: Allan McRae <mcrae_allan@hotmail.com> Date: Sun, 6 Apr 2008 22:18:06 +1000 Subject: [PATCH] Quote filenames in find expression in pacdiff Small patch to allow pacdiff to run in /etc. See FS#10090. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Allow disabling of internal (libdownload) codeDan McGee2008-04-06
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new --disable-internal-download flag to configure allowing the internal download code to be skipped. This will be helpful on platforms that currently don't support either libdownload or libfetch (such as Cygwin) and for just compiling a lighter weight pacman binary. This was made really easy by our recent refactoring of the download code into separate internal and external functions, as well as some error code cleanup. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove a bit more download.h pollutionDan McGee2008-04-06
| | | | | | | | | | | | Kill it where it isn't absolutely necessary. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove unnecessary header file, move one macro to util.cDan McGee2008-04-06
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm error cleanup, step 1Dan McGee2008-04-06
| | | | | | | | | | | | Remove unused error codes, begin refactoring some of the others. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove libdownload reference from pacman frontendDan McGee2008-04-06
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add quiet printout to --owns functionalityDan McGee2008-04-06
| | | | | | | | | | | | | | If we specify -q/--quiet on an --owns operation, only print a matching package name rather than the verbose human-readable message. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-04-01
|\| | | | | | | | | | | | | Conflicts: configure.ac contrib/Makefile.am
| * Update NEWS and configure.ac for 3.1.4 releaseDan McGee2008-04-01
| | | | | | | | | | | | | | | | | | Also fix a broken contrib/ Makefile, found with make distcheck. I also let the little translation linebreak update slip in here as it was small enough not to be a big deal, and this should just prevent it from happening again later anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Set handle->logstream to null after fclose()Dan McGee2008-04-01
| | | | | | | | | | | | | | | | 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>
* | Update -Ss and -Qs pactests to include groupsDan McGee2008-03-30
| | | | | | | | | | | | | | | | This update causes query003 to fail before commit 4b8ada818e21aae43b4f54f146ffa215fdb9213e. Hopefully the issue doesn't crop up again but we might as well test for it. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Enable display of multiple groups in -Ss and -Qs outputDan McGee2008-03-30
| | | | | | | | | | | | | | Not too complicated of a fix, but just adds some code to loop over the entire group list and space it out. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix segfault on -Qs usageDan McGee2008-03-30
| | | | | | | | | | | | | | | | | | | | | | This segfault creeped in as a result of commit bf867003. We were incorrectly assuming the group member of our package was a pmgrp_t list when in fact it is just a string list, which caused a segfault on any -Qs operation. Also slightly cleanup the -Ss code (which was originally correct unlike the -Qs code). Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-03-30
|\|
| * Fix manpage typoDan McGee2008-03-30
| | | | | | | | | | | | Noticed in FS#10025. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Duplicate the result of archive_entry_pathname.Chantry Xavier2008-03-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Use pkgcache instead of db_scan in remove.cNagy Gabor2008-03-28
| | | | | | | | | | | | | | 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>
* | doc/pacman.8: fix manpage typoDan McGee2008-03-30
| | | | | | | | | | | | Fix a misspelling and make a clarification while we are at it. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Read .PKGINFO directly from package fileDan McGee2008-03-27
| | | | | | | | | | | | | | | | | | With the addition of the archive_fgets() function, we can now skip the temp file usage in pkg_load/parse_descfile that was not needed. This has a nice benefit of probably being both faster, reducing code, and getting rid of "expensive" file operations. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add an archive_fgets() functionDan McGee2008-03-27
| | | | | | | | | | | | | | | | This crude function allows reading from an archive on a line-by-line basis similar to the familiar fgets() call on a FILE stream. This is the first step in being able to read DB entries straight from an archive. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make db->treename a pointerDan McGee2008-03-26
| | | | | | | | | | | | I really don't think we need statically allocated strings here. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-03-23
|\|
| * memleak fix: ensure backup fname isn't lost if unusedDan McGee2008-03-23
| | | | | | | | | | | | | | 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>
| * strsplit(): memleak fixDan McGee2008-03-23
| | | | | | | | | | | | We dup-ed the string but then duped it again. Fix it. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Avoid duplicated target names.Nagy Gabor2008-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch should avoid duplicated target names in the backend. 1. sync_loadtarget will return with PM_ERR_TRANS_DUP_TARGET when trying to add a duplicated target 2. sysupgrade never pulls duplicated targets 3. resolvedeps won't pull duplicated targets anymore A pulled list was introduced in sync_prepare to improve the pmsyncpkg_t<->pmpkg_t list conversion by making it more direct. Also replace sync1005 and sync1006 by the sync1008 pactest, which is similar but more interesting (the provisions are dependencies instead of explicit targets). sync1005 didn't work as expected anyway. It was expecting that pacman failed, and pacman indeed failed, but not for the good reason. It didn't fail during the preparation step because of conflicting targets, but during the commit step, because of a md5 error... And sync1006 didn't pass and was not really worth fixing. We have already enough failing pactests more important than these two. sync1008 pass with this patch. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* | memleak fix: ensure we free result of get_destfile()Dan McGee2008-03-23
| | | | | | | | | | | | | | In the file:// download case, we didn't free the return from get_destfile() after we were done with it. Fix it. (Found with xfercommand001.py) Signed-off-by: Dan McGee <dan@archlinux.org>
* | Switch pmgrp_t to dynamic allocation, general group cleanupDan McGee2008-03-23
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>