Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 67a297217a487ca098f0a68f9d725c56 > files > 26

etckeeper-1.18.8-2.mga7.noarch.rpm

#!/usr/bin/sh
if [ "$1" = fmt ]; then
	# If the list format changes, change the fmt
	if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
		echo 2
	else
		echo ""
	fi
else
	# Output to stdout a *sorted* list of all currently installed 
	# (or removed but still with config-files) packages, in the
	# format "package version\n" (or something similar).
	if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then
		dpkg-query -W -f '${Status}\t${Package} ${Version} ${Architecture}\n' | \
			egrep '(ok installed|ok config-files)' | cut -f2,3
	elif [ "$LOWLEVEL_PACKAGE_MANAGER" = rpm ]; then
		rpm -qa --qf "%|epoch?{%{epoch}}:{0}|:%{name}-%{version}-%{release}.%{arch}\n" | sort
	elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacman ]; then
		pacman -Q
	elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pacmatic ]; then
		pacmatic -Q
	elif [ "$LOWLEVEL_PACKAGE_MANAGER" = pkgng ]; then
		pkg info -E "*"
	elif [ "$LOWLEVEL_PACKAGE_MANAGER" = apk ]; then
		apk info -v | sort
	fi
fi