Make clean-pkgs-dir backup things it cleans up

If something already exists in backup form, skip it, otherwise move
the content to the backup directory.

Signed-off-by: William Douglas <william.douglas@intel.com>
This commit is contained in:
William Douglas
2023-09-19 11:22:01 -07:00
parent d85dfaec30
commit 579d79ef92
+7 -2
View File
@@ -129,8 +129,13 @@ pull: ${PULL_PKGS}
#help removes the associated package repos from the ./packages tree
clean-pkgs-dir: $(PACKAGES_FILE)
@for p in ${PKGS_ORPHANED}; do \
echo "Removing $$p from packages, it is no longer in common/packages."; \
rm -rf packages/$$p; \
mkdir -p packages_old; \
if [ -d "packages_old/$$p" ]; then \
echo "packages_old/$$p already exists, not touching it"; \
else \
echo "Moving $$p from packages to packages_old, as it is no longer in common/packages."; \
mv packages/$$p packages_old/$$p; \
fi; \
done
@echo "packages directory cleaned";