summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2008-05-12Refactor pkg_load/parse_descfile into a new backend fileDan McGee4-244/+285
alpm_pkg_load() and parse_descfile() are specific to getting information from package files, just as other code is specific to getting information into or out of a package database. Move this code out of package.c, which should eventually only contain operators on the pmpkg_t struct that do not depend at all on where the data came from. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-12Remove some useless abstraction and start db cleanupDan McGee4-181/+149
We have some useless abstractions like an alpm_db_rewind function. I've read somewhere that readdir() was the worst filesystem function call invented, and what do we do? Add a wrapper around it. Kill this abstraction and move some other things into be_files that should be there anyway because they are so tied to how a files backend works. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-12Make all error messages use pm_fprintfAllan McRae8-42/+54
Tested using many easily generated error conditions. Also added "malloc failure" (conf.c) and "segmentation fault" (pacman.c) error messages for translation. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> [Dan: fix trailing whitespace errors, other compilation issues] Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-12pactest: fix --gdb optionDan McGee1-1/+1
A libtool upgrade broke the gdb option as we need a MODE specified; add the execute mode to the call. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10contrib/paclist: list packages installed from given repo.Chantry Xavier3-0/+93
The paclist script provides a simple method for monitoring which packages are installed from a given repo. This is particularly useful when using a testing or unstable repository. Thanks to Allan McRae for the idea and an initial bash script. As suggested by Dan, I tried to rewrite in perl, and this resulted in much better performance. Then Dan further cleaned up the script. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> [Dan: add to Makefile & README, minor script cleanups] Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10pacsearch: rewrite in perlDan McGee1-60/+103
This rewrite in perl blows the socks off the old shell script version for large searches: $ time ./pacsearch.perl ^.*$ >/dev/null real    0m0.836s user    0m0.593s sys     0m0.217s $ time pacsearch.sh ^.*$ >/dev/null real    1m53.818s user    1m16.818s sys     0m33.694s Functionality and output is identical to the old version with the exception of the old version's missing EOL after all the output. It should be a lot easier to add new things like the --color flag that has been a TODO at the top of the script for a long time. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10Update makepath to remove PATH_MAX usageDan McGee2-32/+41
The start of a few commits to remove some PATH_MAX usage from our code. Use a dynamically allocated string instead. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10scripts: add -q/--quiet option to repo-add and repo-removeDan McGee3-10/+33
They are pretty noisy scripts in their normal course of operations, so allow all messages to be squashed except for warning and error messages with this new flag. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10makepkg: Unify start and end messagesDan McGee1-2/+2
I've always found it odd why the package version is shown at the start but not the end of the package build. Fix it, and while we are at it, add the $CARCH variable to the display too. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-09Use strdup() instead of a static bufferDan McGee1-14/+24
We only need a copy of this string once we know we are going to extract it, and we don't need a static buffer to copy it into since it is coming from a known-length string. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-09Update md5 routinesDan McGee2-64/+51
XySSL 0.9 was released; sync our code with the upstream source. Note that there weren't any real changes besides renaming of macros, so nothing much to see here. The biggest change may be the licence- it is now GPL/BSD software rather than LGPL/BSD. The license header is changed to reflect this. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-09be_files.c: PATH_MAX cleanupDan McGee1-6/+13
Most of these are not easy to remove, but I could kill the ones in the two lastupdate functions. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-09pacman-side code cleanupsDan McGee3-11/+9
When taking a look at PATH_MAX usage, I found a few small things we can clean up or fix. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-30Merge branch 'maint'Dan McGee1-4/+6
2008-04-29Doxyfile : enable JAVADOC_AUTOBRIEF.Chantry Xavier1-1/+1
From http://www.stack.nl/~dimitri/doxygen/config.html#cfg_javadoc_autobrief JAVADOC_AUTOBRIEF If the JAVADOC_AUTOBRIEF is set to YES then doxygen will interpret the first line (until the first dot) of a JavaDoc-style comment as the brief description. If set to NO (the default), the Javadoc-style will behave just like regular Qt-style comments (thus requiring an explicit @brief command for a brief description.) Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-29Add documentation for transaction eventsSebastian Nowicki1-1/+58
It is hard to decipher what the transaction events actually notify you of, and what parameters are passed to the callback function, without looking at the code. This patch adds documentation for the _pmtransevt_t enum in order to clarify what the event is for and what data is passed when the callback is called. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-29Updates to _alpm_copyfile()Dan McGee1-8/+14
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>
2008-04-29Rework extract_single_file() temp file creationDan McGee2-29/+55
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>
2008-04-29Update pactest to allow setting modes on created filesDan McGee3-20/+34
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>
2008-04-28Remove unnecessary archive_entry_set_pathname() callsDan McGee1-4/+0
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>
2008-04-27makepkg: fix strip section to allow spaces in pathsDaenyth Blank1-4/+6
Inside tidy_install, change the section which strips libraries to use find | while read rather than for foo in `find`. This should allow whitespaces in filenames to still be processed correctly. This fixes FS#10294. Signed-off-by: Daenyth Blank <Daenyth+git@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-26Fix some fallout from the delta/download changesDan McGee2-5/+15
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>
2008-04-26get_filename : use the FILENAME db field only.Chantry Xavier2-13/+4
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>
2008-04-26libalpm/sync.c : memleak fixes.Chantry Xavier1-9/+8
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-04-26Get rid of the delta patches listChantry Xavier1-76/+67
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>
2008-04-26Completely rework delta algorithmChantry Xavier9-209/+218
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>
2008-04-26Rework delta struct and modify code accordinglyDan McGee4-68/+67
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>
2008-04-26Refactor the trans init and release code.Chantry Xavier5-85/+52
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>
2008-04-26Kill compute_requiredby usage in can_remove_package()Nagy Gabor1-8/+10
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>
2008-04-19Merge branch 'maint'Dan McGee3-14/+22
Conflicts: pactest/pmtest.py
2008-04-19Give libalpm native support for both libdownload and libfetchDan McGee3-7/+41
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>
2008-04-19Remove unnecessary NULL check in FREE() macroDan McGee1-1/+1
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>
2008-04-17pactest : Use tarfile module.Chantry Xavier2-12/+20
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>
2008-04-17pactest: Add quotes for directory with whitespacesChantry Xavier1-2/+2
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-16Merge branch 'maint'Dan McGee5-7/+19
2008-04-16Slight changes to fix warnings from autoconf 2.62Dan McGee1-2/+2
Two variables needed the _cv_ or warnings were spit out saying they were not cache vars. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-15More non-Linux build updates, mostly DarwinDan McGee3-3/+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>
2008-04-15Fix gettext on non-Linux platformsDan McGee2-2/+2
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>
2008-04-15Fix compilation errors on x86_64Dan McGee1-2/+2
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>
2008-04-15remove.c: refactor into functionsK. Piche1-40/+59
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>
2008-04-15Some comments for _alpm_unpack.K. Piche1-0/+11
Signed-off-by: K. Piche <kevin@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-15add.c: added some tracing and improved some variable localityK. Piche1-3/+10
Signed-off-by: K. Piche <kevin@archlinux.org> [Dan: removed one logger] Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-11Memory allocation and other small cleanupsDan McGee1-11/+9
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-11Merge branch 'maint'Dan McGee1-6/+4
2008-04-11Remove unnecessary import in dload.hDan McGee1-1/+0
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>
2008-04-09Correctly use the fd returned my mkstemp()Dan McGee1-6/+4
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>
2008-04-08Update configure.ac to current codeDan McGee2-15/+14
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>
2008-04-08Merge branch 'maint'Dan McGee5-3/+17
2008-04-08Add check for swprintf() and a workaround when it is missingDan McGee2-2/+12
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>
2008-04-08Add *.exe ignores for certain other platformsDan McGee2-0/+4
Signed-off-by: Dan McGee <dan@archlinux.org>