summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* pactest: add more testing for epochDan McGee2011-01-21
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* pactest: Rename epoch pactestsDan McGee2011-01-21
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a likely_pkg hint argument to sync_db_readDan McGee2011-01-21
| | | | | | | | | | | | | | | In most (all?) cases, we will process all files for a given sync database entry sequentially. The code currently does an _alpm_pkg_find() for every file in the database, but we had the "current" package readily available. Shift some local variables around a bit to expose this to sync_db_read() and use it if the package is the correct one. On my system, this cuts calls to _alpm_pkg_find() from 20,769 to 10,349 calls during a -Qu operation, and results in a ~30% speedup of the same operation (0.35 sec -> 0.27 sec). This benefit should be apparent anywhere we read in the full contents of the sync databases. Signed-off-by: Dan McGee <dan@archlinux.org>
* Improve splitname memory allocationDan McGee2011-01-21
| | | | | | | | We don't need to create a temporary copy of the string if we are smart with our pointer manipulation and string copying. This saves a bunch of string duplication during database parsing, both local and sync. Signed-off-by: Dan McGee <dan@archlinux.org>
* Improve depends string parsingDan McGee2011-01-21
| | | | | | | | | Remove the need for an unconditional string duplication by using pointer arithmetic instead, and strndup() instead of an unspecified-length strdup(). This should reduce memory churn a fair amount as this is called pretty frequently during database loads. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add strndup fallback function to libalpm utilDan McGee2011-01-21
| | | | | | The same fallback we are currently using in the pacman frontend. Signed-off-by: Dan McGee <dan@archlinux.org>
* Update valgrind suppressions fileDan McGee2011-01-21
| | | | | | | We haven't tweaked this in a while, but some of the old stuff seems to no longer be necessary and there are a few new things we should add. Signed-off-by: Dan McGee <dan@archlinux.org>
* Add a pactest for the situation in FS#7524Dan McGee2011-01-21
| | | | | | | Confirming the current behavior. And yes, the error message is still no better than it was when this was reported 3.5 years ago. Signed-off-by: Dan McGee <dan@archlinux.org>
* Fix integrity check status when installing from fileDan McGee2011-01-18
| | | | | | | | When installing packages from a file, the integrity check count stays at (0/x) complete. This ensures it is bumped to (x/x) at the end of the process. Signed-off-by: Dan McGee <dan@archlinux.org>
* makepkg: perform all sanity checks before erroring outDan McGee2011-01-14
| | | | | | | | | | | | It is pretty annoying to get one, fix it, and then get another. We should be able to continue on through most of the sanity checks in one go so the user gets all the error messages at once. Also ensure $pkgbase is defined by the time we call this function; previously we printed nothing where a package name should have been due to this oversight. Signed-off-by: Dan McGee <dan@archlinux.org>
* repo-add: fix misguided conditional correctionDan McGee2011-01-13
| | | | | | | | I tried to move things around here when testing and did a bit too much; the warning message always showed regardless of delta inclusion in the call. Fix it so we only warn if we have a filename, but the file couldn't be located. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-01-12
|\ | | | | | | | | Conflicts: lib/libalpm/be_files.c
| * Fix double read issue in maint releasesDan McGee2011-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is essentially a backport/cherry-pick of commit 33240e87b99e from master, but has to be done by hand because the DB format has diverged. Read more in the commit message used there, which follows. Due to the way we funk around with package data loading, we had a condition where the filelist got doubled up because it was loaded twice. Packages are originally loaded with INFRQ_BASE. In an upgrade/sync, the package is checked for file conflicts next, leaving us in an "INFRQ_BASE | INFRQ_FILES" state. Later, when committing a single package, we have an explicit call to _alpm_local_db_read() with INFRQ_ALL as the level. Because the package's level did not match this, we skipped over our previous "does the incoming level match where I'm at" shortcut, and continued to load things again, because of a lack of fine-grained checking for each of DESC, FILES, and INSTALL. The end result is we loaded the filelist twice, causing our remove logic to iterate twice over the installed files, spewing a bunch of "cannot find file X" messages. Fix the problem by doing a bit more bitmasking logic throughout the load method, and also fix the sanity check at the beginning of the function- this should *only* be used for local packages as opposed to the "not a package" check that was there before. Signed-off-by: Dan McGee <dan@archlinux.org>
| * pactest: build the filelist using a set()Dan McGee2011-01-12
| | | | | | | | | | | | | | | | | | This will prevent duplicates, which we had plenty of once I made a few tests that had a list of files greater than the normal two. The previous logic was not working quite right. Signed-off-by: Dan McGee <dan@archlinux.org> (cherry picked from commit 0d4dd09993971924d379be4d0944d72f4c77b021)
| * Make debug config messages consistent in capitalizationDan McGee2011-01-11
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
| * Back out anticipated epoch changesDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | After all the debate as to what to do on maint, we are going to end up just incorporating epoch into the version string, so we don't need this separate field at all. Revert commit 5c8083baa4a and also kill the force flag we were recording here as well. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'diskspace-fixes'Dan McGee2011-01-11
|\ \
| * | Call archive_read_data_skip() while checking diskspaceDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | libarchive eventually calls it anyway, but backtraces make a lot more sense if we call it, as well as matching our precedent from alpm_pkg_load(). Signed-off-by: Dan McGee <dan@archlinux.org>
| * | Add error message stating which partition is fullDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is helpful anyway to the user, and should also be helpful to us if we see problems cropping up in the check during development. Also add a missing ->used = 0 initialization in the code path less taken. Signed-off-by: Dan McGee <dan@archlinux.org>
| * | Unify two free diskspace error messagesDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | Although they won't be the same in the gettext catalog because of the '\n' we should still use the same text. Signed-off-by: Dan McGee <dan@archlinux.org>
* | | Merge branch 'fix-double-load'Dan McGee2011-01-11
|\ \ \
| * | | Fix double filelist issue when upgrading a packageDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the way we funk around with package data loading, we had a condition where the filelist got doubled up because it was loaded twice. Packages are originally loaded with INFRQ_BASE. In an upgrade/sync, the package is checked for file conflicts next, leaving us in an "INFRQ_BASE | INFRQ_FILES" state. Later, when committing a single package, we have an explicit call to _alpm_local_db_read() with INFRQ_ALL as the level. Because the package's level did not match this, we skipped over our previous "does the incoming level match where I'm at" shortcut, and continued to load things again, because of a lack of fine-grained checking for each of DESC, FILES, and INSTALL. The end result is we loaded the filelist twice, causing our remove logic to iterate twice over the installed files, spewing a bunch of "cannot find file X" messages. Fix the problem by doing a bit more bitmasking logic throughout the load method, and also fix the sanity check at the beginning of the function- this should *only* be used for local packages as opposed to the "not a package" check that was there before. A debug log message was added to upgraderemove as well to match the one already in the normal remove codepath. Signed-off-by: Dan McGee <dan@archlinux.org>
| * | | Add two pactests with non-trivial file countsDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These are probably useful anyway, but also exposed the double file list bug that will be fixed in a later commit. Signed-off-by: Dan McGee <dan@archlinux.org>
| * | | pactest: build the filelist using a set()Dan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will prevent duplicates, which we had plenty of once I made a few tests that had a list of files greater than the normal two. The previous logic was not working quite right. Signed-off-by: Dan McGee <dan@archlinux.org>
* | | | Merge branch 'repo-add-improvements'Dan McGee2011-01-11
|\ \ \ \ | |_|/ / |/| | |
| * | | doc: add docs for repo-add -d optionDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | | | | This never got added when the option was brought in, so fix it. Signed-off-by: Dan McGee <dan@archlinux.org>
| * | | repo-add: Create/modify files databasesPyroPeter2011-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements FS#11302. Dan: updated docs to not reference pkgfile. Signed-off-by: PyroPeter <abi1789@googlemail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * | | repo-add: use pushd/popdDan McGee2011-01-11
| |/ / | | | | | | | | | | | | | | | | | | | | | Rather than explicit cd calls, we can use the directory stack to our advantage. This also removes the need to store and restore $startdir, so kill the variable entirely. Signed-off-by: Dan McGee <dan@archlinux.org>
* | | Add a progressbar for package integrity checkingDan McGee2011-01-11
| | | | | | | | | | | | | | | | | | | | | This can take a while too, and it is really easy to add the necessary callback stuff for adding a progressbar. Signed-off-by: Dan McGee <dan@archlinux.org>
* | | Small fix to download size lookup and a loggerDan McGee2011-01-11
|/ / | | | | | | | | | | | | | | These were just two small things I came across today and found could be fixed or helpful, so I've added them and I'm not sure what else to bundle them with. commit_count++ Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: correctly write epoch and force as necessaryDan McGee2011-01-10
| | | | | | | | | | | | | | We were missing this in a few places; also add the ability to check the outcome via a new rule type. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Use double rather than float everywhereDan McGee2011-01-10
| | | | | | | | | | | | No real need to use the smaller floating point types here. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Progress callback cleanups and fixesDan McGee2011-01-10
| | | | | | | | | | | | | | | | * Remove a stale comment * Fix a logic error- the conditional disagreed with the comments * Remove some unnecessary floating point casts Signed-off-by: Dan McGee <dan@archlinux.org>
* | Ensure we use local package when calculating removed sizeDan McGee2011-01-10
| | | | | | | | | | | | | | | | | | | | | | We were checking if a package existed locally, but then using the incoming package to calculate removed size rather than the currently installed package. Also adjust the local variable in the replaces loop to make it more clear that we are always dealing with local packages here. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove need for floating point division in backendDan McGee2011-01-10
| | | | | | | | | | | | | | | | | | | | | | All of these can be done with integer division; the only slightly interesting part is ensuring we round up like before with calling the ceil() function. We can also remove the math library from requirements; now that the only ceil() calls are gone, we don't need this anymore. Signed-off-by: Dan McGee <dan@archlinux.org>
* | libalpm/be_package.c: fix small memleakXavier Chantry2011-01-07
| | | | | | | | | | | | | | | | | | | | file_pkg_ops can be a static struct like in other backends, we just need to initialize it at some point. Dan: add initialization flag. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix some more simple conversion "errors"Dan McGee2011-01-07
| | | | | | | | | | | | | | | | None of these warn at the normal "-Wall -Werror" level, but casts do occur that we are fine with. Make them explicit to silence some warnings when using "-Wconversion". Signed-off-by: Dan McGee <dan@archlinux.org>
* | Use size_t for alpm_list sizesAllan McRae2011-01-07
| | | | | | | | | | | | | | | | | | | | | | | | | | There is a lot of swtiching between size_t and int for alpm_list sizes in the codebase. Start converting these to all be size_t by adjusting the return type of alpm_list_count and fixing all additional warnings given by -Wconversion that are generated by this change. Dan: a few more small changes to ensure things compile, adjusting some printf format string characters to accommodate the larger size on x86_64. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Refactor old date parsing into single methodDan McGee2011-01-07
| | | | | | | | | | | | | | We've managed to duplicate this four times at this point, so make it a method in util.c instead. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Update copyright years for 2011Allan McRae2011-01-07
| | | | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | vercmp: always return 0 if we perform a compareDan McGee2011-01-05
| | | | | | | | | | | | | | | | | | And change the wording slightly to indicate we *print* a value, not *return* it. You can't return negative values (they get coerced to 255), so it isn't worth it to try and cram the result into the return code. Acked-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove FORCE reading from local DBDan McGee2011-01-05
| | | | | | | | | | | | We never wrote it here, so no need to read it in either. Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: Use booleans where it makes senseDan McGee2011-01-05
| | | | | | | | | | | | No need to use 0/1 when we can use False/True for the force option. Signed-off-by: Dan McGee <dan@archlinux.org>
* | pactest: remove dead functionDan McGee2011-01-05
| | | | | | | | | | | | Stopped being used after commit fa933df65b9. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Fix function indentationDan McGee2011-01-02
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2010-12-30
|\| | | | | | | | | | | Conflicts: lib/libalpm/sync.c test/pacman/tests/ignore007.py
| * Respect Ignore{Pkg,Group} for group membersJakob Gruber2010-12-30
| | | | | | | | | | | | Fixes FS#19854. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Move group code to separate functionJakob Gruber2010-12-30
| | | | | | | | | | | | | | This makes the following commits more readable. No logic was changed in this commit. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Tests: Sync group which includes ignored pkgsJakob Gruber2010-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * FS#19854 (--ignore is ignored with groups) * http://www.archlinux.org/pipermail/pacman-dev/2009-June/008847.html (operation aborts when a package from a group is ignored/and user chooses not to install it) If a group member is ignored, we expect a) a question whether to install b) after saying 'no' to a), the ignored member not to be installed c) all other group members to be installed d) pacman to execute successfully Signed-off-by: Dan McGee <dan@archlinux.org> (cherry picked from commit 9d0b33fd3327ae6d2b15f50870c0885a2068d492)
| * doc: add website zip to clean filesDan McGee2010-12-29
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>