Fixed errors in packages/deb and mirror/ubuntu

1) unconditional rebuilding due to
never existent file

repocleanup.done used to depend on PHONY target (sources)
which led to unconditional rebuilding.
This didn't influence ISO builds because CI always cleans
environment.

2) fail when try to rebuild second
time without cleaning environment

repo.done used to consume some config files
created by reprepro.done target. After consuming those files
it used to remove them not touching reprepro.done itself.
Without cleaning build environment this fails the build process.

Change-Id: Ib0de2e5ea94caeb7f93f5bc8d0f06a6f806e3ca6
Closes-Bug: #1448206
This commit is contained in:
Vladimir Kozhukalov 2015-04-24 19:22:48 +03:00
parent d4b50b2408
commit f3d5199656
2 changed files with 23 additions and 18 deletions

View File

@ -34,38 +34,43 @@ ifneq ($(BUILD_PACKAGES),0)
$(BUILD_DIR)/mirror/ubuntu/build.done: $(BUILD_DIR)/mirror/ubuntu/repo.done $(BUILD_DIR)/mirror/ubuntu/build.done: $(BUILD_DIR)/mirror/ubuntu/repo.done
endif endif
REPREPRO_CONF_DIR:=$(BUILD_DIR)/mirror/ubuntu/reprepro/conf
define config_reprepro define config_reprepro
#Generate reprepro distributions config #Generate reprepro distributions config
cat > $(LOCAL_MIRROR_UBUNTU)/conf/distributions << EOF cat > $(REPREPRO_CONF_DIR)/distributions << EOF
$(reprepro_dist_conf) $(reprepro_dist_conf)
EOF EOF
#Generate reprepro updates config #Generate reprepro updates config
cat > $(LOCAL_MIRROR_UBUNTU)/conf/updates << EOF cat > $(REPREPRO_CONF_DIR)/updates << EOF
$(reprepro_updates_conf) $(reprepro_updates_conf)
EOF EOF
endef endef
$(BUILD_DIR)/mirror/ubuntu/reprepro_config.done: export config_reprepro:=$(config_reprepro)
$(BUILD_DIR)/mirror/ubuntu/reprepro.done: export config_reprepro:=$(config_reprepro) $(BUILD_DIR)/mirror/ubuntu/reprepro_config.done:
$(BUILD_DIR)/mirror/ubuntu/reprepro.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done mkdir -p $(REPREPRO_CONF_DIR)
mkdir -p $(LOCAL_MIRROR_UBUNTU)/conf
sh -c "$${config_reprepro}" sh -c "$${config_reprepro}"
#Import existing Ubuntu repository
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(LOCAL_MIRROR_UBUNTU)/conf -V update
$(ACTION.TOUCH) $(ACTION.TOUCH)
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done \ $(BUILD_DIR)/mirror/ubuntu/reprepro.done: \
$(BUILD_DIR)/mirror/ubuntu/reprepro.done $(BUILD_DIR)/mirror/ubuntu/mirror.done \
#FIXME(aglarendil): do not touch upstream repo. instead - build new repo $(BUILD_DIR)/mirror/ubuntu/reprepro_config.done
#Import newly built packages # Import existing Ubuntu repository
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(LOCAL_MIRROR_UBUNTU)/conf -V includedeb $(PRODUCT_NAME)$(PRODUCT_VERSION) $(BUILD_DIR)/packages/deb/packages/*.deb cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(REPREPRO_CONF_DIR) -V update
#Clean up reprepro data $(ACTION.TOUCH)
$(BUILD_DIR)/mirror/ubuntu/repo.done: \
$(BUILD_DIR)/mirror/ubuntu/reprepro_config.done \
$(BUILD_DIR)/mirror/ubuntu/reprepro.done
# FIXME(aglarendil): do not touch upstream repo. instead - build new repo
# Import newly built packages
cd $(LOCAL_MIRROR_UBUNTU) && reprepro --confdir=$(REPREPRO_CONF_DIR) -V includedeb $(PRODUCT_NAME)$(PRODUCT_VERSION) $(BUILD_DIR)/packages/deb/packages/*.deb
# Clean up reprepro data
rm -rf $(LOCAL_MIRROR_UBUNTU)/db rm -rf $(LOCAL_MIRROR_UBUNTU)/db
rm -rf $(LOCAL_MIRROR_UBUNTU)/lists rm -rf $(LOCAL_MIRROR_UBUNTU)/lists
rm -rf $(LOCAL_MIRROR_UBUNTU)/conf
$(ACTION.TOUCH) $(ACTION.TOUCH)
$(BUILD_DIR)/mirror/ubuntu/mirror.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done:
mkdir -p $(LOCAL_MIRROR_UBUNTU) mkdir -p $(LOCAL_MIRROR_UBUNTU)
ifeq (none,$(strip $(USE_MIRROR))) ifeq (none,$(strip $(USE_MIRROR)))

View File

@ -56,12 +56,12 @@ define remove_deb
mkdir -p $(BUILD_DIR)/packages/deb mkdir -p $(BUILD_DIR)/packages/deb
perl $(SOURCE_DIR)/packages/deb/genpkgnames.pl $(BUILD_DIR)/repos/$1/debian/control > $(BUILD_DIR)/packages/deb/$1.cleanup.list perl $(SOURCE_DIR)/packages/deb/genpkgnames.pl $(BUILD_DIR)/repos/$1/debian/control > $(BUILD_DIR)/packages/deb/$1.cleanup.list
cd $(LOCAL_MIRROR_UBUNTU) && cat $(BUILD_DIR)/packages/deb/$1.cleanup.list | \ cd $(LOCAL_MIRROR_UBUNTU) && cat $(BUILD_DIR)/packages/deb/$1.cleanup.list | \
xargs -n1 -I{} reprepro --confdir=$(LOCAL_MIRROR_UBUNTU)/conf remove $(PRODUCT_NAME)$(PRODUCT_VERSION) {} $(NEWLINE) xargs -n1 -I{} reprepro --confdir=$(REPREPRO_CONF_DIR) remove $(PRODUCT_NAME)$(PRODUCT_VERSION) {} $(NEWLINE)
endef endef
$(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/packages/deb/repocleanup.done $(BUILD_DIR)/mirror/ubuntu/repo.done: $(BUILD_DIR)/packages/deb/repocleanup.done
$(BUILD_DIR)/packages/deb/repocleanup.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done $(BUILD_DIR)/packages/deb/repocleanup.done: $(BUILD_DIR)/mirror/ubuntu/mirror.done
$(BUILD_DIR)/packages/deb/repocleanup.done: sources $(BUILD_DIR)/packages/deb/repocleanup.done: $(packages_list:%=$(BUILD_DIR)/packages/source_%.done)
$(foreach pkg,$(fuel_debian_packages),$(call remove_deb,$(pkg))) $(foreach pkg,$(fuel_debian_packages),$(call remove_deb,$(pkg)))
$(ACTION.TOUCH) $(ACTION.TOUCH)