Merge "Add zypper element"

This commit is contained in:
Jenkins 2013-12-11 20:45:54 +00:00 committed by Gerrit Code Review
commit b89cf37104
5 changed files with 33 additions and 0 deletions

View File

@ -1,2 +1,3 @@
cache-url
dib-run-parts
zypper

10
elements/zypper/README.md Normal file
View File

@ -0,0 +1,10 @@
This element provides some customizations for zypper based distributions like
SLES and openSUSE. It works in a very similar way as the yum element does for
yum based distributions.
Zypper is reconfigured so that it keeps downloaded packages cached outside of
the build chroot so that they can be reused by subsequent image builds. The
cache increases image building speed when building multiple images, especially
on slow connections. This is more effective than using an HTTP proxy for
caching packages since the download servers will often redirect clients to
different mirrors.

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
# Disable caching packages for all repositories
sudo zypper modifyrepo --all --no-keep-packages

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
# Enable caching packages for all repositories
sudo zypper modifyrepo --all --keep-packages

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -e
[ -n "$TARGET_ROOT" ]
ZYPPER_CACHE_DIR=~/.cache/image-create/zypper
mkdir -p $ZYPPER_CACHE_DIR
sudo mount --bind $ZYPPER_CACHE_DIR $TMP_MOUNT_PATH/var/cache/zypp