processing with state and package type

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>