smart-selection.mk: Support sorted package lists

- Create sorted package lists
  - Fix replace target
This commit is contained in:
Jan Lindemann 2006-09-14 20:16:10 +00:00 committed by Jan Lindemann
commit a4d52d808b

View file

@ -8,8 +8,8 @@ DISTRIBUTOR = $(shell $(GET_OS_SH) | cut -d- -f1)
DISTRO_RELEASE = $(shell $(GET_OS_SH) | cut -d- -f2-) DISTRO_RELEASE = $(shell $(GET_OS_SH) | cut -d- -f2-)
UPLOAD_URL = root@ftp.jannet.de:/home/ftp/dat/pub/packages/linux/$(DISTRIBUTOR)/$(DISTRO_RELEASE)/inst-source/setup/descr UPLOAD_URL = root@ftp.jannet.de:/home/ftp/dat/pub/packages/linux/$(DISTRIBUTOR)/$(DISTRO_RELEASE)/inst-source/setup/descr
SELECTION = $(shell sh $(GENERATE_SELECTION) -s)-packages.txt SELECTION = $(shell $(GENERATE_SELECTION) -s)-packages.txt
CHANNEL_LIST = $(shell sh $(GENERATE_SELECTION) -s)-channels.txt CHANNEL_LIST = $(shell $(GENERATE_SELECTION) -s)-channels.txt
# === targets # === targets
all: selection.done channels.done all: selection.done channels.done
@ -22,10 +22,11 @@ install-smart: rpm-install-smart.done
commit: selection.done channels.done commit: selection.done channels.done
cvs add $(SELECTION) $(CHANNEL_LIST) cvs add $(SELECTION) $(CHANNEL_LIST)
cvs commit -m "o updated by target $@" cvs commit -m "o updated by target $@"
smart-update: smart-update.done
# === rules # === rules
selection.done: $(MODDIR)/make/smart-selection.mk selection.done: $(MODDIR)/make/smart-selection.mk
rpm -qa --queryformat '%{NAME}\n' | \ rpm -qa --queryformat '%{NAME}\n' | sort -u | \
sed ' \ sed ' \
/gpg-pubkey/ d \ /gpg-pubkey/ d \
' > $(SELECTION) ' > $(SELECTION)
@ -50,13 +51,14 @@ rpm-install-smart.done:
touch $@ touch $@
smart-update.done: smart-update.done:
smart update || exit 0 sudo smart update || exit 0
touch $@ touch $@
%-packages.txt-install: smart-update.done %-packages.txt-install: smart-update.done
cat $*-packages.txt | xargs sudo smart install -y cat $*-packages.txt | xargs sudo smart install -y
%-channels.txt-replace: smart-update.done %-channels.txt-replace: smart-update.done
sudo smart channel --remove-all -y sudo smart channel -y --remove-all
sudo smart channel --add -y $*-channels.txt sudo smart channel -y --add $*-channels.txt
sudo smart update || exit 0