Commit Graph

72 Commits

Author SHA1 Message Date
Xavier Chantry e4be3e06af callback: use variable length for progressbar text
This fixes FS#17523

We always used a fixed value of 50 for textlen, which is often not enough
for download progress bar. At least we can use a bigger width on large
terminal (e.g. 60% of width) and keep 50 as minimum.

before:
 nautilus-2.28.4-1-x...     5.7M  789.2K/s 00:00:07 [####################################] 100%
after:
 nautilus-2.28.4-1-x86_64         5.7M  770.7K/s 00:00:08 [##############################] 100%

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:39:43 -05:00
Xavier Chantry e5dce888c0 callback.c : less magic progress bars
1 - Explain magic numbers

2 - There was a weird off by 1 mess in the progress bar. The code supposedly
shared the width between 50 chars for text (textlen) and the rest for the
progress bar (proglen = getcols() - textlen).
But the code actually used textlen + 1 for the text and proglen - 1 for the
progress bar (with haslen=1, the progress bar was actually empty), which was
a bit confusing so I changed it.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-03-14 18:39:26 -05:00
Dan McGee cf0d619670 Merge branch 'maint' 2009-10-11 12:57:57 -05:00
Xavier Chantry 44a57c890b callback.c : fallback to normal download with bogus size
When using totaldownload, we might get into some weird situations where
xfered>total because of bogus CSIZE database entries.

This code adds a sanity check and fallbacks to normal download progress if
needed.

Here is an example using totaldownload on a database with wrong CSIZE, for a
total download of ~26 MB.

Before :

 gnome-desktop-2.28....  1144,3K  678,3K/s 00:00:02 [#################]   4%
 gnome-panel-2.28.0-...     4,2M  887,7K/s 00:00:05 [#################]  16%
 gnome-applets-2.28....    13,6M 1083,0K/s 00:00:13 [#################]  52%
 gnome-backgrounds-2...    22,9M  964,0K/s 00:00:24 [#################]  87%
 gnome-settings-daem...    23,6M  938,5K/s 00:00:26 [#################]  90%
 gnome-control-cente...    26,1M  946,1K/s 00:00:28 [#################] 100%
 gnome-icon-theme-2....    27,7M 1465,0K/s 1193046:28:15 [#######----------] gnome-icon-theme-2....    28,0M 1502,2K/s 1193046:28:15 [########---------] gnome-icon-theme-2....    28,4M 1582,2K/s 1193046:28:15 [##########-------] gnome-icon-theme-2....    28,7M 1603,4K/s 1193046:28:15 [############-----] gnome-icon-theme-2....    29,0M 1604,5K/s 1193046:28:15 [##############---] gnome-icon-theme-2....    29,3M 1621,0K/s 1193046:28:14 [################-] gnome-icon-theme-2....    29,6M 1434,8K/s 1193046:28:14 [#################] gnome-icon-theme-2....    29,6M  974,2K/s 00:00:31 [#################] 113%

After :

 gnome-desktop-2.28....  1144,3K 1038,7K/s 00:00:01 [#################]   4%
 gnome-panel-2.28.0-...     4,2M  988,4K/s 00:00:04 [#################]  16%
 gnome-applets-2.28....    13,6M 1190,4K/s 00:00:12 [#################]  52%
 gnome-backgrounds-2...    22,9M 1242,9K/s 00:00:19 [#################]  87%
 gnome-settings-daem...    23,6M 1193,9K/s 00:00:20 [#################]  90%
 gnome-control-cente...     2,5M 1347,4K/s 00:00:02 [#################] 100%
 gnome-icon-theme-2....     3,5M 1205,4K/s 00:00:03 [#################] 100%

Note that gnome-control-center resetted to normal progress mode
(2,5M is the package size, not the total size)

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-10-04 09:32:02 -05:00
Nagy Gabor b7db46d610 Do not remove conflict by default
When a conflict is detected, pacman asks if the user wants to remove
the conflicting package.  In many cases this is a bad idea.  e.g.

udev conflicts with initscripts (initscripts<2009.07).
Remove initscripts [Y/n]

This changes the query to [y/N].

The --noconfirm behavior has been also changed, because it chooses the
default answer. Since the yes answer is more interesting in our pactests
dealing with conflicts, I inserted '--ask=4' to all of them with one
exception: sync042.py tests the no answer.

(I also fixed a typo in sync043.py)

Original-work-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2009-09-08 22:03:24 -05:00
Xavier Chantry 90e3e026d1 Re-add the non-user friendly --ask option
This re-implements the --ask option which was removed in commit
1ff8e7f364.

This option does not have to be exposed to the user (help,doc,etc), but is
very very useful for pactest if we want to have more coverage there.

This was rewritten in a smarter way, without code duplication. And with a
different behavior : this option is now only used to inverse default
behavior to questions.

We still use bit operations based on the following struct :
/* Transaction Conversations (ie, questions) */
typedef enum _pmtransconv_t {
        PM_TRANS_CONV_INSTALL_IGNOREPKG = 0x01,
        PM_TRANS_CONV_REPLACE_PKG = 0x02,
        PM_TRANS_CONV_CONFLICT_PKG = 0x04,
        PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
        PM_TRANS_CONV_LOCAL_NEWER = 0x10,
        PM_TRANS_CONV_REMOVE_PKGS = 0x20,
} pmtransconv_t;

for each conv matched, the default answer is inversed.

--ask 0 : all default answers are preserved
--ask 4 : only conflict question is inversed
--ask 63 : all questions are inversed (63 == 1+2+4+8+16+32)

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-09-08 22:02:08 -05:00
Nagy Gabor 12b55958d8 Add a new reason field to pmconflict_t struct
Sometimes "foo conflicts with bar" information is not enough, see this
thread: http://bbs.archlinux.org/viewtopic.php?id=77647. That's why I added
a new reason field to our pmconflict_t struct that stores the packager-
defined conflict that induced the fact that package1 conflicts with
package2.

I modified the front-end (in callback.c, sync.c, upgrade.c) to print this
new information as well.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
2009-09-08 21:58:52 -05:00
Nagy Gabor 902dfe5900 Change Y/n to y/N with REMOVE_PKGS (remove_unresolvable) callback
The main reason for this change is that scripts could not catch the removed
targets with -S --noconfirm (the return value was 0). So the effect of a
pacman command may have differed from the expected one. Moreover, for my
taste the default no answer is better (I wanted to install the specified
targets, not a subset of them).

I had to change some pactest files as well, because now the default behavior
is not to remove unresolvable targets. In fact, the only pactest file that
tested this feature was ignore005.py.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-09-08 21:54:51 -05:00
Nagy Gabor 3a6ed11428 Fix an untranslated message in src/callback.c
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-07-28 06:59:48 -05:00
Dan McGee c72b4543b6 Update copyright headers and messages
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-07-01 02:08:33 -05:00
Bryan Ischo f57f8d3386 Don't prompt the user for unignore of IgnorePkg/IgnoreGroup packages
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-23 20:37:14 -06:00
Bryan Ischo 0268550401 Enabled new interactive prompt and updated some tests
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-02-23 20:33:56 -06:00
Nagy Gabor a888f377a5 HoldPkg rework
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>
2009-01-12 22:44:00 -06:00
Dan McGee 61c6552862 Merge branch 'maint'
Conflicts:
	lib/libalpm/dload.c
2008-12-02 22:15:02 -06:00
Simo Leone 6d8a6aef09 Add flush after downloading message
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-12-02 07:39:32 -06:00
Dan McGee fa02a71abd Merge branch 'maint' 2008-10-12 21:36:45 -05:00
Xavier Chantry 242e9e90f4 Another attempt at fixing totaldownload.
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-09-02 09:38:01 -05:00
Xavier Chantry 9dbe5c9d1e pacman : smarter optdepends handling.
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-25 18:06:51 -05:00
Nagy Gabor baf5852555 Move -Sp implementation to the front-end
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-23 09:50:40 -05:00
Xavier Chantry adc4078b87 split yesno() into yesno() and noyes() functions.
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-23 09:22:34 -05:00
Xavier Chantry e760c4f478 download : disable progressbar when total is unknown.
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-23 08:38:51 -05:00
Xavier Chantry 96e023c7bd pacman: print optdepends on install and upgrade.
This implements FS#10630.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-23 08:38:25 -05:00
Xavier Chantry 89c2c51964 pacman/callback.c : fix detection of totaldownload
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-08-13 21:13:10 -05:00
Nagy Gabor 8856146d71 Swap parameters on PM_TRANS_CONV_INSTALL_IGNOREPKG callback function
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>
2008-07-07 21:12:30 -05:00
Dan McGee fe781e4ce4 Reimplement TotalDownload functionality
Add a new totaldlcb callback function to libalpm and make pacman utilize it
when the TotalDownload option is enabled. This callback function is pretty
simple- it is meant to be called once at the beginning of a "list download"
action, and once at the end (with value 0 to indicate the list has been
finished). The frontend is responsible for keeping track of adding
individual file download amounts to the total xfered amount in order to
display some sort of overall progress.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 15:38:53 -05:00
Dan McGee 0669c9bfac Use correct C type for file sizes
We have been using unsigned long as a file size type for a while, which
works but isn't quite correct and could easily break. Worse was probably our
use of int in the download callback functions, which could be restrictive
for packages > 2GB in size.

Switch all file size variables to use off_t, which is the preferred type for
file sizes. Note that at least on Linux, all applications compiled against
libalpm must now be sure to use large file support, where _FILE_OFFSET_BITS
is defined to be 64 or there will be some weird issues that crop up.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-04 15:38:47 -05:00
Xavier Chantry 1cca4ef764 Remove PM_TRANS_EVT_EXTRACT_START.
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-29 06:37:21 -05:00
Dan McGee 83c4b2aebb Merge branch 'maint' 2008-04-07 19:19:34 -05:00
Dan McGee bec2ba5b40 Add check for swprintf() and a workaround when it is missing
We use this function once in our codebase, but fortunately the workaround is
relatively easy. swprintf() is not available on Cygwin so the compile failed
there, but we can do a series of mbstowcs() calls that produce the same end
result as the swprintf() call.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-04-07 19:09:46 -05:00
Dan McGee c2dbbd60bc Start removing some junk from the function template
I screwed up originally when I accepted the TotalDownload patch,
8ec27835f4. I didn't realize how deeply it
modified libalpm and I probably shouldn't have let it do what it did. This
commit reverts much of what that patch added in order to clean up our
internal function calls. We can find another way to do it right down the
road here but for now it has to go.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-27 18:58:24 -06:00
Chantry Xavier 143135e666 Improve yesno function.
Add a preset paramater to yesno function saying which answer should be the
default. Ref:
http://www.archlinux.org/pipermail/pacman-dev/2007-June/008470.html

This allows us to answer no by default to some questions, like the -Scc one
mentioned in the above thread, and implemented by this patch.

Another advantage is that we don't have to repeat the [Y/n] in every
questions. It's only put once in yesno function. This highly reduces the
chances that YES and NO strings are translated, but not some questions,
which lead to obvious confusions.

Finally, the noconfirm variable only needs to be used in that yesno
function. So all other usages of it were removed.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-02-24 18:17:49 -06:00
Dan McGee 3ad3077d8d Merge branch 'maint'
Conflicts:

	src/pacman/callback.c
2008-02-24 01:22:07 -06:00
Dan McGee 96f7613d15 Add some NULL checks into recently modified output functions
After a merge with master where some strings we print (such as descriptions)
could be NULL, a few segfaults popped up due to strlen() calls on null
pointers. Fix this by doing some preemptive checks and returning from
functions early if the string was null.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 01:17:17 -06:00
Dan McGee 3a6f62d4c7 Remove all unnecessary snprintf usage
Both alpm_logaction() and yesno() are vararg functions, so we might as well
use this functionality and take advantage of it. Remove all of the
snprintf() calls and the LOG_STR_LEN constant that never seemed quite right.

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-24 00:54:11 -06:00
Dan McGee a6470956bc Fix wide character output for add/remove/upgrade/conflict progress
Due to the addition of the Chinese translation, our column widths were all
messed up as mentioned in the download progress commit fixing this same
problem there. This is a port of the code and ideas from that fix to the
installation progress bars. Once again, a handful of examples were tested to
ensure we work in all locales and with varying byte and char widths.

English (before & after):
(1/1) checking for file conflicts                   [-----------------] 100%
(1/1) upgrading man-pages                           [-----------------] 100%

German (before & after):
(1/1) Prüfe auf Dateikonflikte                      [-----------------] 100%
(1/1) Aktualisiere man-pages                        [-----------------] 100%

Chinese (before):
(1/1) 正在检查文件冲突                                      [-----------------] 100%
(1/1) 生在升级 man-pages                                [c  o  o  o  o  o ] (1/1) 生在升级 man-pages                                [----------C o  o ] (1/1) 生在升级 man-pages                                [-----------------] 100%

Chinese (after):
(1/1) 正在检查文件冲突                              [-----------------] 100%
(1/1) 生在升级 man-pages                            [-----------------] 100%

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-22 22:00:15 -06:00
Dan McGee 29f55fb7c9 Fix wide character output for download progress
Now that we have a Chinese translation, all of the problems with new
character sets crop up. Assumptions were made in the past that all
characters occupied one column, which is not true with a Chinese character
set. In addition, the download code even failed on such things as 'ö', which
is two bytes wide but only 1 column.

This code will need to also be ported to the add/remove/upgrade/conflicts
progress printouts.

Note that the tests below try to incorporate a number of things:
1. download filenames too long to fit
2. download filenames cut off in the middle of a multibyte sequence
3. download filenames incorporating multicolumn chars
4. download filenames incorporating multibyte, single-column chars
5. 'plain' download filenames that have always worked

Before:
:: 正在同步软件包数据库……
 正在解决倚赖��...    0.0K  199.8K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系junköëjunköëjunköëäää (未预计的系统错误)
 正在解决倚赖��...    0.0K  308.4K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系 (未预计的系统错误)
 junköëä                 0.0K  390.6K/s 00:00:00 [-----------------] 100%
错误:无法升级junköëä (未预计的系统错误)
 pacman-git                 0.5K    4.3M/s 00:00:00 [-----------------] 100%
本地数据库已是最新的

After:
:: 正在同步软件包数据库……
 正在解决倚赖关系jun...     0.0K   89.7K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系junköëjunköëjunköëäää (未预计的系统错误)
 正在解决倚赖关系           0.0K  147.7K/s 00:00:00 [-----------------] 100%
错误:无法升级正在解决倚赖关系 (未预计的系统错误)
 junköëä                    0.0K  156.9K/s 00:00:00 [-----------------] 100%
错误:无法升级junköëä (未预计的系统错误)
 pacman-git                 0.5K 1515.9K/s 00:00:00 [-----------------] 100%
本地数据库已是最新的

Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-22 21:59:11 -06:00
Chantry Xavier 2374c81e55 Fix conflict progress bar with UTF-8 chars
This fixes FS#6437. Dan already explained the problem in that bug report.

Instead of letting printf deal with the length of utf8 strings, we can
handle it more explicitly in the case of conflict progress bar, just like we
do for add/remove progress bars. We compute the remaining space left for
displaying the pkgname in case of add/remove, and an empty string in case of
conflict.

Before :
(1/1) Prüfe auf Dateikonflikte                 [###################] 100%
(1/1) Aktualisiere rxvt-unicode                 [###################] 100%
After :
(1/1) Prüfe auf Dateikonflikte                  [###################] 100%
(1/1) Aktualisiere rxvt-unicode                 [###################] 100%

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-17 20:41:23 -06:00
Chantry Xavier bba62655fe two string fixes.
* added a newline to a conflict message in add.c
* removed the trailing dot in a replace message in callback.c.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2008-01-20 14:30:33 -06:00
Allan McRae 47e8dd0670 Notify of package replacements when using noconfirm
Fixes FS#5179.  Prints a notification of package replacements
when updating the packages using the --noconfirm flag.

Signed-off-by: Allan McRae <mcrae_allan@hotmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-13 12:21:36 -06:00
Dan McGee 9781d0d637 Update GNU GPL boilerplate and copyright dates
Update the GPL boilerplate to direct people to the GNU website for a copy of
the license, as well as bump all of Judd's copyrights to 2007.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-10 22:55:39 -06:00
Chantry Xavier b6acb30aae src/pacman/: use the FREELIST macro when possible.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-08 21:56:40 -06:00
Chantry Xavier 72dae72691 Delay output during progress bar
This fixes the output issue related to the progress bar by delaying the
output. We can decide later (post-release) if we like this method or we want
to switch to something else.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: just some minor cleanups]
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-03 18:43:12 -06:00
Dan McGee 3017b71cb5 Remove "done" messages from frontend callback function
This should simplify our output a bit when it comes to determining whether
or not we need a newline in our output. A "done" message was almost always
immediately followed by another start message anyway (or some other output),
so it really isn't necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 13:48:49 -06:00
Chantry Xavier 250331a636 Add new --needed option for -S.
During a pacman operation such as a group install, pacman can ask several
questions such as "local version is up to date. Upgrade anyway?". They are
usually all answered either by yes or by no:
* yes when you want to reinstall all the targets.
* no when you only want to install the missing ones (either because you are
installing a group, or because you are copying a pacman -S line from wiki or
whatever).

So instead of asking this question for each target, it is now now configured
with a flag.  Yes will be the default -S behavior, No will be achieved with
the --needed flag.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-02 11:14:13 -06:00
Dan McGee 2322909703 War on whitespace
Run the kernel's cleanfile script on all of our source files.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-16 20:18:45 -06:00
Nathan Jones 8ec27835f4 Implement TotalDownload option.
Setting this option will change the download progress to show the amount
downloaded, download rate, ETA, and download percent of the entire
download list rather than per each individual file.

The progress bar is still based on the completion of the current file
regardless if the TotalDownload option is set.

This closes FS#7205.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11 09:46:13 -06:00
Nathan Jones 3312de65e6 Implement IgnoreGroup.
This option acts as if IgnorePkg was set on each package in the group.

This closes FS#1592.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-11 09:44:30 -06:00
Dan McGee 7d51882dd0 Simplify callback DONE event handling
Move them all to a single fallthrough case statement since they all print
"done".

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-08 23:41:05 -06:00
Chantry Xavier 0686fec839 Remove the newline automatically added by alpm_logaction.
This way, _alpm_logaction behaves like _alpm_log, and gives more control.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
2007-11-04 18:04:43 -06:00
Dan McGee 86ca39d15e Clean up usage of extern variables
Instead of declaring the extern variable in every *.c file, include it in
the header file that makes sense. This means handle.h for the handle, and
conf.h for the pacman side config object.

Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-04 12:05:22 -06:00