From nobody Thu Mar 28 21:33:44 2024 X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by lists.alpinelinux.org (Postfix) with ESMTP id AAF391EBFEE for ; Thu, 25 Nov 2010 03:30:24 +0000 (UTC) Received: by bwz2 with SMTP id 2so507738bwz.13 for ; Wed, 24 Nov 2010 19:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FTqwA0KFFYz1Zc4uz62TI3rDa/lAMyXtGe+a+qeOd74=; b=BeSYhw60sUBOcGqrwQTcaz1DRZ/vsgz2KyeeYXDnBPtveFhtIadgJwNHLEbGV2IIRu m/NPNs+O8fQiQZ8DXczBKbXGeT/uR/XZBkw0bMbpfTpaeAxd8Qf7dgBwzGnvDyOG4L7V IajBdzSUaA5Elg4VDJrLWGe8bUarrcCOpPAGk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=p6H1qbeiSu7SITW7zjzEC2HuWoco3B4tCr7ZZo2bbo1pVcE9Q7QN75m0iR3FQCvSA4 PXtssc8l3k7QaKuR8AJM67CSHxsj752FjEKgq3qRCR7MDxy2ERU4m//Yif5dncI9T/K7 d16MaSZ4P5gH2++u55u1bwl5Dp8dicHxw52WA= X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Received: by 10.204.116.201 with SMTP id n9mr163004bkq.138.1290655823238; Wed, 24 Nov 2010 19:30:23 -0800 (PST) Received: by 10.204.126.212 with HTTP; Wed, 24 Nov 2010 19:30:23 -0800 (PST) In-Reply-To: <1290633981-2048-1-git-send-email-jbilyk@gmail.com> References: <1290633981-2048-1-git-send-email-jbilyk@gmail.com> Date: Wed, 24 Nov 2010 22:30:23 -0500 Message-ID: Subject: [alpine-devel] Re: [PATCH] apts2: initial commit From: Jeff Bilyk To: Alpine Development Cc: ncopa@alpinelinux.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here's what I've got for the initial version of the package testing part of things. I'll try to whip up a quick script that will take the original APTS .mk files and convert them to the format used by this script (take out line 1 and s/apk_delete/apk_del). Tried to keep it as simple as possible since it'll need to run quite a bit. Also, tried to keep the output fairly easy to search through. Thoughts/feedback? Jeff On Wed, Nov 24, 2010 at 4:26 PM, Jeff Bilyk wrote: > initial commit with package testing script and 2 package scripts > --- > =A0apts2 =A0 =A0 =A0 =A0 | =A0 31 +++++++++++++++++++++++++++++++ > =A0packages/lsof | =A0 =A03 +++ > =A0packages/sed =A0| =A0 =A04 ++++ > =A03 files changed, 38 insertions(+), 0 deletions(-) > =A0create mode 100755 apts2 > =A0create mode 100644 packages/lsof > =A0create mode 100644 packages/sed > > diff --git a/apts2 b/apts2 > new file mode 100755 > index 0000000..f4fd910 > --- /dev/null > +++ b/apts2 > @@ -0,0 +1,31 @@ > +#!/bin/sh > + > +# Get file to output to > +ARGUMENTS=3D"$@" > +OUTFILE=3D"`echo $ARGUMENTS | awk -F ' ' '{print $1}'`" > +if [ -z "$OUTFILE" ]; > + =A0 =A0 =A0 =A0then echo "Usage: $0 outputfile " && exit 1; > +fi > + > +if [ "$OUTFILE" =3D=3D "-h" ]; > + =A0 =A0 =A0 =A0then echo "Usage: $0 outputfile " && exit 0; > +fi > + > +if [ "$OUTFILE" =3D=3D "--help" ]; > + =A0 =A0 =A0 =A0then echo "Usage: $0 outputfile " && exit 0; > +fi > + > +PACKAGE=3D"`echo $ARGUMENTS | awk -F ' ' '{print $2}'`" > + > +if [ -z "$PACKAGE" ]; > + =A0 =A0 =A0 =A0then echo "All packages to be tested" && for package in = `ls ./packages`; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0do echo "Testing $package apk" && /bin/s= h -e ./packages/$package >> "$OUTFILE" 2>&1 && echo "$package passed tests"= >> "$OUTFILE" && echo "$package passed tests"; > + > + =A0 =A0 =A0 =A0done && exit 0; > +else test -e ./packages/$PACKAGE && echo "Testing $PACKAGE apk" && /bin/= sh -e ./packages/$PACKAGE >> "$OUTFILE" 2>&1 && echo "$PACKAGE passed tests= " && exit 0; > + > +fi > + > +if [ "$?" =3D=3D "1" ]; > + =A0 =A0 =A0 =A0then echo "Testing file for $PACKAGE does not exist" && = exit 1; > +fi > \ No newline at end of file > diff --git a/packages/lsof b/packages/lsof > new file mode 100644 > index 0000000..3c49a22 > --- /dev/null > +++ b/packages/lsof > @@ -0,0 +1,3 @@ > + =A0 =A0 =A0 apk_add $@ > + =A0 =A0 =A0 lsof > + =A0 =A0 =A0 apk_del $@ > diff --git a/packages/sed b/packages/sed > new file mode 100644 > index 0000000..0d1b744 > --- /dev/null > +++ b/packages/sed > @@ -0,0 +1,4 @@ > + =A0 =A0 =A0 apk_add $@ > + =A0 =A0 =A0 echo "hello" | sed 's/hello/world/g' | grep 'world' > + =A0 =A0 =A0 apk_del $@ > + =A0 =A0 =A0 [ `readlink /bin/sed` =3D /bin/busybox ] > -- > 1.7.3.2 > > --=20 Jeff --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org --- From nobody Thu Mar 28 21:33:44 2024 X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from mail.wtbts.no (mail.wtbts.no [213.234.126.131]) by lists.alpinelinux.org (Postfix) with ESMTP id 068AB1EBFEE for ; Thu, 25 Nov 2010 15:59:26 +0000 (UTC) Received: from [10.65.65.1] (unknown [10.65.65.1]) by mail.wtbts.no (Postfix) with ESMTP id 319967E0BB; Thu, 25 Nov 2010 16:51:48 +0100 (CET) Subject: Re: [alpine-devel] Re: [PATCH] apts2: initial commit From: Natanael Copa To: Jeff Bilyk Cc: Alpine Development In-Reply-To: References: <1290633981-2048-1-git-send-email-jbilyk@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 25 Nov 2010 16:59:25 +0100 Message-ID: <1290700765.6958.72.camel@ncopa-desktop.nor.wtbts.net> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 Content-Transfer-Encoding: 7bit On Wed, 2010-11-24 at 22:30 -0500, Jeff Bilyk wrote: > Here's what I've got for the initial version of the package testing > part of things. I'll try to whip up a quick script that will take the > original APTS .mk files and convert them to the format used by this > script (take out line 1 and s/apk_delete/apk_del). Tried to keep it > as simple as possible since it'll need to run quite a bit. Also, > tried to keep the output fairly easy to search through. > > Thoughts/feedback? I looked at it. I'm ok with the idea behind, but code itself could have use of some minor improvements ;) I think I should set up a git repo for you. > Jeff > > On Wed, Nov 24, 2010 at 4:26 PM, Jeff Bilyk wrote: > > initial commit with package testing script and 2 package scripts > > --- > > apts2 | 31 +++++++++++++++++++++++++++++++ i think we can just call the main script for 'apts' rather han 'apts2' > > packages/lsof | 3 +++ > > packages/sed | 4 ++++ maybe call the dir 'tests' instead of 'packages' since it holds the test scripts? > > 3 files changed, 38 insertions(+), 0 deletions(-) > > create mode 100755 apts2 > > create mode 100644 packages/lsof > > create mode 100644 packages/sed > > > > diff --git a/apts2 b/apts2 > > new file mode 100755 > > index 0000000..f4fd910 > > --- /dev/null > > +++ b/apts2 > > @@ -0,0 +1,31 @@ > > +#!/bin/sh > > + > > +# Get file to output to > > +ARGUMENTS="$@" > > +OUTFILE="`echo $ARGUMENTS | awk -F ' ' '{print $1}'`" > > +if [ -z "$OUTFILE" ]; > > + then echo "Usage: $0 outputfile " && exit 1; > > +fi There are better wais to parse the opts program=$0 usage() { echo "Usage: $program outputfile " exit 1 } # parse options while getopts "h" opt; do case "$opt" in h) usage;; esac done # remove options so we have package... in $@ shift $(( $OPTIND - 1 )) # do wa have any file args? if [ $# -eq 0 ]; then echo "no outfile" fi i=1 while [ $# -gt 0 ]; do echo "file number $i: $1" i=$(( $i + 1 )) shift done > > + > > +if [ "$OUTFILE" == "-h" ]; > > + then echo "Usage: $0 outputfile " && exit 0; > > +fi > > + > > +if [ "$OUTFILE" == "--help" ]; > > + then echo "Usage: $0 outputfile " && exit 0; > > +fi > > + > > +PACKAGE="`echo $ARGUMENTS | awk -F ' ' '{print $2}'`" > > + > > +if [ -z "$PACKAGE" ]; > > + then echo "All packages to be tested" && for package in `ls ./packages`; > > + do echo "Testing $package apk" && /bin/sh -e ./packages/$package >> "$OUTFILE" 2>&1 && echo "$package passed tests" >> "$OUTFILE" && echo "$package passed tests"; > > + > > + done && exit 0; > > +else test -e ./packages/$PACKAGE && echo "Testing $PACKAGE apk" && /bin/sh -e ./packages/$PACKAGE >> "$OUTFILE" 2>&1 && echo "$PACKAGE passed tests" && exit 0; > > + > > +fi > > + > > +if [ "$?" == "1" ]; > > + then echo "Testing file for $PACKAGE does not exist" && exit 1; > > +fi > > \ No newline at end of file > > diff --git a/packages/lsof b/packages/lsof > > new file mode 100644 > > index 0000000..3c49a22 > > --- /dev/null > > +++ b/packages/lsof > > @@ -0,0 +1,3 @@ > > + apk_add $@ > > + lsof > > + apk_del $@ > > diff --git a/packages/sed b/packages/sed > > new file mode 100644 > > index 0000000..0d1b744 > > --- /dev/null > > +++ b/packages/sed > > @@ -0,0 +1,4 @@ > > + apk_add $@ > > + echo "hello" | sed 's/hello/world/g' | grep 'world' > > + apk_del $@ > > + [ `readlink /bin/sed` = /bin/busybox ] > > -- > > 1.7.3.2 > > > > > > > --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---