$(BUILD_DIR)/mirror/centos/mos-download.done: $(BUILD_DIR)/mirror/centos/yum-config.done
	mkdir -p $(@D)
	mkdir -p $(LOCAL_MIRROR_MOS_CENTOS)
	set -ex ; reposync --norepopath --downloadcomps --plugins --delete --arch=$(CENTOS_ARCH) \
	    -c $(BUILD_DIR)/mirror/centos/etc/yum.conf --repoid=fuel -p $(LOCAL_MIRROR_MOS_CENTOS)
	$(ACTION.TOUCH)

$(BUILD_DIR)/mirror/centos/mos-repo.done: $(BUILD_DIR)/mirror/centos/mos-download.done
	createrepo -g $(LOCAL_MIRROR_MOS_CENTOS)/comps.xml \
	    -o $(LOCAL_MIRROR_MOS_CENTOS)/ $(LOCAL_MIRROR_MOS_CENTOS)/
	$(ACTION.TOUCH)


mos_centos_empty_installroot:=$(BUILD_DIR)/mirror/centos/dummy_mos_installroot

$(BUILD_DIR)/mirror/centos/mos-download.done: $(BUILD_DIR)/mirror/centos/yum-config.done
	mkdir -p $(@D)
	mkdir -p $(LOCAL_MIRROR_MOS_CENTOS)
	mkdir -p "$(mos_centos_empty_installroot)/cache"
	set -ex ; env TMPDIR="$(mos_centos_empty_installroot)/cache" \
	TMP="$(mos_centos_empty_installroot)/cache" \
	reposync --norepopath --downloadcomps --plugins --delete --arch=$(CENTOS_ARCH) \
	    -c $(BUILD_DIR)/mirror/centos/etc/yum.conf --repoid=fuel -p $(LOCAL_MIRROR_MOS_CENTOS)
	$(ACTION.TOUCH)

$(BUILD_DIR)/mirror/centos/mos-repo.done: $(BUILD_DIR)/mirror/centos/mos-download.done
	createrepo -g $(LOCAL_MIRROR_MOS_CENTOS)/comps.xml \
	    -o $(LOCAL_MIRROR_MOS_CENTOS)/ $(LOCAL_MIRROR_MOS_CENTOS)/
	$(ACTION.TOUCH)


Use temporary yum cache dir during MOS repo sync
Use temporary yum cache dir during MOS repo sync

During an ISO build, the MOS repository is synced by using reposync
utility. This utility should store cached metadata in a local temporary
directory, in order to prevent issues with stale yum cache.

Change-Id: I92573191f6c9b4d4a17b14890d0ab88ceb0a75c0
Closes-Bug: #1529073
