Optdepends bugs

From ArchWiki

Jump to: navigation, search

Contents

Introduction

If we ever want to do anything useful with optdepends (see User:Allan/Pacman_OptDepends), we need to enforce a strict optdepends syntax.

There was one suggested syntax in the man page, but sadly it was not enforced. The future makepkg version will make sure this syntax is respected :

optdepends=('fakeroot: for makepkg usage as normal user')

That is, a single and valid package name, immediately followed by a colon and a description. The colon and the description are optional.

Examples of invalid optdepends

'tcl, python and/or ruby: to use corresponding binding'

Only one package name can be specified on each line

'xorg-fonts-75dpi : X bitmap fonts needed for the interface'

No space or anything else between the package name and the colon.

'ruby-htmlentities (AUR): for one provider named Deastore'

The (AUR) information should either be removed or moved to the description.

'xpdf - for pdf'

It should be a colon, not a dash.

Checking script

#!/bin/bash

source /etc/makepkg.conf

pkglist=$(pacman -Slq)

for repo in core extra community; do
	echo ==$repo==
	find /var/abs/$repo -name PKGBUILD | sort |
	while read pkgbuild
	do
		source $pkgbuild
		i=0
		declare -a errors=()
		for opt in "${optdepends[@]}"; do
			pkg=${opt%%:*}
			desc=${opt#*:}
			if ! (echo "$pkglist" | grep -q "^${pkg}$"); then
				if ! pacman -Spd "$pkg" --noconfirm &>/dev/null; then
					if [ $(slurpy -i "$pkg" 2>/dev/null | wc -l) -gt 1 ]; then
						continue
					fi
					errors[$i]="'$opt'"
					(( i++ ))
				fi
			fi
		done
		if [ $i -gt 0 ]; then
			echo "* $pkgname :"
			(grep -o "Maintainer.*" $pkgbuild || grep -o "Contributor.*" $pkgbuild) |
			sed -e 's/^/ /'
			for error in "${errors[@]}"; do
				echo " $error"
			done
		fi

		unset optdepends
	done
done

# vim: set ts=2 sw=2 noet:

Bug Reports

for extra : FS#16053 for community : FS#16052

Everything has been fixed ! Only 3 extra packages fixed in svn, waiting for a rebuild : avahi, avidemux, moc --shining 06:32, 8 November 2009 (EST)

Personal tools