summaryrefslogtreecommitdiff
path: root/src/pacman/sync.c
Commit message (Collapse)AuthorAge
* sync: add missing newline in warning messageDave Reisner2011-09-06
| | | | | | | Dan: fix the other missing one too. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* Be fully silent on any -Sp operationDan McGee2011-09-02
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Improve advice for sync ops when db.lck is presentPang Yan Han2011-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | When the database is locked, sync operations involving transactions, such as pacman -Syy, show the following: :: Synchronizing package databases... error: failed to update core (unable to lock database) error: failed to update extra (unable to lock database) error: failed to update community (unable to lock database) error: failed to update multilib (unable to lock database) error: failed to synchronize any databases Whereas pacman -U <pkg> shows: error: failed to init transaction (unable to lock database) if you're sure a package manager is not already running, you can remove /var/lib/pacman/db.lck Which is much more meaningful, since the presence of db.lck may indicate an erroneous lockfile instead of an ongoing transaction. Improve the error messages for sync operations by advising the user to remove db.lck if he is sure that no package manager is running. Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Allow access to package origin dataDan McGee2011-08-28
| | | | | | | Add new alpm_pkg_get_origin() method, use it in the front end now that the enum constants are publicly available. Signed-off-by: Dan McGee <dan@archlinux.org>
* Make sync error message smarter on unfound targetsDan McGee2011-08-28
| | | | | | | | | | | | | | | | | | We had two issues here. One is a file with an absolute path passed to -S results in a cryptic error message due to the database name being '\0'. The second is not realizing you should be doing -U instead of -S. Fix both of these to transform this: $ sudo pacman -S /tmp/binutils-2.21.1-2-i686.pkg.tar.xz error: database not found: to this: $ sudo pacman -S /tmp/binutils-2.21.1-2-i686.pkg.tar.xz error: target not found: /tmp/binutils-2.21.1-2-i686.pkg.tar.xz warning: '/tmp/binutils-2.21.1-2-i686.pkg.tar.xz' is a file, did you mean -U/--upgrade instead of -S/--sync? Signed-off-by: Dan McGee <dan@archlinux.org>
* Parse conflicts/provides/replaces at database load timeDan McGee2011-08-15
| | | | | | | | | | | | | | | | | | | | | | We did this with depends way back in commit c244cfecf654d3 in 2007. We can do it with these fields as well. Of note is the inclusion of provides even though only '=' is supported- we'll parse other things, but no guarantees are given as to behavior, which is more or less similar to before since we only looked for the equals sign. Also of note is the non-inclusion of optdepends; this will likely be resolved down the road. The biggest benefactors of this change will be the resolving code that formerly had to parse and reparse several of these fields; it only happens once now at load time. This does lead to the disadvantage that we will now always be parsing this information up front even if we never need it in the split form, but as these are uncommon fields and our parser is quite efficient it shouldn't be a big concern. Signed-off-by: Dan McGee <dan@archlinux.org>
* Enable recursive/needed sync on SyncFirstDan McGee2011-08-11
| | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* Attempt to fix up some of the brokenness around failed package loadsDan McGee2011-08-08
| | | | | | | | | | | | | | | This is a bit of a mess, due to the fact that we have a progress meter running. It is also ironic that we are in the midst of a method named "commit" when we haven't done a damn thing yet, and can still fail hard if either a checksum or signature is invalid or unrecognized. Adapt the former test_md5sum method to be invoked for any of the various failure types, which at least gives the user some indication of what packages are failing. A second patch will be needed to actually show worthwhile error codes, but this is going to involve modifying the actual data passed with the callback. Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2011-08-08
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: lib/libalpm/dload.c lib/libalpm/po/fi.po lib/libalpm/po/libalpm.pot po/de.po po/fi.po src/pacman/po/pacman.pot src/pacman/util.c
| * Fix group selection entry for large inputsDan McGee2011-07-25
| | | | | | | | | | | | | | | | | | | | | | | | Hardcoding anything always ends up burning you, and the arbitrary length of 64 here did just that. Add the ability to reallocate the readline buffer for longer inputs if necessary, and add other error checking as approprate. This also plugs one small memory leak of the group processing code selection array. Addresses FS#24253. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove duplicate code shared between sync and upgradeDan McGee2011-07-27
| | | | | | | | | | | | | | | | | | Pacman did a great job of having almost (but not quite) duplicate code paths through the sync and upgrade code. We can use the same logic in both upgrade in sync once the targets are resolved, so extract a function and delete a bunch of code. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Rework -Si display logicDan McGee2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We did some funny stuff here before to allow specifying fully-qualified package names, such as 'testing/gcc' or 'core/gcc'. However, it was done by duplicating code, not to mention an early escape if a repository could not be found for an early target. Something like `pacman -Si foo/bar core/gcc' would not give expected results, although `pacman -Si bar gcc' would. Clean up the code, remove strncpy() usage, and clarify the error messages a bit. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Allow invalid sync DBs to be returned by the libraryDan McGee2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | They are placeholders, but important for things like trying to re-sync a database missing a signature. By using the alpm_db_validity() method at the right time, a client can take the appropriate action with these invalid databases as necessary. In pacman's case, we disallow just about anything that involves looking at a sync database outside of an '-Sy' operation (although we do check the validity immediately after). A few operations are still permitted- '-Q' ops that don't touch sync databases as well as '-R'. Signed-off-by: Dan McGee <dan@archlinux.org>
* | signing: move to new signing verification and return schemeDan McGee2011-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives us more granularity than the former Never/Optional/Always trifecta. The frontend still uses these values temporarily but that will be changed in a future patch. * Use 'siglevel' consistenly in method names, 'level' as variable name * The level becomes an enum bitmask value for flexibility * Signature check methods now return a array of status codes rather than a simple integer success/failure value. This allows callers to determine whether things such as an unknown signature are valid. * Specific signature error codes mostly disappear in favor of the above returned status code; pm_errno is now set only to PKG_INVALID_SIG or DB_INVALID_SIG as appropriate. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Prefix _alpm_errno_t members with ALPMAllan McRae2011-07-02
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Prefix alpm_transflag_t members with ALPMAllan McRae2011-07-02
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Prefix alpm_loglevel_t members with ALPMAllan McRae2011-07-02
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Prefix alpm_fileconflicttype_t members with ALPMAllan McRae2011-07-02
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename public functions with grp in their nameAllan McRae2011-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using grp instead of group is a small saving at the cost of clarity. Rename the following functions: alpm_option_get_ignoregrps -> alpm_option_get_ignoregroups alpm_option_add_ignoregrp -> alpm_option_add_ignoregroup alpm_option_set_ignoregrps -> alpm_option_set_ignoregroups alpm_option_remove_ignoregrp -> alpm_option_remove_ignoregroup alpm_db_readgrp -> alpm_db_readgroup alpm_db_get_grpcache -> alpm_db_get_groupcache alpm_find_grp_pkgs -> alpm_find_group_pkgs Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmerrno_t to alpm_errno_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmgrp_t to alpm_group_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmfileconflict_t to alpm_fileconflict_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmconflict_t to alpm_conflict_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmdepmissing_t to alpm_depmissing_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmpkg_t to alpm_pkg_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Rename pmdb_t to alpm_db_tAllan McRae2011-06-28
| | | | | | | | Signed-off-by: Allan McRae <allan@archlinux.org>
* | Fix several -Wshadow warningsDan McGee2011-06-27
| | | | | | | | | | | | | | | | | | | | Only one of these looked like a real red flag, in find_requiredby(), but it doesn't hurt to fix several of them up anyway. Unfortunately, we can't turn this on universally due to things like the sync(), remove(), etc. builtins which we often use as variable names. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Don't require a transaction for sync DB updatesDan McGee2011-06-24
| | | | | | | | | | | | | | Instead, just do the required locking directly in the backend in calls to alpm_db_update(). Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove three unnecessary usages of alpm_list_count()Dan McGee2011-06-24
| | | | | | | | | | | | | | | | For the files count when loading from a package, we can keep a counter. The two in the frontend were completely useless due to the fact that if sync_dbs is non-NULL, alpm_list_count() will always be greater than 0. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make pmgrp_t publicDan McGee2011-06-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make pmdepend_t and pmdepmissing_t publicDan McGee2011-06-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make struct pmconflict_t publicDan McGee2011-06-16
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make pmfileconflict_t type publicDan McGee2011-06-16
| | | | | | | | | | | | | | | | | | | | | | | | This removes the need to write accessor methods for every type we have, and simplifies the API. Any type that doesn't need magic* can be converted in this fashion to make it easier for frontend applications to use, as well as make it less of a pain to introduce new such structs in the future. * "magic" meaning something like pmpkg_t where values can be lazy loaded. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Move pm_errno onto the handleDan McGee2011-06-13
| | | | | | | | | | | | This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add handle argument to two more alpm methodsDan McGee2011-06-13
| | | | | | | | | | | | This takes care of alpm_checkdeps() and alpm_find_dbs_satisfier(). Signed-off-by: Dan McGee <dan@archlinux.org>
* | Require handle for alpm_pkg_load()Dan McGee2011-06-13
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Add handle argument to alpm_(add|remove)_pkg()Dan McGee2011-06-13
| | | | | | | | | | | | | | | | This makes these functions consistent with the rest of the transaction related API calls. We do an additional assert to ensure the handle attached to the package is the same as the handle passed in. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Require handle for alpm_sync_sysupgrade()Dan McGee2011-06-09
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Require handle argument to all alpm_trans_*() methodsDan McGee2011-06-09
| | | | | | | | | | | | | | Begin enforcing the need to pass a handle. This allows us to remove one more extern handle declaration from the backend. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Require handle argument to all alpm_option_(get|set)_*() methodsDan McGee2011-06-09
| | | | | | | | | | | | | | | | This requires a lot of line changes, but not many functional changes as more often than not our handle variable is already available in some fashion. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Require handle argument to alpm_logaction()Dan McGee2011-06-09
| | | | | | | | | | | | | | This is the first in a series of patches to update the API to remove the implicit global handle variable. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Don't balk on .sig files being invalid in package cacheDan McGee2011-05-10
| | | | | | | | Signed-off-by: Dan McGee <dan@archlinux.org>
* | Perform package verification at package load timeDan McGee2011-04-24
| | | | | | | | | | | | | | | | | | | | | | Both md5sum verification and PGP verification can and should be done at package load time. This allows verification to happen as early as possible for packages provided by filename and loaded in the frontend, and moves more stuff out of sync_commit that doesn't really belong there. This should also set the stage for simplified parallel loading of packages later down the road. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Make dump_pkg_full a little less insaneDan McGee2011-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The various "level" values were a bit crazy to decipher, and we were doing some very interesting comparisons in certain places. Break it out into two parameters instead so we can seperate the type from the extra information display, and do things accordingly. Nothing changes with the display of any of the five types we currently show: -Si, -Sii, -Qi, -Qii, -Qip. Something to note- we should expose the PKG_FROM enum type somehow, this patch leaves the door open to do that quite easily. Signed-off-by: Dan McGee <dan@archlinux.org>
* | syntax: if/while statements should have no trailing spaceDan McGee2011-04-20
| | | | | | | | | | | | | | | | | | | | | | This is the standard, and we have had a few of these introduced lately that should not be here. Done with: find -name '*.c' | xargs sed -i -e 's#if (#if(#g' find -name '*.c' | xargs sed -i -e 's#while (#while(#g' Signed-off-by: Dan McGee <dan@archlinux.org>
* | style cleanup: cast as (type *) not (type*)Dave Reisner2011-04-20
| | | | | | | | | | Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Remove ShowSize optionJakob Gruber2011-04-20
| | | | | | | | | | | | | | | | | | | | Dan: The commit message originally referenced "VerbosePkgLists", but I'm going to change the name of the option. In addition, this patch serves a purpose being standalone- we should really do things like this with -S --print and hopefully -Q --print in the future. Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-03-29
|\|
| * call alpm_option_get_localdb once in syncfirst()Andrea Scarpino2011-03-29
| | | | | | | | | | Signed-off-by: Andrea Scarpino <andrea@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2011-03-21
|\| | | | | | | | | | | | | | | Conflicts due to change in return calling style. Conflicts: src/pacman/pacman.c src/pacman/sync.c