[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tyndur-devel] [PATCH] Added script to automatically build a lpt-repo



On Sat, Jan 17, 2015 at 08:56:19PM +0100, Moritz Grosch (LittleFox) wrote:
> From: "Moritz Grosch (LittleFox)" <littlefox@xxxxxxxx>
> 
> This script builds a lpt-repository from the lbuilds packages-directory
> and automatically generates an index.
> 
> Currently it doesn't set a real description and is limited to i386.

Kannst du deine Patches nochmal mit Signed-off-by und deutschen
Commitkommentaren schicken? Beim anderen Patch dürften auch 512 MB für
die nächste Zeit reichen.

> +PACKAGE_DIRECTORY=$1
> +DESTINATION_DIRECTORY=$2
> +
> +if [ ! -d "$DESTINATION_DIRECTORY" ]; then
> +	mkdir -p "$DESTINATION_DIRECTORY"
> +else
> +	rm -rf $DESTINATION_DIRECTORY/*
> +fi
> +
> +for file in $PACKAGE_DIRECTORY/*
> +do
> +	extension=${file##*.}
> +
> +	if [ $extension == "tar" ]
> +	then

Wie wäre es mit 'for file in $PACKAGE_DIRECTORY/*.tar'? Oder wäre das zu
einfach? ;-)

> +		filename=${file##*/}
> +		filenamewithoutsuffix=${file%.*}
> +		packagename=${filename%-*}
> +		packageversion=${filenamewithoutsuffix##*-}
> +
> +		if [[ $packagename == lib* ]]; then
> +			type="lib"
> +                else
> +			type="bin"
> +                fi
> +
> +		echo "P $packagename" >> "$DESTINATION_DIRECTORY/packages.i386"
> +		echo "D no description" >> "$DESTINATION_DIRECTORY/packages.i386"
> +		echo "S $type" >> "$DESTINATION_DIRECTORY/packages.i386"
> +		echo "V $packageversion" >> "$DESTINATION_DIRECTORY/packages.i386"
> +		echo "s $(ls -l $PACKAGE_DIRECTORY | grep $filename | awk '{print $5}')" >> "$DESTINATION_DIRECTORY/packages.i386"

Und hier 'ls -l $file | awk ...'?

> +
> +		echo "" >> "$DESTINATION_DIRECTORY/packages.i386"
> +
> +		cp "$file" "$DESTINATION_DIRECTORY/$packagename-$type-$packageversion-i386.tar"
> +	fi
> +done

Kevin