Commit e7d0f039 authored by Anton Midyukov's avatar Anton Midyukov

Set variable BRANCH, if not defined or empty; show $BRANCH

So much clearer and easier. Thanks glebfm@ for the idea.
parent 41b06533
......@@ -2,6 +2,16 @@
# iterate over multiple goals/arches,
# collect proceedings
ifndef BRANCH
BRANCH := $(shell rpm --eval %_priority_distbranch)
export BRANCH
endif
ifeq (,$(BRANCH))
override BRANCH=sisyphus
MAKEOVERRIDES += BRANCH=sisyphus
endif
# preferences
-include $(HOME)/.mkimage/profiles.mk
......@@ -51,6 +61,7 @@ SHELL = /bin/bash
else \
say "** goal: $@"; \
fi; \
say "** BRANCH: $(BRANCH)"; \
for ARCH in $(ARCHES); do \
if [ -z "$(QUIET)" ]; then \
if [ "$$ARCH" != "$(firstword $(ARCHES))" ]; then \
......
......@@ -46,7 +46,7 @@ mixin/regular-x11: use/luks use/volumes/regular \
@$(call add,THE_PACKAGES,btrfs-progs)
@$(call add,THE_PACKAGES,gpm)
@$(call add,DEFAULT_SERVICES_DISABLE,gpm powertop)
ifneq (,$(BRANCH))
ifneq (sisyphus,$(BRANCH))
@$(call set,FX_FLAVOUR,-esr)
endif
......
......@@ -8,7 +8,7 @@ distro/.regular-bare: distro/.base use/kernel/net use/docs/license \
use/stage2/rtc use/stage2/sbc use/stage2/scsi use/stage2/usb \
use/tty
@$(call try,SAVE_PROFILE,yes)
ifeq (,$(BRANCH))
ifeq (sisyphus,$(BRANCH))
ifeq (,$(filter-out i586 x86_64,$(ARCH)))
@$(call set,BOOTLOADER,grubpcboot)
endif
......@@ -30,7 +30,7 @@ distro/.regular-x11: distro/.regular-base mixin/regular-x11 \
@$(call add,DEFAULT_SERVICES_DISABLE,gpm powertop)
# Network install
ifeq (,$(BRANCH))
ifeq (sisyphus,$(BRANCH))
ifeq (,$(filter-out i586 x86_64 aarch64,$(ARCH)))
distro/regular-net-install: distro/grub-net-install
@$(call set,BOOTCHAIN_OEM_SRV_NETINST,nightly.altlinux.org)
......@@ -165,7 +165,7 @@ distro/regular-gnustep-systemd: distro/.regular-wm +systemd \
distro/regular-xfce: distro/.regular-gtk mixin/regular-xfce; @:
ifeq (,$(filter-out i586 x86_64 aarch64,$(ARCH)))
ifeq (,$(BRANCH))
ifeq (sisyphus,$(BRANCH))
@$(call set,KFLAVOURS,std-def un-def)
else
@$(call set,KFLAVOURS,un-def)
......
=== Переменная BRANCH ===
Переменная make, указывающая для какого бранча производится сборка.
Если не указана, сборка осуществляется для Сизифа.
Если не задана, определяется автоматически.
Если переменная имеет пустое значение, назначается sisyphus.
Для того, чтобы при указании этой переменной сборка осуществлялась для
целевого бранча, требуется:
* прописать в ~/.mkimage/profiles.mk:
--------------------------------------
ifneq (,$(BRANCH))
APTCONF = ~/apt/apt.conf.$(BRANCH).$(ARCH)
else
APTCONF = ~/apt/apt.conf.sisyphus.$(ARCH)
endif
--------------------------------------
* создать целевые конфиги apt по указанным выше путям.
......
......@@ -34,8 +34,10 @@ $HOME/.mkimage/profiles.mk.
* BRANCH
** указывает для какого бранча производится сборка
** собирает вместо регулярок стартеркиты
** значение: пусто (сборка для Сизифа) либо имя бранча
** задаёт переменную "STARTERKIT := mixin/starterkit"
** значение:
*** не определено - пытается определиться автоматически
*** пусто - присваивается значение sisyphus
*** имя бранча (sisyphus, p10, p9)
** см. doc/branch.txt main.mk, conf.d/mixin.mk
* BUILDDIR
......
......@@ -2,11 +2,7 @@
# NB: REPORT doesn't work here, it's somewhat special
# where to look for apt.conf; system one used by default
ifneq (,$(BRANCH))
APTCONF = ~/apt/apt.conf.$(BRANCH).$(ARCH)
else
APTCONF = ~/apt/apt.conf.sisyphus.$(ARCH)
endif
# path to save out image
IMAGEDIR = ~/out/$(BRANCH)/$(shell date +%Y%m%d)
......
......@@ -8,9 +8,7 @@ use/stage2:: sub/stage1
@$(call set,GLOBAL_HSH_PROC,1)
ifneq (,$(filter-out e2k%,$(ARCH)))
ifeq (,$(BRANCH))
use/stage2:: use/initrd-bootchain; @:
else ifneq (,$(filter-out p10 p9 p8 p7 p6 p5 с%,$(BRANCH)))
ifeq (sisyphus,$(BRANCH))
use/stage2:: use/initrd-bootchain; @:
else
use/stage2:: use/initrd-propagator; @:
......
......@@ -13,7 +13,7 @@ distro/.init: profile/bare
@$(call try,META_PUBLISHER,ALT Linux Team)
distro/.boot: distro/.init boot/iso
ifeq (,$(BRANCH))
ifeq (sisyphus,$(BRANCH))
@$(call try,META_VOL_ID,ALT $(IMAGE_NAME)/$(ARCH))
else
@$(call try,IMAGE_FLAVOUR,$(subst alt-$(BRANCH)-,,$(IMAGE_NAME)))
......
......@@ -100,7 +100,7 @@ profile/bare: profile/init use/pkgpriorities
@$(call try,GLOBAL_VERBOSE,)
@$(call try,IMAGEDIR,$(wildcard $(IMAGEDIR)))
@$(call try,LOGDIR,$(wildcard $(LOGDIR)))
ifeq (,$(BRANCH))
ifeq (sisyphus,$(BRANCH))
@$(call try,BRANDING,alt-sisyphus)
else
@$(call try,BRANDING,alt-starterkit)
......
......@@ -17,7 +17,7 @@ endif
IMAGE_CONF := $(firstword $(subst ., ,$(IMAGE_TARGET)))# ve/generic
IMAGE_CLASS := $(firstword $(subst /, ,$(IMAGE_TARGET)))# ve
IMAGE_FILE := $(lastword $(subst /, ,$(IMAGE_TARGET)))# generic.tar.gz
ifneq (,$(BRANCH))
ifneq (sisyphus,$(BRANCH))
IMAGE_FILE := $(subst regular,alt-$(BRANCH),$(IMAGE_FILE))
endif
IMAGE_NAME := $(firstword $(subst ., ,$(IMAGE_FILE)))# generic
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment