Commit 2d7f46ec authored by OSAK Buildhauer's avatar OSAK Buildhauer

Made create_offlinerepo.sh more tool-like

parent 5fbc2ee0
#!/bin/bash #!/bin/bash
set -e set -e
set -x
iso_file="ubuntu-18.04.1-desktop-amd64.iso" usage () {
echo "usage: create_offlinerepo.sh repodir isofile [list of packages]" >&2
echo >&2
echo "Downloads all packages required to fully update the system in 'isofile' and" >&2
echo "to install the listed packages and adds them to the package archive in 'repodir'." >&2
exit 1
}
dest="$1"
shift || usage
iso_file="$1"
shift || usage
packages="$@"
workspace="/workspace" workspace="/workspace"
dest="archive"
packages="vim htop"
rm -rf "$workspace"/offlinerepo rm -rf "$workspace"/offlinerepo
mkdir -p "$workspace"/offlinerepo mkdir -p "$workspace"/offlinerepo
...@@ -23,6 +33,7 @@ apt-get -o Dir="$workspace"/offlinerepo/squashfs-root update ...@@ -23,6 +33,7 @@ apt-get -o Dir="$workspace"/offlinerepo/squashfs-root update
{ {
cd "$dest" cd "$dest"
rm -rf "$dest"/Packages.*
dpkg-scanpackages . | gzip > Packages.gz dpkg-scanpackages . | gzip > Packages.gz
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment