I tried to modify as Gabor advised, if any problem exists now too,
  please write a feedback.


Signed-off-by: Laszlo Papp <[email protected]>
---
 doc/pacman.8.txt    |    6 ++++--
 src/pacman/pacman.c |    4 ++--
 src/pacman/sync.c   |    3 +++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index b288a59..961b9d5 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -305,8 +305,10 @@ linkman:pacman.conf[5].

 *-p, \--print-uris*::
        Print out URIs for each package that will be installed, including any
-       dependencies yet to be installed. These can be piped to a file and
-       downloaded at a later time, using a program like wget.
+       dependencies yet to be installed, excluding which are in the cachedir.
+       These can be piped to a file and downloaded at a later time, using a
+       program like wget. Passing two '\--print-uris' or '-p' flags will
+       force a print-uris of all package lists even if they are in the 
cachedir.

 *-q, \--quiet*::
        Show less information for certain sync operations. (This is useful when
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 25647b5..1a49303 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -128,7 +128,7 @@ static void usage(int op, const char * const myname)
                        printf(_("  -g, --groups         view all members of a 
package group\n"));
                        printf(_("  -i, --info           view package 
information\n"));
                        printf(_("  -l, --list <repo>    view a list of 
packages in a repo\n"));
-                       printf(_("  -p, --print-uris     print out URIs for 
given packages and their dependencies\n"));
+                       printf(_("  -p, --print-uris     print URIs for 
packages and their dependencies(-pp for all)\n"));
                        printf(_("  -s, --search <regex> search remote 
repositories for matching strings\n"));
                        printf(_("  -u, --sysupgrade     upgrade all outdated 
packages (-uu enables downgrade)\n"));
                        printf(_("  -w, --downloadonly   download packages but 
do not install/upgrade anything\n"));
@@ -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..90f5bb8 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 == 1) && 
!alpm_pkg_download_size(pkg)) {
+                               continue;
+                       }
                        if(dburl) {
                                printf("%s/%s\n", dburl, 
alpm_pkg_get_filename(pkg));
                        } else {
--
1.6.4.1


Reply via email to