Update to use the new repo bin

This commit is contained in:
Wildan M 2025-10-28 00:29:54 +07:00
parent 4786eaf7e3
commit 5382f39857
3 changed files with 26 additions and 88 deletions

View File

@ -32,7 +32,7 @@ clean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
cd cookbook && ./clean.sh
$(MAKE) c,--all
-rm -rf cookbook/repo
$(MAKE) fstools_clean
$(HOST_CARGO) clean --manifest-path relibc/Cargo.toml
@ -45,8 +45,8 @@ distclean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(MAKE) u,--all
$(MAKE) clean
cd cookbook && ./unfetch.sh
endif
pull:

View File

@ -1,60 +1,36 @@
# Configuration file for recipe commands
$(BUILD)/fetch.tag: prefix $(FSTOOLS_TAG) $(FILESYSTEM_CONFIG) $(CONTAINER_TAG)
$(REPO_TAG): $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) --short -c $(FILESYSTEM_CONFIG))" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./fetch.sh $(REPO_NONSTOP) $(REPO_OFFLINE) "$${PACKAGES}"
PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) --short -c $(FILESYSTEM_CONFIG))" && \
./cookbook/repo.sh $(REPO_NONSTOP) $(REPO_OFFLINE) --with-package-deps "$${PACKAGES}"
mkdir -p $(BUILD)
# make sure fstools.tag are newer than the things repo modifies
touch $(FSTOOLS_TAG)
touch $@
endif
$(REPO_TAG): $(BUILD)/fetch.tag $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) --short -c $(FILESYSTEM_CONFIG))" && \
cd cookbook && \
./repo.sh $(REPO_NONSTOP) $(REPO_OFFLINE) --with-package-deps "$${PACKAGES}"
mkdir -p $(BUILD)
# make sure fstools.tag and fetch.tag are newer than the things repo modifies
touch $(FSTOOLS_TAG)
touch $(BUILD)/fetch.tag
touch $@
endif
comma := ,
# Find recipe
find.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
target/release/find_recipe $*
@cd ./cookbook && ./target/release/repo find $(foreach f,$(subst $(comma), ,$*),$(f))
endif
comma := ,
# Invoke clean.sh for one or more targets separated by comma
c.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@if echo "$*" | grep -q ','; then \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),c.$(f)); \
else \
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./clean.sh $*; \
fi
cd ./cookbook && ./target/release/repo clean $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke fetch.sh for one or more targets separated by comma
@ -62,14 +38,9 @@ f.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@if echo "$*" | grep -q ','; then \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),f.$(f)); \
else \
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./fetch.sh $*; \
fi
cd ./cookbook && ./target/release/repo fetch $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke repo.sh for one or more targets separated by comma
@ -77,14 +48,9 @@ r.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@if echo "$*" | grep -q ','; then \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),r.$(f)); \
else \
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./repo.sh $*; \
fi
./cookbook/repo.sh $(REPO_OFFLINE) $(foreach f,$(subst $(comma), ,$*),$(f))
endif
MOUNTED_TAG=$(MOUNT_DIR)~
@ -100,34 +66,23 @@ p.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@if echo "$*" | grep -q ','; then \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),p.$(f)); \
else \
export RECIPE_PATH=cookbook/$(shell make find.$* | grep ^recipes) && \
export RECIPE_STAGE=$$RECIPE_PATH/target/$(TARGET)/stage.pkgar && \
./cookbook/pkgar/target/release/pkgar extract $(MOUNT_DIR)/ --archive $$RECIPE_STAGE \
--pkey ./cookbook/build/id_ed25519.pub.toml && \
echo "extracted $$RECIPE_PATH"; \
fi
cd ./cookbook && ./target/release/repo push $(foreach f,$(subst $(comma), ,$*),$(f)) "--sysroot=../$(MOUNT_DIR)"
endif
@if [ -f $(MOUNTED_TAG) ]; then \
$(MAKE) unmount && rm -f $(MOUNTED_TAG); \
else echo "Not unmounting by ourself, don't forget to do it"; \
fi
# Push compiled package with their package dependencies
pp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) p.$*,--with-package-deps
# Invoke unfetch.sh for one or more targets separated by comma
u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@if echo "$*" | grep -q ','; then \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),u.$(f)); \
else \
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./unfetch.sh $*; \
fi
cd ./cookbook && ./target/release/repo unfetch $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke clean.sh, and repo.sh for one of more targets separated by comma

View File

@ -6,26 +6,9 @@ if [ -z "$1" ] || [ -z "$2" ]
then
echo "Build or clean all recipe directories in a category" >&2
echo Usage: $0 "<action>" "<recipe-category>" >&2
echo "<action>" can be f, r, c, u, or combinations that \"make\" understands >&2
echo "<action>" can be f, r, c, u, p, or combinations that \"make\" understands >&2
echo "<category>" can be path of category you want to run e.g. \"core\", \"wip\", \"wip/dev\" >&2
exit 1
fi
action="${1#-}"
recipe_list=""
first=1
for recipe in `find cookbook/recipes/"$2" -name "recipe.*"`
do
recipe_folder=`dirname "$recipe"`
recipe_name=`basename "$recipe_folder"`
if [ "$first" -eq 1 ]; then
recipe_list="$recipe_name"
first=0
else
recipe_list="$recipe_list,$recipe_name"
fi
done
set -x
make "$action"."$recipe_list"
make "${1#-}"."--category-$2"