@@ -47,7 +47,7 @@ while getopts a:Cc:d:Nm:th:vR: OPT; do
47
47
exit 0
48
48
;;
49
49
C)
50
- rm -rf tobuild built toremove removed toremove32bit removed32bit
50
+ rm -rf tobuild built
51
51
rm -f * .txt Makefile
52
52
exit 0
53
53
;;
147
147
printf " INFO: Creating source targets...\n"
148
148
TOREMOVE=
149
149
TOREMOVE32BIT=
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
152
152
for p in ` cat pkgs.txt` ; do
153
153
if [ -f " $SRCPKGS /$p /template" ]; then
154
154
$XSC show-avail $p 2> /dev/null
180
180
181
181
_TOBUILD=" ` find tobuild -type f` "
182
182
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
-
191
183
concat () {
192
184
local found=0
193
185
for tb in $TOBUILD ; do
@@ -244,12 +236,23 @@ printf "PKGS = $TOBUILD\n" >> Makefile
244
236
printf " TOBUILD = \$ (patsubst %%,tobuild/%%,\$ (PKGS))\n" >> Makefile
245
237
printf " BUILT = \$ (patsubst tobuild/%%,built/%%,\$ (TOBUILD))\n\n" >> Makefile
246
238
printf " 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
249
240
printf " all: allbuilt allremoved\n" >> Makefile
250
241
printf " \t@echo \" [Done]\" \n\n" >> Makefile
251
242
printf " 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
253
256
printf " print_pkgs:\n" >> Makefile
254
257
printf " \t@echo \$ (PKGS)\n\n" >> Makefile
255
258
printf " print_pkgs_removed:\n" >> Makefile
@@ -261,19 +264,6 @@ printf "\t@( $XSC pkg \${@F}; rval=\$\$?; [ \$\$rval -eq 2 ] && exit 0 || exit \
261
264
printf " \t@touch \$ @\n" >> Makefile
262
265
printf " \t@rm tobuild/\$ {@F}\n\n" >> Makefile
263
266
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
-
277
267
printf " INFO: Finding and adding dependencies...\n"
278
268
printf " # Dependencies\n" >> Makefile
279
269
for p in $TOBUILD ; do
0 commit comments