Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding remove and purge macros for APT packages #492

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ The following process is followed to build images:
- **00-packages-nr** - As 00-packages, except these will be installed using
the ```--no-install-recommends -y``` parameters to apt-get.

- **00-packages-rm** - As 00-packages, except these will be removed using
the ```remove -y``` parameters to apt-get.

- **00-packages-pr** - As 00-packages, except these will be purged using
the ```purge -y``` parameters to apt-get.

- **00-patches** - A directory containing patch files to be applied, using quilt.
If a file named 'EDIT' is present in the directory, the build process will
be interrupted with a bash session, allowing an opportunity to create/revise
Expand Down
21 changes: 21 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ EOF
fi
log "End ${SUB_STAGE_DIR}/${i}-packages"
fi
if [ -f "${i}-packages-rm" ]; then
log "Begin ${SUB_STAGE_DIR}/${i}-packages-rm"
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-rm")"
if [ -n "$PACKAGES" ]; then
on_chroot << EOF
apt-get -o APT::Acquire::Retries=3 remove -y $PACKAGES
EOF
fi
log "End ${SUB_STAGE_DIR}/${i}-packages-rm"
fi
if [ -f "${i}-packages-pr" ]; then
Docker can be used to perform the build inside a container. This partially isolates
log "Begin ${SUB_STAGE_DIR}/${i}-packages-pr"
PACKAGES="$(sed -f "${SCRIPT_DIR}/remove-comments.sed" < "${i}-packages-pr")"
if [ -n "$PACKAGES" ]; then
on_chroot << EOF
apt-get -o APT::Acquire::Retries=3 purge -y $PACKAGES
EOF
fi
log "End ${SUB_STAGE_DIR}/${i}-packages-pr"
fi
if [ -d "${i}-patches" ]; then
log "Begin ${SUB_STAGE_DIR}/${i}-patches"
pushd "${STAGE_WORK_DIR}" > /dev/null
Expand Down