diff options
| -rwxr-xr-x | functions/cache.sh | 5 | ||||
| -rwxr-xr-x | functions/exit.sh | 8 | 
2 files changed, 13 insertions, 0 deletions
| diff --git a/functions/cache.sh b/functions/cache.sh index bae606dd2..72e6d5d15 100755 --- a/functions/cache.sh +++ b/functions/cache.sh @@ -25,6 +25,9 @@ Restore_cache ()  				# without hardlinks  				cp "${DIRECTORY}"/*.deb chroot/var/cache/apt/archives  			fi + +			mkdir -p .stage +			touch .stage/cache_$(echo ${DIRECTORY} | sed -e 's|/|_|g')  		fi  	fi  } @@ -58,4 +61,6 @@ Save_cache ()  		# Purging current cache  		rm -f chroot/var/cache/apt/archives/*.deb  	fi + +	rm -f .stage/cache_$(echo ${DIRECTORY} | sed -e 's|/|_|g')  } diff --git a/functions/exit.sh b/functions/exit.sh index 5fa1fa86f..575da9b5a 100755 --- a/functions/exit.sh +++ b/functions/exit.sh @@ -35,6 +35,14 @@ Exit ()  		done  	fi +	# Saving package cache +	if ls .stage/cache_* > /dev/null 2>&1 +	then +		_CACHE="$(basename .stage/cache_* | sed -e 's|cache_||' -e 's|_|/|g')" + +		Save_cache ${_CACHE} +	fi +  	return ${VALUE}  } | 
