Mailinglist Archive: opensuse-buildservice (219 mails)

< Previous Next >
Re: [opensuse-buildservice] osc build causes "Too many arguments" in /usr/bin/build
  • From: Matthias Bach <marix@xxxxxxxxx>
  • Date: Sat, 2 Feb 2008 22:25:33 +0100
  • Message-id: <200802022225.35571.marix@xxxxxxxxx>
Hi!

Am Samstag 02 Februar 2008 schrieb Matthias Bach:
Hi!

Am Samstag 02 Februar 2008 schrieb Matthias Bach:
sudo /usr/bin/build --root=/var/tmp/build-root
--rpmlist=/tmp/rpmlist.bCcRF4 --dist=/tmp/buildconfig.24-lvT
sane-backends-snapshot.spec --norootforbuild --changelog
/usr/bin/build: line 387: test: too many arguments
Usage: /usr/bin/build <src-dirctory>

Seems like I have been looking for the wrong problem all the time. The
error is caused by /usr/bin/build sometimes not using quotes when passing
$SRCDIR as a parameter to other applications. The error therefore is a
result of a directory name containing a space.

The attached diff will fix the problem if applied to /usr/bin/build

Regards,
Matthias
--
Matthias Bach
www.marix.org

"Was nicht mit einer gewissen Unsicherheit behaftet ist,
kann unmöglich die Wahrheit sein." - Richard P. Feynman
--- build.old 2008-02-02 22:05:42.000000000 +0100
+++ build.new 2008-02-02 22:20:33.000000000 +0100
@@ -384,9 +384,9 @@
SRCDIR=`pwd`/$SRCDIR
fi

-if test -f $SRCDIR ; then
- SPECFILES=`basename $SRCDIR`
- SRCDIR=`dirname $SRCDIR`
+if test -f "$SRCDIR" ; then
+ SPECFILES=`basename "$SRCDIR"`
+ SRCDIR=`dirname "$SRCDIR"`
else
SPECFILES=""
for i in $SRCDIR/*.spec ; do
@@ -494,7 +494,7 @@

test "$BUILD_ARCH" = all && BUILD_ARCH=

-cd $SRCDIR
+cd "$SRCDIR"

for SPECFILE in $SPECFILES ; do
#
@@ -519,7 +519,7 @@
mv $BUILD_ROOT$TOPDIR/SOURCES/* $BUILD_ROOT/.build-srcdir
mv $BUILD_ROOT$TOPDIR/SPECS/* $BUILD_ROOT/.build-srcdir
MYSRCDIR=$BUILD_ROOT/.build-srcdir
- cd $MYSRCDIR || cleanup_and_exit 1
+ cd "$MYSRCDIR" || cleanup_and_exit 1
for SPECFILE in *.spec ; do : ; done
else
echo processing specfile `pwd`/$SPECFILE...
@@ -554,9 +554,9 @@
# start up xen, rerun ourself
mkdir -p $BUILD_ROOT/.build
cp -a $BUILD_DIR/. $BUILD_ROOT/.build
- if ! test $MYSRCDIR = $BUILD_ROOT/.build-srcdir ; then
+ if ! test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
mkdir $BUILD_ROOT/.build-srcdir
- cp -p $MYSRCDIR/* $BUILD_ROOT/.build-srcdir
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir
MYSRCDIR=$BUILD_ROOT/.build-srcdir
fi
Q="'\''"
@@ -688,8 +688,8 @@
done
test -e $BUILD_ROOT/exit && cleanup_and_exit
mkdir -p $BUILD_ROOT$TOPDIR/SOURCES
- cp -p $MYSRCDIR/* $BUILD_ROOT$TOPDIR/SOURCES/
- test $MYSRCDIR = $BUILD_ROOT/.build-srcdir && rm -rf $MYSRCDIR
+ cp -p "$MYSRCDIR"/* $BUILD_ROOT$TOPDIR/SOURCES/
+ test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir && rm -rf "$MYSRCDIR"

CHANGELOGARGS=
test -n "$CHANGELOG" -a -f "$BUILD_ROOT/.build-changelog" &&
CHANGELOGARGS="--changelog $BUILD_ROOT/.build-changelog"
< Previous Next >
Follow Ups