Skip to content

Commit 8af23da

Browse files
Revert "Avoid calling external commands in a loop"
This needs some further investigation This reverts commit f913593.
1 parent d70f2c0 commit 8af23da

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

build-pkg-rpm

+6-7
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,16 @@ pkg_finalize_rpm() {
158158
echo "now installing cumulated packages"
159159
for ((num=0; num<=cumulate; num++)) ; do
160160
echo ${CUMULATED_LIST[$num]}
161-
done > $BUILD_ROOT/.init_b_cache/manifest
162-
for ((num=0; num<=cumulate; num++)) ; do
163161
PKG=${CUMULATED_LIST[$num]##*/}
164162
test "$BUILD_ROOT/.init_b_cache/rpms/$PKG" -ef "$BUILD_ROOT/${CUMULATED_LIST[$num]}" && continue
165-
cp --remove-destination $BUILD_ROOT/.init_b_cache/rpms/$PKG $BUILD_ROOT/${CUMULATED_LIST[$num]} || cleanup_and_exit 1
166-
done
167-
( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -Uvh --oldpackage --ignoresize $RPMCHECKOPTS \
163+
rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]}
164+
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG $BUILD_ROOT/${CUMULATED_LIST[$num]} || cleanup_and_exit 1
165+
done > $BUILD_ROOT/.init_b_cache/manifest
166+
( cd $BUILD_ROOT && chroot $BUILD_ROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
168167
$ADDITIONAL_PARAMS .init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit )
169168
for ((num=0; num<=cumulate; num++)) ; do
170-
echo "$BUILD_ROOT/${CUMULATED_LIST[$num]}"
171-
done | xargs -r rm -f
169+
rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]}
170+
done
172171
rm -f $BUILD_ROOT/.init_b_cache/manifest
173172
check_exit
174173
for ((num=0; num<=cumulate; num++)) ; do

dist/build.spec

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ BuildArch: noarch
3737
# Keep the following dependencies in sync with obs-worker package
3838
Requires: bash
3939
Requires: binutils
40-
Requires: findutils
4140
Requires: perl
4241
Requires: tar
4342
# needed for fuser

dist/debian.control

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ Standards-Version: 3.7.2
77

88
Package: obs-build
99
Architecture: all
10-
Depends: ${perl:Depends}, rpm, findutils, libarchive-tools | bsdtar
10+
Depends: ${perl:Depends}, rpm, libarchive-tools | bsdtar
1111
Recommends: rpm2cpio
1212
Conflicts: build
1313
Replaces: build
1414
Provides: build
15-
Description: A script to build SUSE RPMs
16-
This package provides a script for building RPMs for SUSE
15+
Description: A script to build SUSE Linux RPMs
16+
This package provides a script for building RPMs for SUSE Linux
1717
in a chroot environment.
18+

init_buildsystem

+15-14
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ preinstall_setup() {
232232
.build.kernel.*|.build.hostarch.*|.build.initrd.*|.build.console.*) ;;
233233
.build*|.init_b_cache|.preinstallimage*|.srcfiles*|.pkgs|.rpm-cache|installed-pkg|proc|sys) continue ;;
234234
esac
235-
echo "./$i"
236-
done | xargs -r mv -t build-preinstall || cleanup_and_exit 1
235+
mv "./$i" build-preinstall || cleanup_and_exit 1
236+
done
237237
cd build-preinstall || cleanup_and_exit 1
238238
}
239239

@@ -245,8 +245,8 @@ preinstall_integrate() {
245245
.build.kernel.*|.build.hostarch.*|.build.initrd.*|.build.console.*) ;;
246246
.build*|.init_b_cache|.preinstallimage*|.srcfiles*|.pkgs|.rpm-cache|installed-pkg|proc|sys) continue ;;
247247
esac
248-
echo "./$i"
249-
done | xargs -r mv -t .. || cleanup_and_exit 1
248+
mv "./$i" .. || cleanup_and_exit 1
249+
done
250250
cd "$BUILD_ROOT" || cleanup_and_exit 1
251251
assert_dirs
252252
}
@@ -850,9 +850,12 @@ else
850850
pkg_set_type
851851

852852
if test -n "$PREINSTALL_IMAGE" ; then
853-
# touch the file so that the copying works
854-
for PKG in $PACKAGES_FROM_PREINSTALLIMAGE; do echo "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF"; done | xargs -r touch
853+
for PKG in $PACKAGES_FROM_PREINSTALLIMAGE ; do
854+
# touch the file so that the copying works
855+
touch $BUILD_ROOT/.init_b_cache/rpms/"$PKG.$PSUF"
856+
done
855857
fi
858+
856859
fi
857860

858861
# XXX: should use an option instead of looking at the recipe?
@@ -932,14 +935,12 @@ fi
932935

933936
if test -n "$PREPARE_VM" ; then
934937
echo "copying packages..."
935-
936-
PKGS="$PACKAGES_TO_ALL $PACKAGES_TO_SYSROOTINSTALL"
937-
rm -f $(for P in $PKGS; do echo $BUILD_ROOT/.init_b_cache/$P.$PSUF; done)
938-
for P in $PKGS; do echo $BUILD_ROOT/.init_b_cache/rpms/$P.$PSUF; done | \
939-
xargs -r cp -L -p -t $BUILD_ROOT/.init_b_cache || cleanup_and_exit 1
940-
ln -s -f $(for P in $PKGS ; do echo "../$P.$PSUF"; done) -t $BUILD_ROOT/.init_b_cache/rpms
941-
check_exit
942-
938+
for PKG in $PACKAGES_TO_ALL $PACKAGES_TO_SYSROOTINSTALL ; do
939+
rm -rf $BUILD_ROOT/.init_b_cache/$PKG.$PSUF
940+
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF $BUILD_ROOT/.init_b_cache/$PKG.$PSUF || cleanup_and_exit 1
941+
ln -s -f ../$PKG.$PSUF $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF
942+
check_exit
943+
done
943944
# alreadyinstalled check will not work, but we have to live with that...
944945
echo -n 'reordering...'
945946
PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`

0 commit comments

Comments
 (0)