Mail archive
alpine-devel

[alpine-devel] Re: [PATCH] apts2: initial commit

From: Jeff Bilyk <jbilyk_at_gmail.com>
Date: Wed, 24 Nov 2010 22:30:23 -0500

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 <jbilyk_at_gmail.com> wrote:
> initial commit with package testing script and 2 package scripts
> ---
>  apts2         |   31 +++++++++++++++++++++++++++++++
>  packages/lsof |    3 +++
>  packages/sed  |    4 ++++
>  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
> _at_@ -0,0 +1,31 @@
> +#!/bin/sh
> +
> +# Get file to output to
> +ARGUMENTS="$_at_"
> +OUTFILE="`echo $ARGUMENTS | awk -F ' ' '{print $1}'`"
> +if [ -z "$OUTFILE" ];
> +        then echo "Usage: $0 outputfile <package>" && exit 1;
> +fi
> +
> +if [ "$OUTFILE" == "-h" ];
> +        then echo "Usage: $0 outputfile <package>" && exit 0;
> +fi
> +
> +if [ "$OUTFILE" == "--help" ];
> +        then echo "Usage: $0 outputfile <package>" && 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
> _at_@ -0,0 +1,3 @@
> +       apk_add $_at_
> +       lsof
> +       apk_del $_at_
> diff --git a/packages/sed b/packages/sed
> new file mode 100644
> index 0000000..0d1b744
> --- /dev/null
> +++ b/packages/sed
> _at_@ -0,0 +1,4 @@
> +       apk_add $_at_
> +       echo "hello" | sed 's/hello/world/g' | grep 'world'
> +       apk_del $_at_
> +       [ `readlink /bin/sed` = /bin/busybox ]
> --
> 1.7.3.2
>
>



-- 
Jeff
---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Wed Nov 24 2010 - 22:30:23 GMT