On Fri, Aug 28, 2009 at 12:31 AM, Laszlo Papp<djszapi2@gmail.com> wrote:
Signed-off-by: Laszlo Papp <djszapi2@gmail.com> --- src/pacman/pacman.c | 2 +- src/pacman/sync.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 25647b5..00b14f5 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -485,7 +485,7 @@ static int parseargs(int argc, char *argv[]) case 'o': config->op_q_owns = 1; break; case 'p': config->op_q_isfile = 1; - config->op_s_printuris = 1; + config->op_s_printuris++; config->flags |= PM_TRANS_FLAG_NOCONFLICTS; config->flags |= PM_TRANS_FLAG_NOLOCK; break; diff --git a/src/pacman/sync.c b/src/pacman/sync.c index dc93621..b4e2eac 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -678,6 +678,9 @@ static int sync_trans(alpm_list_t *targets) pmpkg_t *pkg = alpm_list_getdata(i); pmdb_t *db = alpm_pkg_get_db(pkg); const char *dburl = alpm_db_get_url(db); + if ((config->op_s_printuris >= 2) && !alpm_pkg_download_size(pkg)) { + continue; + } if(dburl) { printf("%s/%s\n", dburl, alpm_pkg_get_filename(pkg)); } else { -- 1.6.4.1
I wonder if we could generalize this to my --print patch : http://code.toofishes.net/cgit/xavier/pacman.git/commit/?h=working&id=c225948b5ba70993277faa4dff4f312459af7965 it might make sense to make this possible for both --print and --print-uris operation, but then the command line becomes difficult :(