#!/bin/sh

# FIXME: debian:squeeze It's unable to run `pacman -Sy`
im ubuntu:14.04 debian:wheezy

# Remove `docker-clean` because we need *.deb files under /var/cache
in ! rm -fv /etc/apt/apt.conf.d/docker-clean
ou ^removed .*docker-clean

# Update package databses
in -Sy

# Simple query that lists all packages
in -Qq
ou ^apt$

# Listing with version and packge name
in -Q
# ou ^ii +apt +.+ubuntu
ou ^ii +apt +

# Information of `apt`
in -Qi apt
ou ^Package: apt$
ou ^Status: install ok installed$
ou ^Priority: important$

# File listing for `apt`
in -Ql apt
ou ^/usr/bin/apt-key

# File listing (all packages)
# FIXME: Debian-squeeze doesn't have /usr/bin/apt
in -Ql
ou ^apt /usr/bin/apt-key$

# File listing (all packages), files only
in -Qql
ou ^/usr/bin/apt-key$

# Look up package name
in -Qo /bin/bash
ou ^bash: /bin/bash$

# Install and Deinstall a package
in ! echo Y | pacman -S screen
in ! echo Y | pacman -R screen
in -Qi screen
ou ^Status: deinstall

# Query information from a .deb package
in ! export DEB_FILE=`find /var/cache/apt/ -type f -iname "screen*.deb"`
in -Qp $DEB_FILE
ou ^ Package: screen

# Clean up package databases
in -Sc
in clear
in -sS tmux
ou tmux

# Strong cleaning up
in -Sccc
in clear
in -sS tmux
ou empty
