Skip to content

Commit 8ec5b49

Browse files
committed
Remove packages marked to not build anymore on given architecture
When package is updated and marked not to build on some architectures with archs/nocross/broken/restricted, it needs to be removed form repository.
1 parent b8a67b5 commit 8ec5b49

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ pkgs.txt
77
pkgs-removed.txt
88
repo-checkvers.txt
99
repo-checkvers-remove.txt
10+
repo-checkvers-pkgver.txt
11+
disabled.txt

configure

+13-4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ XSC=
1414
_append=""
1515
RCV=`command -v xbps-checkvers 2>/dev/null`
1616
RCV_F="repo-checkvers.txt"
17+
RCV_FPV="repo-checkvers-pkgver.txt"
1718
RCV_FR="repo-checkvers-remove.txt"
1819
TOBUILD=
1920
_TOBUILD=
@@ -125,7 +126,9 @@ case "$?" in
125126
0) # version < 0.54
126127
grep pkgname "$RCV_F" | awk '{ print $2 }' >pkgs.txt ;;
127128
1) # version >= 0.54
128-
cut -d' ' -f1 "$RCV_F" >pkgs.txt ;;
129+
cut -d' ' -f1 "$RCV_F" >pkgs.txt
130+
cut -d' ' -f1-2 "$RCV_F" > "$RCV_FPV"
131+
;;
129132
*)
130133
echo "ERROR: couldn't determine xbps-checkvers version"
131134
exit 1
@@ -217,13 +220,19 @@ printf "BUILT = \$(patsubst tobuild/%%,built/%%,\$(TOBUILD))\n\n" >> Makefile
217220
printf "PKGS_REMOVED = $TOREMOVE\n" >> Makefile
218221
printf "TOREMOVE = \$(patsubst %%,toremove/%%,\$(PKGS_REMOVED))\n" >> Makefile
219222
printf "REMOVED = \$(patsubst toremove/%%,removed/%%,\$(TOREMOVE))\n\n" >> Makefile
220-
printf "all: \$(BUILT) \$(REMOVED)\n" >> Makefile
223+
printf "all: allbuilt allremoved\n" >> Makefile
221224
printf "\t@echo \"[Done]\"\n\n" >> Makefile
225+
printf "allbuilt: \$(BUILT)\n\n" >> Makefile
226+
printf "allremoved: \$(REMOVED) remove_disabled\n\n" >> Makefile
227+
printf "remove_disabled: allbuilt\n" >> Makefile
228+
printf "\t@touch disabled.txt\n" >> Makefile
229+
printf "\t@./remove-disabled.sh \"$HOSTDIR/binpkgs\" $PKG_ARCH ${CROSS_ARCH:+XBPS_TARGET_ARCH=$CROSS_ARCH} \n" >> Makefile
230+
printf "\t@rm disabled.txt\n\n" >> Makefile
222231
printf "print_pkgs:\n" >> Makefile
223232
printf "\t@echo \$(PKGS)\n\n" >> Makefile
224233
printf "built/%%: tobuild/%%\n" >> Makefile
225234
printf "\t@echo \"[xbps-src]\t\${@F}\"\n" >> Makefile
226-
printf "\t@( $XSC pkg \${@F}; rval=\$\$?; [ \$\$rval -eq 2 ] && exit 0 || exit \$\$rval )\n" >> Makefile
235+
printf "\t@( $XSC pkg \${@F}; rval=\$\$?; [ \$\$rval -eq 2 ] && { echo \${@F} >> disabled.txt; exit 0; } || exit \$\$rval )\n" >> Makefile
227236
printf "\t@touch \$@\n" >> Makefile
228237
printf "\t@rm tobuild/\${@F}\n\n" >> Makefile
229238
printf "removed/%%: toremove/%%\n" >> Makefile
@@ -267,7 +276,7 @@ printf "clean:\n" >> Makefile
267276
printf "\t@rm -f built/*\n" >> Makefile
268277
printf "\t@rm -f removed/*\n" >> Makefile
269278
printf "\t@echo \"[Clean]\"\n\n" >> Makefile
270-
printf ".PHONY: all print_pkgs clean\n" >> Makefile
279+
printf ".PHONY: all print_pkgs clean allbuilt allremoved remove_disabled\n" >> Makefile
271280

272281
printf "INFO: 'Makefile' generated.\n"
273282
printf "INFO: Type 'make'\n"

remove-disabled.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
repository="$1"
4+
arch="$2"
5+
xbps_target_arch="$3"
6+
RCV_FPV="repo-checkvers-pkgver.txt"
7+
8+
[ -d "$repository" ] || exit 0
9+
[ -e disabled.txt ] || exit 0
10+
[ -e "$RCV_FPV" ] || exit 0
11+
12+
while read -r pkgname; do
13+
pkgver="$(grep "^$pkgname " < $RCV_FPV | tr ' ' -)"
14+
[ "$pkgver" ] || continue
15+
find "$repository" -name "${pkgver}.${arch}.xbps" -exec env $xbps_target_arch xbps-rindex -R '{}' ';'
16+
done < disabled.txt

0 commit comments

Comments
 (0)