summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pacman2pacman-get27
1 files changed, 27 insertions, 0 deletions
diff --git a/pacman2pacman-get b/pacman2pacman-get
index c1e93d1..0e31aa0 100644
--- a/pacman2pacman-get
+++ b/pacman2pacman-get
@@ -179,6 +179,8 @@ else
# meter how we want it, to make it consistent with the progress
# bar when we download stuff with transmission.
+ mod_time=$(stat -c %Y "/srv/pacman2pacman/dbcache/${filename##*/}" 2>/dev/null)
+
progress='0%'
echo -n "Pacman2pacman http download: ${pname}: ${progress}"
@@ -223,6 +225,31 @@ else
fi
}
+ # What was the result of the download?
+ if (( dbfile ))
+ then
+ # If we fail to stat it that means it doesn't exist so the
+ # download failed.
+ if ! new_mod_time=$(stat -c %Y "/srv/pacman2pacman/dbcache/${filename##*/}" 2>/dev/null)
+ then
+ progress='failed'
+ printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}"
+
+ # If the file was not modified we display such
+ elif [[ "${new_mod_time}" == "${mod_time}" ]]
+ then
+ progress='file not modified'
+ printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}"
+ fi
+ else
+ # It's not a dbfile. Just check the output file exists.
+ if ! [[ -f "${filename}" ]]
+ then
+ progress='failed'
+ printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}"
+ fi
+ fi
+
echo
if (( dbfile )) && [[ -f "/srv/pacman2pacman/dbcache/${filename##*/}" ]]