* Update generate_packages.sh structure to split its code to separate
steps
* Add update_flake to generate_packages script
* Add generate_packages package to nix packages to be able to run
`nix run .#generate_packages` with no need to install dependencies
manually
Change-Id: Ic28107829a6e04d3831ccb8a7257164875f35938
* use `mktemp -d` for temporary files
* use trap to remove temporary files
* fix some shellcheck warnings
Change-Id: Ib73f5a52d7bcd21232e7ef31a815c28a06dcd857