Skip to content

Commit 2298567

Browse files
committed
Remove multilib packages
1 parent 5e085a5 commit 2298567

1 file changed

Lines changed: 40 additions & 15 deletions

File tree

configure

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
50+
rm -rf tobuild built toremove removed toremove32bit removed32bit
5151
rm -f *.txt Makefile
5252
exit 0
5353
;;
@@ -143,8 +143,10 @@ if $RCV -h 2>&1 | grep -q -e $RCV_REMOVED; then
143143
fi
144144

145145
printf "INFO: Creating source targets...\n"
146-
rm -rf tobuild built toremove removed
147-
mkdir -p tobuild built toremove removed
146+
TOREMOVE=
147+
TOREMOVE32BIT=
148+
rm -rf tobuild built toremove removed toremove32bit removed32bit
149+
mkdir -p tobuild built toremove removed toremove32bit removed32bit
148150
for p in `cat pkgs.txt`; do
149151
if [ -f "$SRCPKGS/$p/template" ]; then
150152
$XSC show-avail $p 2>/dev/null
@@ -154,23 +156,35 @@ for p in `cat pkgs.txt`; do
154156
;;
155157
2)
156158
version="$(grep "^$p " < $RCV_FPV | tail -n 1 | cut -d' ' -f2)"
157-
touch toremove/$p-$version
158-
$XSC show $p 2>/dev/null | grep '^subpackages:' | cut -d: -f2- |
159-
while read -r sub; do
160-
touch toremove/$sub-$version
161-
done
159+
TOREMOVE+="$p-$version "
160+
TOREMOVE+="$p-dbg-$version "
161+
[ "$XBPS_ARCH" = i686 ] && TOREMOVE32BIT+="$p-32bit-$version "
162+
while read -r sub; do
163+
TOREMOVE+="$sub-$version "
164+
TOREMOVE+="$sub-dbg-$version "
165+
[ "$XBPS_ARCH" = i686 ] && TOREMOVE32BIT+="$sub-32bit-$version "
166+
done < <($XSC show $p 2>/dev/null | grep '^subpackages:' | cut -d: -f2-)
162167
;;
163168
esac
164169
fi
165170
done
166-
[ -f pkgs-removed.txt ] && cat pkgs-removed.txt | while read p old; do
167-
if ! [ -f "$SRCPKGS/$p/template" ]; then
168-
touch toremove/$p-$old
169-
fi
170-
done
171+
if [ -f pkgs-removed.txt ] ; then
172+
while read p old; do
173+
if ! [ -f "$SRCPKGS/$p/template" ]; then
174+
TOREMOVE+="$p-$old "
175+
fi
176+
done < pkgs-removed.txt
177+
fi
171178

172179
_TOBUILD="`find tobuild -type f`"
173-
TOREMOVE="`find toremove -type f -printf '%f '`"
180+
181+
for i in $TOREMOVE; do
182+
touch toremove/$i
183+
done
184+
185+
for i in $TOREMOVE32BIT; do
186+
touch toremove32bit/$i
187+
done
174188

175189
concat() {
176190
local found=0
@@ -238,14 +252,22 @@ printf "print_pkgs:\n" >> Makefile
238252
printf "\t@echo \$(PKGS)\n\n" >> Makefile
239253
printf "print_pkgs_removed:\n" >> Makefile
240254
printf "\t@echo \$(PKGS_REMOVED)\n\n" >> Makefile
255+
241256
printf "built/%%: tobuild/%%\n" >> Makefile
242257
printf "\t@echo \"[xbps-src]\t\${@F}\"\n" >> Makefile
243258
printf "\t@( $XSC pkg \${@F}; rval=\$\$?; [ \$\$rval -eq 2 ] && exit 0 || exit \$\$rval )\n" >> Makefile
244259
printf "\t@touch \$@\n" >> Makefile
245260
printf "\t@rm tobuild/\${@F}\n\n" >> Makefile
261+
246262
printf "removed/%%: toremove/%%\n" >> Makefile
247263
printf "\t@echo \"[xbps-rindex --remove --stage]\t\${@F}\"\n" >> Makefile
248-
printf "\t@find \"$HOSTDIR/binpkgs\" -name \${@F}.$PKG_ARCH.xbps -exec env ${CROSS_ARCH:+XBPS_TARGET_ARCH=$CROSS_ARCH} xbps-rindex --remove --stage '{}' ';'\n" >> Makefile
264+
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
265+
printf "\t@touch \$@\n" >> Makefile
266+
printf "\t@rm toremove/\${@F}\n\n" >> Makefile
267+
268+
printf "removed32bit/%%: toremove32bit/%%\n" >> Makefile
269+
printf "\t@echo \"[xbps-rindex --remove --stage # multilib]\t\${@F}\"\n" >> Makefile
270+
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
249271
printf "\t@touch \$@\n" >> Makefile
250272
printf "\t@rm toremove/\${@F}\n\n" >> Makefile
251273

@@ -275,6 +297,9 @@ for p in $TOBUILD; do
275297
printf "built/$p: $deps\n" >> Makefile
276298
done
277299

300+
printf "\n" >> Makefile
301+
printf "# Remove targets\n" >> Makefile
302+
printf "removed/$p:\n" >> Makefile
278303
for p in $TOREMOVE; do
279304
printf "removed/$p:\n" >> Makefile
280305
done

0 commit comments

Comments
 (0)