FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 07-16-2008, 12:53 PM
Nagy Gabor
 
Default -Sqg and -Qqg

>From cc336eb3e44038fa1f7416d3dc79fc6dbe9e0004 Mon Sep 17 00:00:00 2001
From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Date: Wed, 16 Jul 2008 14:42:25 +0200
Subject: [PATCH] -Sqg and -Qqg

With --quiet, "pacman -Sg grp" and "pacman -Qg grp" don't list group names.
"pacman -Qgq" and "pacman -Sggq" (without targets) still list group names.

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
---
src/pacman/query.c | 7 ++++++-
src/pacman/sync.c | 8 ++++++--
2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/pacman/query.c b/src/pacman/query.c
index 74d3ff2..bd2d8c5 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -235,7 +235,12 @@ static int query_group(alpm_list_t *targets)
if(grp) {
const alpm_list_t *p, *packages = alpm_grp_get_pkgs(grp);
for(p = packages; p; p = alpm_list_next(p)) {
- printf("%s %s
", grpname, alpm_pkg_get_name(alpm_list_getdata(p)));
+ if(!config->quiet) {
+ printf("%s %s
", grpname,
+ alpm_pkg_get_name(alpm_list_getdata(p)));
+ } else {
+ printf("%s
", alpm_pkg_get_name(alpm_list_getdata(p)));
+ }
}
} else {
pm_fprintf(stderr, PM_LOG_ERROR, _("group "%s" was not found
"), grpname);
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 1e2af45..b299463 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -357,8 +357,12 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
if(grp) {
/* get names of packages in group */
for(k = alpm_grp_get_pkgs(grp); k; k = alpm_list_next(k)) {
- printf("%s %s
", grpname,
- alpm_pkg_get_name(alpm_list_getdata(k)));
+ if(!config->quiet) {
+ printf("%s %s
", grpname,
+ alpm_pkg_get_name(alpm_list_getdata(k)));
+ } else {
+ printf("%s
", alpm_pkg_get_name(alpm_list_getdata(k)));
+ }
}
}
}
--
1.5.6.2


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-18-2008, 01:22 AM
"Dan McGee"
 
Default -Sqg and -Qqg

On Wed, Jul 16, 2008 at 7:53 AM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
> >From cc336eb3e44038fa1f7416d3dc79fc6dbe9e0004 Mon Sep 17 00:00:00 2001
> From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
> Date: Wed, 16 Jul 2008 14:42:25 +0200
> Subject: [PATCH] -Sqg and -Qqg
>
> With --quiet, "pacman -Sg grp" and "pacman -Qg grp" don't list group names.
> "pacman -Qgq" and "pacman -Sggq" (without targets) still list group names.
The patch looks fine, but this commit message confuses me. The second
sentence should list commands without the -q option, right?

>
> Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
> ---
> src/pacman/query.c | 7 ++++++-
> src/pacman/sync.c | 8 ++++++--
> 2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/pacman/query.c b/src/pacman/query.c
> index 74d3ff2..bd2d8c5 100644
> --- a/src/pacman/query.c
> +++ b/src/pacman/query.c
> @@ -235,7 +235,12 @@ static int query_group(alpm_list_t *targets)
> if(grp) {
> const alpm_list_t *p, *packages = alpm_grp_get_pkgs(grp);
> for(p = packages; p; p = alpm_list_next(p)) {
> - printf("%s %s
", grpname, alpm_pkg_get_name(alpm_list_getdata(p)));
> + if(!config->quiet) {
> + printf("%s %s
", grpname,
> + alpm_pkg_get_name(alpm_list_getdata(p)));
> + } else {
> + printf("%s
", alpm_pkg_get_name(alpm_list_getdata(p)));
> + }
> }
> } else {
> pm_fprintf(stderr, PM_LOG_ERROR, _("group "%s" was not found
"), grpname);
> diff --git a/src/pacman/sync.c b/src/pacman/sync.c
> index 1e2af45..b299463 100644
> --- a/src/pacman/sync.c
> +++ b/src/pacman/sync.c
> @@ -357,8 +357,12 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets)
> if(grp) {
> /* get names of packages in group */
> for(k = alpm_grp_get_pkgs(grp); k; k = alpm_list_next(k)) {
> - printf("%s %s
", grpname,
> - alpm_pkg_get_name(alpm_list_getdata(k)));
> + if(!config->quiet) {
> + printf("%s %s
", grpname,
> + alpm_pkg_get_name(alpm_list_getdata(k)));
> + } else {
> + printf("%s
", alpm_pkg_get_name(alpm_list_getdata(k)));
> + }
> }
> }
> }
> --
> 1.5.6.2
>
>
> _______________________________________________
> pacman-dev mailing list
> pacman-dev@archlinux.org
> http://archlinux.org/mailman/listinfo/pacman-dev
>

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-18-2008, 06:32 AM
Xavier
 
Default -Sqg and -Qqg

Dan McGee wrote:
> On Wed, Jul 16, 2008 at 7:53 AM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
>> >From cc336eb3e44038fa1f7416d3dc79fc6dbe9e0004 Mon Sep 17 00:00:00 2001
>> From: Nagy Gabor <ngaba@bibl.u-szeged.hu>
>> Date: Wed, 16 Jul 2008 14:42:25 +0200
>> Subject: [PATCH] -Sqg and -Qqg
>>
>> With --quiet, "pacman -Sg grp" and "pacman -Qg grp" don't list group names.
>> "pacman -Qgq" and "pacman -Sggq" (without targets) still list group names.
>
> The patch looks fine, but this commit message confuses me. The second
> sentence should list commands without the -q option, right?
>

What that means is that, with or without -q, pacman -Qg amd pacman -Sgg
(without targets) still behave the same, by listing group names.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 07-18-2008, 09:57 AM
Nagy Gabor
 
Default -Sqg and -Qqg

> > The patch looks fine, but this commit message confuses me. The
> > second sentence should list commands without the -q option, right?
> >
>
> What that means is that, with or without -q, pacman -Qg amd pacman
> -Sgg (without targets) still behave the same, by listing group names.
>

Yes. IMHO nobody wants to use "pacman -Sqgg" or "pacman -Qqg" to list
packages contained in *some* group. Basically these commands list groups
(with members), not _members of a group_ like "pacman -Sg group".

I agree that this may be not coherent, but imho groupname filtering in
these cases is pointless. So in commit message I should have said that
-q has no effect when no target is specified. If you need this
filtering there too, I can resubmit the patch.

Bye

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 11:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org