Fixed lacking newline when writing.

Signed-off-by: Kouhei Maeda <mkouhei@palmtb.net>
Added put packages queue function.

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