summaryrefslogtreecommitdiff
path: root/src/pacman
Commit message (Collapse)AuthorAge
* Give sensible feedback when a repo has no configured serversDan McGee2009-06-08
| | | | | | | | | | | | | | This fixes FS#14899. When running an -Sp operation without servers configured for a repository, we would segfault, so add an assert to the backend method returning the first server preventing a null pointer dereference. In addition, add a new error code to libalpm that indicates we have no servers configured for a repository. This makes -Sy and -S <package> operations fail gracefully and helpfully when a repo is set up with no servers, as the default mirrorlist in Arch is provided this way. Signed-off-by: Dan McGee <dan@archlinux.org>
* We don't need root with -SpNagy Gabor2009-06-01
| | | | | | | | | | | | FS#8905 is fixed. The front-end passes PM_TRANS_FLAG_NOLOCK to the back-end, so it doesn't lock the database. That's why we don't need root anymore. I reworked (and renamed) needs_transaction() accordingly. I also added missing -Sc check there (for example, -Sci didn't print non-root error, but pacman wanted to lock the database). Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Change package to package(s) and file to file(s) in documentationNagy Gabor2009-06-01
| | | | | | | | The pacman --help pages and the manual suggested that only one package can be upgraded/removed per transaction. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove unused string.h from src/pacman/remove.cGerardo Exequiel Pozzi2009-06-01
| | | | | | | | This header was used in the code for the function strdup() that is not used anymore. Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> Signed-off-by: Dan McGee <dan@archlinux.org>
* Query documentation updatesNagy Gabor2009-05-18
| | | | | | | | | | The old documentation didn't emphasize our filtering options at all, and it was a bit misleading. ("List ALL...") I also clarified the description of -Qu. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove version information from -Qqo outputDan McGee2009-05-11
| | | | | | | This was the only --quiet operation that showed version information; make it consistent with the rest. Signed-off-by: Dan McGee <dan@archlinux.org>
* Introduce -QlqNagy Gabor2009-05-11
| | | | | | | | With --quiet flag, -Ql doesn't print the package name, just lists the files. I made --quiet documentation up-to-date (I also added -Sgq/-Qgq). Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove pmsyncpkg_tNagy Gabor2009-04-11
| | | | | | | | | | | | | | | | | | | | | pmsyncpkg_t data sructure was removed: 1. pmpkg_t.reason is used instead of pmsyncpkg_t.newreason. (The target packages come from sync repos, so we can use this field without any problems. Upgrade transaction also uses this field to store this info.) 2. pmsyncpkg_t.removes was moved to pmpkg_t.removes. This step requires careful programming, because we don't duplicate packages when we add them to trans->packages. So we modify sync pkgcache when we add this transaction-only info to our package. Hence it is important to free this list when we remove any package from the target list (remove_unresolvable, remove_conflicts, trans_free), otherwise this could confuse the new sync transactions (with non-pacman GUI). Overall, our code became ~100 line shorter, and we can call our helper functions directly on trans->packages in sync.c, we don't need to maintain parallel package lists. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* New error type: PM_ERR_PKG_IGNOREDNagy Gabor2009-04-11
| | | | | | | | | | This patch fixes FS#12059. Now sync_addtarget can return with PM_ERR_PKG_IGNORED, which indicates that although the requested package was found it is in ignorepkg, so alpm could not add it to the transaction. So the front-end can decide what to do. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Document --debugNagy Gabor2009-04-05
| | | | | | | | After some irc/forum experiences, I decided to document this option. However, I left the debug-level undocumented (--debug=2). Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Don't prompt the user for unignore of IgnorePkg/IgnoreGroup packagesBryan Ischo2009-02-23
| | | | | | | | | | Don't prompt the user for unignore of IgnorePkg/IgnoreGroup packages, except for packages explicitly listed for sync by the user. This eliminates many unnecessary prompts when IgnorePkg/IgnoreGroup is used. Signed-off-by: Bryan Ischo <bryan@ischo.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Enabled new interactive prompt and updated some testsBryan Ischo2009-02-23
| | | | | | | | | | | | | | | Enabled a new prompt to ask the user if they'd like to remove unresolvable packages from the transaction rather than failing it. Many pactest tests that used to fail now return success codes, because pacman now issues a prompt allowing the user to cancel rather than failing many transactions, and the pactest scripts always choose to cancel with no error rather than failing. The only net effect is that the return status of pacman is now 0 in cases where it used to be nonzero. Signed-off-by: Bryan Ischo <bryan@ischo.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Rename alpm_get_md5sum to alpm_compute_md5sum and alpm_dep_get_string to ↵Nagy Gabor2009-01-12
| | | | | | | | | | | alpm_dep_compute_string This patch introduces the following function name convention: _compute_ in function name: the return value must be freed. _get_ in function name: the return value must not be freed. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* HoldPkg reworkNagy Gabor2009-01-12
| | | | | | | | | | | | | | | | | | | The HoldPkg feature is even more important when the packages to be held are pulled automatically by pacman, in a -Rc and -Rs operation. Before, it only applied when the packages were explicitly requested by the user to be removed. This patch extends holdpkg to -Rc and -Rs by doing the HoldPkg check just before trans_commit. Additionally, the whole HoldPkg stuff was moved to the front-end. I changed the default behavior to "don't remove", so I modified remove030.py pactest as well. See also: FS#9173. Original-work-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Merge branch 'maint'Dan McGee2008-12-02
|\ | | | | | | | | Conflicts: lib/libalpm/dload.c
| * Add flush after downloading messageSimo Leone2008-12-02
| | | | | | | | | | | | | | | | When the output is going to a file, glibc seems to buffer way too much making it hard to monitor progress while tailing a file. Signed-off-by: Simo Leone <simo@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Give an error message on alpm_db_register_sync() errorNagy Gabor2008-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch slightly modifies pacman.c/_parseconfig(): See FS#12148. Now pacman prints the following error message in that case: "error: could not register 'unstable' database (could not open database)" I also added an error message for alpm_db_setserver() error. I changed the "return(1);" scheme to "ret = 1; goto cleanup;" to make sure that we free allocated memory and close open files. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Minor code cleanupsDan McGee2008-11-17
| | | | | | | | | | | | Mostly noticed when compiling libalpm/pacman with ICC. Signed-off-by: Dan McGee <dan@archlinux.org>
* | -Qu reworkNagy Gabor2008-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | From now on -Qu is an "outdated package" filter on local database. (This is a behaviour change.) This patch fixes some memleaks and makes the code cleaner, for details see my comment on FS#7884. FS#11868 is implemented. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-10-12
|\|
| * Make interrupt handler async-safeDan McGee2008-10-12
| | | | | | | | | | | | | | Calling printf() in a signal handler can be dangerous, so avoid it by writing directly which is guaranteed to be safe according to signal(7). Signed-off-by: Dan McGee <dan@archlinux.org>
| * Reduce number of calls to getcols()Dan McGee2008-10-12
| | | | | | | | | | | | | | Every call to getcols() results in two ioctl() calls, which we really didn't need as changing the number of columns in mid-print would be pretty crazy. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Ensure we don't have double slashes when creating frontend pathsDan McGee2008-10-12
| | | | | | | | | | | | | | | | Because libalpm always returns a root path with a trailing slash, when we use it to create our unspecified paths we get double slashes in the result. Use the fix suggested by Jürgen Hötzel to remedy this. Signed-off-by: Dan McGee <dan@archlinux.org>
| * Another attempt at fixing totaldownload.Xavier Chantry2008-09-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes FS#11339, which is a regression of commit 89c2c5196: When totaldownload is enabled, the database downloading percent (-Sy) is always at 0. That is because we have no guarantee that the totaldownload callback was called by libalpm. In particular, it is not called (and it would not make sense to) when a single file is downloaded, like it is the case with databases. So the correct way to detect if totaldownload should be used is checking both config->totaldownload and list_total, like it was already done in several places in the cb_dl_progress function. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
| * Separate targets on -Qi/-Si with a newline.Xavier Chantry2008-08-28
| | | | | | | | | | | | | | | | This fixes FS#11331 The newline was lost with commit 9451b2e4f23a3c566fcfe3420c379b3cb3eb1f90. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
* | Remove unnecessary initialization in new functionsDan McGee2008-09-03
| | | | | | | | | | | | | | We don't need to zero things out, we are already using calloc for this purpose. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-08-26
|\|
| * Add missing comma to -S --help messageRoman Kyrylych2008-08-25
| | | | | | | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Rename alpm_db_get{pkg,grp}cache to alpm_db_get_{pkg,grp}cacheXavier Chantry2008-08-25
| | | | | | | | | | | | | | | | This is more consistent with the private functions : _alpm_db_get_{pkg,grp}cache Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | pacman : smarter optdepends handling.Xavier Chantry2008-08-25
| | | | | | | | | | | | | | | | | | | | During an upgrade, only the new optdepends will be displayed, to only keep the useful information and not clutter pacman output too much. The whole optdepends list is always available with -Si / -Qi. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* | Merge branch 'maint'Dan McGee2008-08-23
|\|
| * Fix 'None' text so we don't have to translate it twiceDan McGee2008-08-23
| | | | | | | | | | | | | | We had one "None" and one "None\n" string; we can let the program do the addition of the newline so we don't have to. Signed-off-by: Dan McGee <dan@archlinux.org>
* | Move -Sp implementation to the front-endNagy Gabor2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch kills one of our hackish pseudo transactions: PRINTURIS. (The other one is -Sw) From now on, front-end must not call trans_commit in case of -Sp, it should print the uris of target packages "by hand" instead. PRINTURIS flag was removed, NOCONFLICTS flag can be passed to skip conflict checks. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* | split yesno() into yesno() and noyes() functions.Xavier Chantry2008-08-23
|/ | | | | | | | | | | | | | | | The yesno function had a preset argument for specifying the default answer : yes or no. However, in all our calls to yesno, only one used the default "no" answer. Having to specify preset==1 for all the other cases was rather cumbersome. To make this easier, this commit adds a noyes function, with the following behavior : yesno() : default answer is yes noyes() : default answer is no Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Cleanup of _alpm_pkg_compare_versions.Xavier Chantry2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change the return values to be more informative. It was previously boolean, only indicating if a sync package was newer than a local package. Now it is a simple wrapper to vercmp, handling the force flag. * Remove the verbose output from _alpm_pkg_compare_versions. The "force" message is not so useful. The "package : local (v1) is newer than repo (v2)" message can be moved to -Su operation. For the -S operation, it is better to have something like : "downgrading package from v1 to v2" * Don't display the "up to date -- skipping" and "up to date -- reinstalling" messages, when the local version is newer than the sync one. * Fix the behavior of --needed option to not skip a target when the local version is newer, and clarify its description. * Add a new alpm_pkg_has_force function This allows us to access the pkg->force field like any other package fields. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* download : disable progressbar when total is unknown.Xavier Chantry2008-08-23
| | | | | | | | | | | | | | | This is a work around for FS#8725. There are some bad combination of proxies and mirrors where the Content Length is not returned, and thus the progress bar can't be displayed correctly. Dan: Note that this patch also adds a "downloading" message when the progress bar is disabled, which was formerly not indicated at all in the output. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman : clarify help message.Xavier Chantry2008-08-23
| | | | | Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman: print optdepends on install and upgrade.Xavier Chantry2008-08-23
| | | | | | | This implements FS#10630. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Add new list_display_linebreak functionNagy Gabor2008-08-23
| | | | | | | | | | | | | | | | | | | | list_display puts several members on the same line, which is not appropriate for optdepends: Optdepends: foo: feature1 bar: feature2 baz: feature3 The new list_display_linebreak function puts every member on its own line, which is much better with optdepends: Optdepends: foo: feature1 bar: feature2 baz: feature3 Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Xav: implement this new behavior as a new function rather than as a parameter of list_display] Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Move the the description parsing logic to string_display()Nagy Gabor2008-08-23
| | | | | | | | | So dump_pkg_full will indent all strings correctly. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Xav: add string_length function] Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman.c: fix typo s/NoPassiveFTP/NoPassiveFtpXavier Chantry2008-08-19
| | | | | | | | | | | | | This fixes FS#11203. The doc has always mentioned NoPassiveFtp, but an inconsistency was introduced with commit 76f816b9f764434d02e90207ee4656ebae2b6a8c when case sensitive comparision was introduced, and was only found after commit b3e6cf652c9e989badaf5499abb1d64c1a110927 which dropped the case insensitive comparison. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* pacman/callback.c : fix detection of totaldownloadXavier Chantry2008-08-13
| | | | | | | | | | | | | | This fixes FS#11180. The usage of the total percent was detected like this : /* use disp_percent if it is not 0, else show bar_percent */ However, it is very possible that the total percent is 0 at the beginning, if the first packages downloaded are very small compared to the total download. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove UseColor from front-endNagy Gabor2008-07-29
| | | | | | | This option wasn't used. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Show number of packages to be installed / removed.Xavier Chantry2008-07-24
| | | | | | | This fixes FS#7794. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* src/pacman : rework the display_targets function.Xavier Chantry2008-07-24
| | | | | | | | | | | | | | | | | | | | We had a lot of duplicated code here. The code handling the showsize option needed to be there three times : 1) for install part of -S 2) for remove part of -S (conflict removal) 3) for -R This patch introduce a new display_targets(pkglist, install) function which can handle the 3 cases above. We pass install == 1 for case 1), and install == 0 for case 2) and 3). Now we can finally get the benefit of an old patch which handled the ShowSize option consistently in the 3 cases above, without an awful lot of duplicated code : http://www.archlinux.org/pipermail/pacman-dev/2008-January/011029.html Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* -Sqg and -QqgNagy Gabor2008-07-22
| | | | | | | | | | With --quiet, "pacman -Sg grp" and "pacman -Qg grp" don't list group names. Note that "pacman -Qgq" and "pacman -Sggq" (without targets) still list group names becuase their output would not be very useful without them. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Re-enable --debug with -Sw and -SpNagy Gabor2008-07-22
| | | | | | | | Commit 874190827676e3a974e8c5fef6c51b9e9d6b60fa disabled --debug in these cases. We just clear PM_LOG_WARNING flag now. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
* Remove pacman.static build from build filesDan McGee2008-07-15
| | | | | | | | | | This presents plenty of problems on OSes besides Linux, and even on Linux when the libtool file for libarchive isn't present. The static build isn't all that useful anyway as missing something such as glibc will still leave you unable to run the pacman.static binary. Remove it from the formal build process. Signed-off-by: Dan McGee <dan@archlinux.org>
* src/pacman/sync.c : Display only errors with -Sp and -Sw operations.Xavier Chantry2008-07-13
| | | | | | | | In particular, this avoids warnings cluttering the output of these operations. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
* sync_addtarget reworkNagy Gabor2008-07-13
| | | | | | | | | | | | | | | | | | | | | | Now '-S provision' handling is done in the back-end. In case of multiple providers, the first one is selected (behavior change: deleted provision002.py). The old processing order was: literal, group, provision; the new one: literal, provision, group. This is more rational, but "pacman -S group" will be slower now. "pacman -S repo/provision" also works. Provision was generalized to dependencies, so you can resolve deps by hand: "pacman -S 'bash>2.0'" or "pacman -S 'core/bash>2.0'" etc. This can be useful in makepkg dependency resolving. The changes were documented in pacman manual. alpm_find_pkg_satisfiers and _alpm_find_dep_satisfiers functions were removed, since they are no longer needed. I added some verbosity to "select provider instead of literal" and "fallback to group". Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>