summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-05-29Tidy up of the handle struct in libalpmAllan McRae
Removed unused handle->uid from pmhandle_t. The need to check permissions should be determined by the frontend (and is in pacman). Fixed comment on noextract in pmhandle_t. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Remove PM_TRANS_EVT_EXTRACT_START.Xavier Chantry
This event was unused, was missing the equivalent EXTRACT_DONE event, and was useless because we already have ADD / UPGRADE START and DONE events. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29be_files : stores REPLACES and FORCE in desc.Xavier Chantry
repo-add and db_read both assume that REPLACES and FORCE fields are in the desc file, so do that for db_write as well (instead of depends file). Note that db_write is currently only used on the local database. And the only purpose of replaces and force in local database is for information purpose (available on -Qi operations). So this is not a big problem. Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-May/011859.html Acked-by: Dan McGee <dan@archlinux.org> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Pactests for sync operations with NoUpgrade and NoExtractAllan McRae
This adds the sync equivalents of upgrade010.py and upgrade070.py. Both additional test pass. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Acked-by: Dan McGee <dan@archlinux.org> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29makepkg - add check for valid options in PKGBUILDAllan McRae
This patch removes the code block in makepkg that checked for depreciated options in a PKGBUILD and provided a workaround. Unknown and depreciated options are upgraded to error conditions. Also, removed TODO regarding including install script if exists and $install is unset. That should never happen. Signed-off-by: Allan McRae <mcrae_allan@hotmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Add some verbosity to _alpm_db_read.Nagy Gabor
Name and version are computed from "/var/lib/pacman/..." pathname. And the %NAME% and %VERSION% fields from the desc file were not even read. So now, when we read the desc file, we make sure the %NAME% and %VERSION% fields are consistent. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Fix for remove052.py by moving recursedeps before checkdeps.Nagy Gabor
In the case of -Rs operation, first pulling the dependencies with recursedeps before calling checkdeps takes care of the dependency chain of remove052 pactest. In the case of -Rcs, we can keep the old behavior because we have no problem there (any dependency returned by checkdeps will be added to the remove list because of -Rc) and we have to run recursedeps on the final remove list anyway to catch all orphans. Ref.: http://www.archlinux.org/pipermail/pacman-dev/2008-April/011569.html Signed-off-by: Nagy Gabor <ngaba at bibl.u-szeged.hu> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Pactest for removing multiple items in a dependency chain.Allan McRae
This adds a test for when removing multilpe packages recursively from a chain of dependent packages. This situation can occur when removing installed dependencies with makepkg if a "makedepend" recursively depends on a "depend" or if redundant dependancies are included. Signed-off-by: Allan McRae <mcrae_allan at hotmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29No error in makepkg when removing deps failsAllan McRae
Catches error from when pacman is unable to remove dependencies after successfully building package and prints warning. Fixes FS#10039. Signed-off-by: Allan McRae <mcrae_allan at hotmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Use chown 0:0 instead of root.rootSebastian Nowicki
On BSD systems using a dot as a separator is not allowed. On Mac OSX it is deprecated. A colon should be used instead. BSD systems also use the "wheel" group instead of "root" to indicate the "super user" group. Both groups use the id of 0. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Acked-by: Aaron Griffin <aaronmgriffin@gmail.com> Acked-by: Dan McGee <dan@archlinux.org> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Use "legacy mode" on Mac OSX (for file command)Sebastian Nowicki
For some reason `file` on Mac OSX has different arguments than BSD and Linux; -i no longer prints out the mime strings. With the environment variable COMMAND_MODE set to "legacy", `file` behaves more like it does on Linux and BSD, i.e., `file -i` prints the mime type. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Acked-by: Dan McGee <dan@archlinux.org> Acked-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Allow an unprivileged user to create packages without fakerootSebastian Nowicki
When fakeroot was not in BUILDENV and the user was not root, makepkg still tried to use fakeroot for building packages. BUILDENV is now checked to see if fakeroot is enabled. If it is not enabled the package can still be built, but root will not have ownership of files. This is useful when users want to make packages for personal use and don't care about ownership. Closes FS#10450. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29du -b is not available on BSD, use du -k instead.Xavier Chantry
This fixes FS#10459. There is apparently no portable ways to get the apparent size of a file, like du -b does. So the best compromise seems to get the block size in kB, and then convert that to byte so that we keep compatibility. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29Replace usage of "cp -s" with the more portable "ln -s"Sebastian Nowicki
The "-s" argument does not exist on BSD, and neither does "--remove-destination". This patch replaces the calls to "cp -s --remove-destination" with the equivalent "rm -f" and "ln -s" calls, in order to increase portability. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14Fix compilation warning on x86_64Dan McGee
Glad we have so many developers using this as their native architecture. int/size_t issue here. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14Disable geteuid in cygwin.Xavier Chantry
This is one of those rare cases where we actually want to code in a platform-specific #ifdef. Because you don't need to be the root user on a Windows box, and fakeroot doesn't exist so we can do easy testing, lets disable any checking of the UID. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14pactest: only use fakeroot when it is found.Xavier Chantry
Only use fakeroot and fakechroot when they are found AND required. fakechroot only had the first condition, and fakeroot only the second. When they are required (user != root) but not found, display a warning. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14Remove wrapper call around versioncmpDan McGee
Actually, just rename _alpm_versioncmp to alpm_pkg_vercmp and get rid of the need for a wrapper since it did nothing anyway. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-14Update _alpm_versioncmpDan McGee
This code hasn't been looked at in some time. I grabbed a more recent version of the RPM source (4.4.2.3) and attempted to sync up any changes they have made, as well as make the libalpm additional code much cleaner and limited to only a few added lines of code. The size of this patch might make you think we added code, but bloat-o-meter actually tells us otherwise: <function> <old> <new> <diff> _alpm_versioncmp 1485 1021 -464 Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Simplify _alpm_pkg_new()Dan McGee
Any real call of this function doesn't specify a name or version ahead of time, so just kill that functionality off. Now to remove those dummy packages... Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Remove lazy init code from pkg name and version functionsDan McGee
If we have a package without name and/or version, we are really out of luck. Speed these functions up by removing unnecessary code. Note that both the splitname and pkg_load functions, where the name and version of packages are initially populated for databases and pkg.tar.gz files respectively, enforce that every new package struct created has a name and version. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Fix rewinddir regression by cleaning up db_scanXavier Chantry
Commit 046003844739416ff6d168dd2dec76490adb0727 caused a regression when rereading the pkgcache after updating the on-disk databases. A rewinddir call was errantly removed. Instead of replacing the call to rewindir, clean up this whole mess. db_scan is used only once and with target == NULL so there was actually half the code of db_scan which was unused. This is gone now and replaced by a single new db_populate function. Dan: add_sorted ended up being 3x slower than one msort at the end, so I changed back to that. I also made one pointer variable const and merged this whole patch with my original fix for the rewinddir issue. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Remove --builddeps from makepkgDan McGee
This really should be in an external script, as it is not makepkg's job to rebuild your system. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Remove an outdated exception check in file conflict codeDan McGee
This has been around since at least pacman 2.9.8. Frugalware just dumped it in commit 113ec73bfcfdc, and deleting it here and running pactest shows that nothing that we have actually tested changes. If someone can pactest the edge case where this is needed, then show me the money. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Add SyncFirst option.Chantry Xavier
This patch offers a way to fix FS#9228. By putting "SyncFirst = pacman" in pacman.conf, the version check will happen before the transaction really starts, and before any replacements is made. Otherwise, no version check is done. The sync301 pactest was updated to use this SyncFirst option. Example session with SyncFirst = pacman, and a newer pacman version available : $ pacman -Su (or pacman -S <any targets>) :: the following packages should be upgraded first : pacman :: Do you want to cancel the current operation :: and upgrade these packages now? [Y/n] resolving dependencies... looking for inter-conflicts... Targets: pacman-x.y.z-t Total Download Size: x.xx MB Total Installed Size: x.xx MB Proceed with installation? [Y/n] n As Nagy previously noted, doing this check on any -S operations might look intrusive, but it can be required. For example, the case where you want to install a package with versioned provisions, using a pacman version which didn't support that feature yet (and there is already a newer pacman in sync db supporting it). Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Cleanup usages of alpm_list_find and alpm_list_remove.Chantry Xavier
* remove obsolete and unused *_cmp helper functions like deppkg_cmp and _alpm_grp_cmp * new alpm_list_remove_str function, used 6 times in handle.c * remove _alpm_prov_cmp / _alpm_db_whatprovides and replace them by a more general alpm_find_pkg_satisfiers with a cleaner implementation. before: alpm_db_whatprovides(db, targ) after: alpm_find_pkg_satisfiers(alpm_db_getpkgcache(db), targ) * remove satisfycmp and replace alpm_list_find + satisfycmp usage by _alpm_find_dep_satisfiers. before : alpm_list_find(_alpm_db_get_pkgcache(db), dep, satisfycmp) after : _alpm_find_dep_satisfiers(_alpm_db_get_pkgcache(db), dep) * remove _alpm_pkgname_pkg_cmp, which was used with alpm_list_remove, and use _alpm_pkg_find + alpm_list_remove with _alpm_pkg_cmp instead. This commit actually get rids of all complicated and asymmetric _cmp functions. I first thought these functions were worth it, be caused it allowed us to reuse list_find and list_remove. But this was at the detriment of the clarity and also the ease of use of these functions, dangerous because of their asymmetricity. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Swap the parameters of alpm_pkg_findNagy Gabor
Now the syntax is coherent with alpm_list_find and alpm_sync_find. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-13Remove errant include of error.hDan McGee
This doesn't exist anymore, the header file was removed a while back in commit 4c872594da321aa406cfb306c32c94ce2929d59e. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-11Merge branch 'maint'Dan McGee
Conflicts: lib/libalpm/package.c - comment location moved to be_package.c
2008-05-11Refactor pkg_load/parse_descfile into a new backend fileDan McGee
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-11Remove some useless abstraction and start db cleanupDan McGee
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-11Make all error messages use pm_fprintfAllan McRae
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-11pactest: fix --gdb optionDan McGee
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-10Add detailed description to alpm_pkg_loadSebastian Nowicki
It was unclear what "loading the full package" actually did. The detailed description should clear that up, without having to look at the code. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10contrib/paclist: list packages installed from given repo.Chantry Xavier
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 McGee
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 McGee
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 McGee
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 McGee
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-08Use strdup() instead of a static bufferDan McGee
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-08Update md5 routinesDan McGee
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-08be_files.c: PATH_MAX cleanupDan McGee
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-08pacman-side code cleanupsDan McGee
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-29Merge branch 'maint'Dan McGee
2008-04-29Doxyfile : enable JAVADOC_AUTOBRIEF.Chantry Xavier
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 Nowicki
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-28Updates to _alpm_copyfile()Dan McGee
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-28Rework extract_single_file() temp file creationDan McGee
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-28Update pactest to allow setting modes on created filesDan McGee
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-27Remove unnecessary archive_entry_set_pathname() callsDan McGee
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>