summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2009-05-19Query documentation updatesNagy Gabor1-5/+5
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>
2009-05-12Remove version information from -Qqo outputDan McGee1-2/+1
This was the only --quiet operation that showed version information; make it consistent with the rest. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-05-12Introduce -QlqNagy Gabor3-4/+8
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>
2009-04-11Remove pmsyncpkg_tNagy Gabor2-5/+4
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>
2009-04-11New error type: PM_ERR_PKG_IGNOREDNagy Gabor1-3/+4
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>
2009-04-06Document --debugNagy Gabor1-0/+1
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>
2009-02-24Don't prompt the user for unignore of IgnorePkg/IgnoreGroup packagesBryan Ischo1-9/+2
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>
2009-02-24Enabled new interactive prompt and updated some testsBryan Ischo1-0/+16
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>
2009-01-13Rename alpm_get_md5sum to alpm_compute_md5sum and alpm_dep_get_string to ↵Nagy Gabor5-6/+6
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>
2009-01-13HoldPkg reworkNagy Gabor5-5/+23
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>
2008-12-03Merge branch 'maint'Dan McGee3-13/+37
Conflicts: lib/libalpm/dload.c
2008-12-02Add flush after downloading messageSimo Leone1-0/+1
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>
2008-11-30Give an error message on alpm_db_register_sync() errorNagy Gabor1-12/+34
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>
2008-11-18Minor code cleanupsDan McGee1-1/+2
Mostly noticed when compiling libalpm/pacman with ICC. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-11-01-Qu reworkNagy Gabor2-25/+5
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>
2008-10-29testdb : extend the tool to allow checking sync dbs too.Xavier Chantry1-48/+126
Example usage and output : > src/util/testdb -h usage: testdb [-b <pacman db>] : check the local database testdb [-b <pacman db>] core extra ... : check the listed sync databases > src/util/testdb Checking the integrity of the local database in /var/lib/pacman/ > src/util/testdb core extra testing community Checking the integrity of the sync databases in /var/lib/pacman/ missing dependency for archboot : bcm43xx-fwcutter>=006-2 missing dependency for xvattr : xfree86 missing dependency for eclipse-ve : eclipse<3.3 missing dependency for flumotion : twisted-web missing dependency for gg2 : arts missing dependency for man-pages-cs : groff-utf8 missing dependency for qc-usb : kernel26<2.6.26 Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-13Merge branch 'maint'Dan McGee5-27/+54
2008-10-13Make interrupt handler async-safeDan McGee1-8/+22
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>
2008-10-13Reduce number of calls to getcols()Dan McGee2-8/+9
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>
2008-10-13Ensure we don't have double slashes when creating frontend pathsDan McGee1-2/+4
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>
2008-09-03Remove unnecessary initialization in new functionsDan McGee1-4/+0
We don't need to zero things out, we are already using calloc for this purpose. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-09-02Another attempt at fixing totaldownload.Xavier Chantry1-8/+16
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>
2008-08-28Separate targets on -Qi/-Si with a newline.Xavier Chantry1-1/+3
This fixes FS#11331 The newline was lost with commit 9451b2e4f23a3c566fcfe3420c379b3cb3eb1f90. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-08-27Merge branch 'maint'Dan McGee1-1/+1
2008-08-26Rename alpm_db_get{pkg,grp}cache to alpm_db_get_{pkg,grp}cacheXavier Chantry3-11/+11
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>
2008-08-26Change checkdeps and checkdbconflicts to be more flexible.Xavier Chantry1-2/+3
These two functions now take directly a package list rather than a database. checkdbconflicts was renamed to checkconflicts. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2008-08-26pacman : smarter optdepends handling.Xavier Chantry3-1/+21
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>
2008-08-26Add missing comma to -S --help messageRoman Kyrylych1-1/+1
Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-24Merge branch 'maint'Dan McGee1-2/+2
2008-08-23Fix 'None' text so we don't have to translate it twiceDan McGee1-2/+2
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>
2008-08-23Move -Sp implementation to the front-endNagy Gabor4-20/+28
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>
2008-08-23split yesno() into yesno() and noyes() functions.Xavier Chantry5-25/+47
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>
2008-08-23Cleanup of _alpm_pkg_compare_versions.Xavier Chantry1-1/+1
* 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>
2008-08-23download : disable progressbar when total is unknown.Xavier Chantry1-1/+4
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>
2008-08-23pacman : clarify help message.Xavier Chantry1-2/+3
Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23pacman: print optdepends on install and upgrade.Xavier Chantry3-0/+12
This implements FS#10630. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23Add new list_display_linebreak functionNagy Gabor3-23/+38
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>
2008-08-23Move the the description parsing logic to string_display()Nagy Gabor2-19/+30
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>
2008-08-20pacman.c: fix typo s/NoPassiveFTP/NoPassiveFtpXavier Chantry1-1/+1
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>
2008-08-14pacman/callback.c : fix detection of totaldownloadXavier Chantry1-2/+2
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>
2008-07-30Remove UseColor from front-endNagy Gabor2-4/+0
This option wasn't used. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-25Show number of packages to be installed / removed.Xavier Chantry1-2/+6
This fixes FS#7794. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-25src/pacman : rework the display_targets function.Xavier Chantry5-58/+64
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>
2008-07-23-Sqg and -QqgNagy Gabor2-3/+12
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>
2008-07-23Re-enable --debug with -Sw and -SpNagy Gabor1-1/+1
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>
2008-07-16Remove pacman.static build from build filesDan McGee2-9/+0
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>
2008-07-13src/pacman/sync.c : Display only errors with -Sp and -Sw operations.Xavier Chantry1-0/+5
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>
2008-07-13sync_addtarget reworkNagy Gabor1-36/+4
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>
2008-07-13remove_addtarget rework (in front-end)Nagy Gabor1-46/+46
Now "pacman -R foo" first searches for literal, and then for group. This is faster in most cases, see: http://www.archlinux.org/pipermail/pacman-dev/2008-July/012311.html "-R group" implementation was broken, since alpm_grp_get_pkgs returns with an pmpkg_t list, not a string list. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-08Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback functionNagy Gabor1-2/+2
PM_TRANS_CONV_INSTALL_IGNOREPKG callback function can get 2 params: foo, bar in this order (packages), bar can be NULL. Old API: foo, NULL: Do you want to install foo from IgnorePkg? foo, bar: foo requires bar from IgnorePkg. Do you want to install bar? New API: foo, bar: Do you want to install foo from IgnorePkg? (If bar!=NULL:) bar requires it. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Dan McGee <dan@archlinux.org>