@@ -47,7 +47,7 @@ while getopts a:Cc:d:Nm:th:vR: OPT; do
4747 exit 0
4848 ;;
4949 C)
50- rm -rf tobuild built toremove removed toremove32bit removed32bit
50+ rm -rf tobuild built
5151 rm -f * .txt Makefile
5252 exit 0
5353 ;;
147147printf " INFO: Creating source targets...\n"
148148TOREMOVE=
149149TOREMOVE32BIT=
150- rm -rf tobuild built toremove removed toremove32bit removed32bit
151- mkdir -p tobuild built toremove removed toremove32bit removed32bit
150+ rm -rf tobuild built
151+ mkdir -p tobuild built
152152for p in ` cat pkgs.txt` ; do
153153 if [ -f " $SRCPKGS /$p /template" ]; then
154154 $XSC show-avail $p 2> /dev/null
180180
181181_TOBUILD=" ` find tobuild -type f` "
182182
183- for i in $TOREMOVE ; do
184- touch toremove/$i
185- done
186-
187- for i in $TOREMOVE32BIT ; do
188- touch toremove32bit/$i
189- done
190-
191183concat () {
192184 local found=0
193185 for tb in $TOBUILD ; do
@@ -244,12 +236,23 @@ printf "PKGS = $TOBUILD\n" >> Makefile
244236printf " TOBUILD = \$ (patsubst %%,tobuild/%%,\$ (PKGS))\n" >> Makefile
245237printf " BUILT = \$ (patsubst tobuild/%%,built/%%,\$ (TOBUILD))\n\n" >> Makefile
246238printf " PKGS_REMOVED = $TOREMOVE \n" >> Makefile
247- printf " TOREMOVE = \$ (patsubst %%,toremove/%%,\$ (PKGS_REMOVED))\n" >> Makefile
248- printf " REMOVED = \$ (patsubst toremove/%%,removed/%%,\$ (TOREMOVE))\n\n" >> Makefile
239+ printf " PKGS_REMOVED_32BIT = $TOREMOVE32BIT \n" >> Makefile
249240printf " all: allbuilt allremoved\n" >> Makefile
250241printf " \t@echo \" [Done]\" \n\n" >> Makefile
251242printf " allbuilt: \$ (BUILT)\n\n" >> Makefile
252- printf " allremoved: \$ (REMOVED)\n\n" >> Makefile
243+ printf " allremoved:\n" >> Makefile
244+ printf " \t@echo \" [xbps-rindex --remove --stage]\t\" \n" >> Makefile
245+ # TODO: xbps-query --stage -s
246+ for subrepo in " " /debug /nonfree; do
247+ printf " \t@( in_repo=\$\$ (env XBPS_TARGET_ARCH=$PKG_ARCH xbps-query -i -R --repository=\" $HOSTDIR /binpkgs$subrepo \" -s '' | cut -d' ' -f2 | while read -r indexed; do for removed in \$ (PKGS_REMOVED); do [ \"\$\$ indexed\" = \"\$\$ removed\" ] && echo \" $HOSTDIR /binpkgs$subrepo \" /\$\$ removed.$PKG_ARCH .xbps; done; done ); [ \"\$\$ in_repo\" ] && env XBPS_TARGET_ARCH=$PKG_ARCH xbps-rindex --remove --stage \$\$ in_repo )\n" >> Makefile
248+ done
249+ if [ " $XBPS_ARCH " = i686 ]; then
250+ printf " \t@echo \" [xbps-rindex --remove --stage # multilib]\t\" \n" >> Makefile
251+ for subrepo in /multilib /multilib/nonfree; do
252+ printf " \t@( in_repo=\$\$ (env XBPS_TARGET_ARCH=x86_64 xbps-query -i -R --repository=\" $HOSTDIR /binpkgs$subrepo \" -s '' | cut -d' ' -f2 | while read -r indexed; do for removed in \$ (PKGS_REMOVED_32BIT); do [ \"\$\$ indexed\" = \"\$\$ removed\" ] && echo \" $HOSTDIR /binpkgs$subrepo \" /\$\$ removed.x86_64.xbps; done; done ); [ \"\$\$ in_repo\" ] && env XBPS_TARGET_ARCH=x86_64 xbps-rindex --remove --stage \$\$ in_repo )\n" >> Makefile
253+ done
254+ fi
255+ printf " \n" >> Makefile
253256printf " print_pkgs:\n" >> Makefile
254257printf " \t@echo \$ (PKGS)\n\n" >> Makefile
255258printf " print_pkgs_removed:\n" >> Makefile
@@ -261,19 +264,6 @@ printf "\t@( $XSC pkg \${@F}; rval=\$\$?; [ \$\$rval -eq 2 ] && exit 0 || exit \
261264printf " \t@touch \$ @\n" >> Makefile
262265printf " \t@rm tobuild/\$ {@F}\n\n" >> Makefile
263266
264- printf " removed/%%: toremove/%%\n" >> Makefile
265- printf " \t@echo \" [xbps-rindex --remove --stage]\t\$ {@F}\" \n" >> Makefile
266- printf " \t@find \" $HOSTDIR /binpkgs\" -name \$ {@F}.$PKG_ARCH .xbps -exec env XBPS_ARCH=$PKG_ARCH ${CROSS_ARCH: +XBPS_TARGET_ARCH=$CROSS_ARCH } xbps-rindex --remove --stage '{}' ';'\n" >> Makefile
267- printf " \t@touch \$ @\n" >> Makefile
268- printf " \t@rm toremove/\$ {@F}\n\n" >> Makefile
269-
270- printf " removed32bit/%%: toremove32bit/%%\n" >> Makefile
271- printf " \t@echo \" [xbps-rindex --remove --stage # multilib]\t\$ {@F}\" \n" >> Makefile
272- printf " \t@find \" $HOSTDIR /binpkgs\" -name \$ {@F}.x86_64.xbps -exec env XBPS_TARGET_ARCH=x86_64 ${CROSS_ARCH: +XBPS_TARGET_ARCH=$CROSS_ARCH } xbps-rindex --remove --stage '{}' ';'\n" >> Makefile
273- printf " \t@touch \$ @\n" >> Makefile
274- printf " \t@rm toremove/\$ {@F}\n\n" >> Makefile
275-
276-
277267printf " INFO: Finding and adding dependencies...\n"
278268printf " # Dependencies\n" >> Makefile
279269for p in $TOBUILD ; do
0 commit comments