Skip to content

Commit

Permalink
bee-cache-update: cleanup cachedir if metadir does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Jul 30, 2012
1 parent 33b743f commit 45d2b8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bee-cache-update.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ function print_info()
function create_pkgbcfile()
{
local PKGALLPKG=${1}
local CONTENTFILE=${BEE_METADIR}/${PKGALLPKG}/CONTENT
local PKGMETADIR=${BEE_METADIR}/${PKGALLPKG}
local CONTENTFILE=${PKGMETADIR}/CONTENT
local PKGBCFILE=${CACHEDIR}/${PKGALLPKG}.bc
local PKGBCRFILE=${PKGBCFILE%.bc}.bcr

local tmpfile=${PKGBCFILE}.tmp.$$

if [ ! -e "${CONTENTFILE}" ] ; then
if [ ! -d "${PKGMETADIR}" ] ; then
# cleanup cache if metadir does not exist
rm -f "${PKGBCFILE}" "${PKGBCRFILE}"
elif [ ! -e "${CONTENTFILE}" ] ; then
if [ -e "${PKGBCFILE}" ] ; then
print_info "moving ${PKGBCFILE} to ${PKGBCRFILE}.."
mv "${PKGBCFILE}" "${PKGBCRFILE}"
Expand Down

0 comments on commit 45d2b8a

Please sign in to comment.