summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Updates to _alpm_copyfile()Dan McGee2008-04-28
| | | | | | | Rework to use a single #define for the buffsize, and in the process clean up some other code and double the default buffer size. Signed-off-by: Dan McGee <dan@archlinux.org>
* Rework extract_single_file() temp file creationDan McGee2008-04-28
| | | | | | | | | | | | | We were a bit juryrigged using one call to mkstemp() before rather than extracting the new files side-by-side and doing our comparisons there. We were also facing some permissions issues. Instead, make our life easier by extracting all temp files to a '.paccheck' extension, doing our md5 comparisons, and then taking the correct actions. Still to be done here- a cleanup of the use of PATH_MAX which should not be necessary if we use dynamic allocation on the heap. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update pactest to allow setting modes on created filesDan McGee2008-04-28
| | | | | | | | This should allow some future tests to set modes and ensure they are set after installation. It is also in anticipation of a test for checking permissions on pacnew files. Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unnecessary archive_entry_set_pathname() callsDan McGee2008-04-27
| | | | | | | I'm not sure why these were ever here, as by this point we have already extracted the file meaning a call to this function is basically a no-op. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix some fallout from the delta/download changesDan McGee2008-04-26
| | | | | | | | We removed one too many FREELIST() calls when trying to fix some memleaks, and add a safety/sanity check to ensure filename is set, as packages in old DBs are likely to not have this field. Signed-off-by: Dan McGee <dan@archlinux.org>
* get_filename : use the FILENAME db field only.Chantry Xavier2008-04-26
| | | | | | | | | | | | | | | | | | Reference : FS#9547. The get_filename function first tries to get the filename field from the database, and if it doesn't find it, it tries to guess it based on the name, version and arch. This field was introduced in 3.0, but there are still many old entries in the official databases without it. So the databases need to be regenerated first before this patch can be applied. There is a second problem with the delta code, which needs the filename for locally installed packages too, but this field is not present in the local db. So the delta code needs to be fixed first. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* libalpm/sync.c : memleak fixes.Chantry Xavier2008-04-26
| | | | Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Get rid of the delta patches listChantry Xavier2008-04-26
| | | | | | | | | | | | | | As Nathan noticed, the new informations in the delta struct allows us to get rid of this list : http://www.archlinux.org/pipermail/pacman-dev/2008-February/011163.html So I rewrote apply_deltas for that. The previous apply_deltas also had a limitation: it assumed that the initial package and the deltas were in the first cache dir, which is not necessarily the case. That situation is supported now. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Completely rework delta algorithmChantry Xavier2008-04-26
| | | | | | | | | | | | | | | | | | | | Using the graph structures that Nagy set up for dependency sorting, we now do a similar process for deltas. Load up all of the deltas into a graph object on which we can then apply Dijkstra's algorithm, using the new weight field of graph struct. We initialize the nodes weight using the base files that we can use in our filecache (both filename and md5sum must match). The algorithm then picks the best path among those that can be resolved. Note that this algorithm has a few advantages over the old one: 1. It is completely file agnostic. These delta chains do not have to consist of package files- this could be adopted to do delta-fied DBs. 2. It does not use the local_db anymore, or even care if a package or file is currently installed. Instead, it only looks in the filecache for files and packages that match delta chain entries. Original-work-by: Dan McGee <dan@archlinux.org> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
* Rework delta struct and modify code accordinglyDan McGee2008-04-26
| | | | | | | | | | Start to move the delta struct away from an assumed package name scheme and towards something that is package (or even filename) agnostic. This will allow us much greater flexibility in the usage of deltas (maybe even sync DBs some day) as well as allowing code outside of delta.h/delta.c to be much cleaner with less of a need for snprintf() calls. Signed-off-by: Dan McGee <dan@archlinux.org>
* 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>