remove.sh 1.6 KB
Newer Older
Daniel Bissani Furlin's avatar
Daniel Bissani Furlin committed
1
#!/usr/bin/env bash
2
# shellcheck disable=SC1090
3 4 5 6 7 8
#
# Copyright (C) 2017 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of create-iso
#
9
# create-iso is free software; you can redistribute it and/or
10 11 12 13 14 15 16 17 18 19 20 21 22
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
23

sulzbach's avatar
sulzbach committed
24 25 26
# PROFILE="$1"
# NAME="$2"
# WEBSITE="$3"
sulzbach's avatar
sulzbach committed
27 28 29 30 31 32 33 34
# TMP="$4"
CHROOTDIR="$5"
# CACHEDIR="$6"
PKGLIST="$7"
# SOURCESLIST="$8"
# REPO="$9"
# KEYURL="${10}"
# DBG="${11}"
sulzbach's avatar
sulzbach committed
35

sulzbach's avatar
sulzbach committed
36
source "${PREFIX}/include/chroot.sh"
37

sulzbach's avatar
sulzbach committed
38 39 40 41
add_to_chroot_file "${CHROOTDIR}" \
"apt-get --yes purge \
$(grep --invert-match "^#" < "${PKGLIST}/remove.list") || \
create_iso_logger --message \"Unable to purge listed packages\" --script \
sulzbach's avatar
sulzbach committed
42
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"apt-get\""
sulzbach's avatar
sulzbach committed
43 44 45
add_to_chroot_file "${CHROOTDIR}" \
"apt-get --yes autoremove || \
create_iso_logger --message \"Unable to autoremove unused packages\" --script \
sulzbach's avatar
sulzbach committed
46
\"$(basename "${BASH_SOURCE[0]}")\" --line \"${LINENO}\" --tag \"apt-get\""
47 48

exit 0