changeset 1819:40c2fe006fcf

Add EXTRACT_ALL=force to populate page cache even for repositories. (Needed by control-image build).
author Rob Landley <rob@landley.net>
date Tue, 24 Nov 2015 13:07:00 -0600
parents 78bdf7e5f5b3
children e9732d0fad99
files sources/download_functions.sh
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sources/download_functions.sh	Mon Nov 23 18:47:57 2015 -0600
+++ b/sources/download_functions.sh	Tue Nov 24 13:07:00 2015 -0600
@@ -284,8 +284,17 @@
 
   # Give package name, minus file's version number and archive extension.
   BASENAME="$(noversion "$FILENAME")"
-  ! is_in_list "$BASENAME" "$IGNORE_REPOS" &&
-    [ -d "$SRCDIR/$BASENAME" ] && echo "Using $SRCDIR/$BASENAME" && return 0
+  if ! is_in_list "$BASENAME" "$IGNORE_REPOS" && [ -d "$SRCDIR/$BASENAME" ]
+  then
+    echo "Using $SRCDIR/$BASENAME"
+    if [ "$EXTRACT_ALL" == force ]
+    then
+      rm -rf "$SRCTREE/$BASENAME" &&
+      cp -a "$SRCDIR/$BASENAME" "$SRCTREE/$BASENAME" || dienow
+    fi
+
+    return 0
+  fi
 
   # If environment variable specifies a preferred mirror, try that first.