tazpkg rev 896

Module 'convert': support .pet packages without *pet.specs inside
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Dec 21 01:45:15 2015 +0200 (2015-12-21)
parents 9575613271cf
children d034a2d99e3a
files modules/convert
line diff
     1.1 --- a/modules/convert	Sun Dec 20 22:59:00 2015 +0200
     1.2 +++ b/modules/convert	Mon Dec 21 01:45:15 2015 +0200
     1.3 @@ -366,16 +366,24 @@
     1.4  	parse_pkgname .pet
     1.5  	busybox tar -xzf "$PACKAGE_FILE"
     1.6  
     1.7 -	PET_SPECS="$(find $TMP_DIR -maxdepth 2 -name 'pet.specs')"
     1.8 +	# Get package description
     1.9 +	PET_SPECS="$(find $TMP_DIR -maxdepth 2 -type f -name 'pet.specs')"
    1.10  	if [ -e "$PET_SPECS" ]; then
    1.11  		debug "pet.specs with '|'"
    1.12  		desc="$(awk -F'|' '{print $10}' $PET_SPECS)"
    1.13 -		debug "desc='$desc'"
    1.14  	else
    1.15 -		# TODO: I need to have '.pet' file that will work this way!
    1.16 -		. $package*/*.specs
    1.17 -		desc="$PETMENUDESCR"
    1.18 +		PET_SPECS="$(find $TMP_DIR -maxdepth 2 -type f -name '*.pet.specs')"
    1.19 +		if [ -e "$PET_SPECS" ]; then
    1.20 +			desc="$(. "$PET_SPECS"; echo "$PETMENUDESCR")"
    1.21 +		else
    1.22 +			DESKTOP="$(find $TMP_DIR -type f -name '*.desktop' | head -n1)"
    1.23 +			if [ -n "$DESKTOP" ]; then
    1.24 +				desc="$(awk -F'=' '($1=="Name"){print $2}' $DESKTOP)"
    1.25 +			fi
    1.26 +		fi
    1.27  	fi
    1.28 +	[ -z "$desc" ] && desc="$package"
    1.29 +	debug "desc='$desc'"
    1.30  	mv $package*/ fs
    1.31  	finish_convert_puppy
    1.32  }