build command: improved writing back of original config
added packages support for build command