fetch: tweak space msg for bug #386797
authorZac Medico <zmedico@gentoo.org>
Tue, 11 Oct 2011 17:27:44 +0000 (10:27 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 11 Oct 2011 17:27:44 +0000 (10:27 -0700)
pym/portage/package/ebuild/fetch.py

index 9f66148379eeb36d1f746ccb04c3ffee6eb0f7d2..43597ac7d9292618f758bd248a44da6e3fbf66a3 100644 (file)
@@ -612,18 +612,6 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
                                        elif userfetch:
                                                has_space = False
 
-                       if not has_space:
-                               writemsg(_("!!! Insufficient space to store %s in %s\n") % \
-                                       (myfile, mysettings["DISTDIR"]), noiselevel=-1)
-
-                               if has_space_superuser:
-                                       writemsg(_("!!! Insufficient privileges to use "
-                                               "remaining space.\n"), noiselevel=-1)
-                                       if userfetch:
-                                               writemsg(_("!!! You may set FEATURES=\"-userfetch\""
-                                                       " in /etc/make.conf in order to fetch with\n"
-                                                       "!!! superuser privileges.\n"), noiselevel=-1)
-
                        if distdir_writable and use_locks:
 
                                lock_kwargs = {}
@@ -727,6 +715,20 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
                                                os.symlink(readonly_file, myfile_path)
                                                continue
 
+                               # this message is shown only after we know that
+                               # the file is not already fetched
+                               if not has_space:
+                                       writemsg(_("!!! Insufficient space to store %s in %s\n") % \
+                                               (myfile, mysettings["DISTDIR"]), noiselevel=-1)
+
+                                       if has_space_superuser:
+                                               writemsg(_("!!! Insufficient privileges to use "
+                                                       "remaining space.\n"), noiselevel=-1)
+                                               if userfetch:
+                                                       writemsg(_("!!! You may set FEATURES=\"-userfetch\""
+                                                               " in /etc/make.conf in order to fetch with\n"
+                                                               "!!! superuser privileges.\n"), noiselevel=-1)
+
                                if fsmirrors and not os.path.exists(myfile_path) and has_space:
                                        for mydir in fsmirrors:
                                                mirror_file = os.path.join(mydir, myfile)