2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2012-02-04 19:41:41 -01:00
|
|
|
## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
|
|
|
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Including common functions
|
2012-07-19 17:37:26 +00:00
|
|
|
( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2007-09-23 08:05:11 +00:00
|
|
|
# Setting static variables
|
2010-11-23 10:31:15 -01:00
|
|
|
DESCRIPTION="$(Echo 'queue install of package lists into chroot')"
|
2007-09-23 08:04:48 +00:00
|
|
|
HELP=""
|
2011-06-11 14:36:44 +00:00
|
|
|
USAGE="${PROGRAM} {install|live} [--force]"
|
|
|
|
|
|
|
|
_PASS="${1}"
|
|
|
|
shift
|
2007-09-23 08:04:48 +00:00
|
|
|
|
|
|
|
Arguments "${@}"
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Reading configuration files
|
2008-10-28 14:26:17 -01:00
|
|
|
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
|
2007-09-23 08:04:46 +00:00
|
|
|
Set_defaults
|
|
|
|
|
2011-06-11 14:36:44 +00:00
|
|
|
Echo_message "Begin queueing installation of package lists (${_PASS} pass)..."
|
2007-09-23 08:04:49 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Requiring stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Require_stagefile .build/config .build/bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Check_stagefile .build/chroot_package-lists.${_PASS}
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Creating lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2012-07-28 21:29:14 +00:00
|
|
|
# Checking depends
|
|
|
|
Check_package chroot/usr/bin/grep-aptavail dctrl-tools
|
|
|
|
|
|
|
|
# Restoring cache
|
|
|
|
Restore_cache cache/packages.chroot
|
|
|
|
|
|
|
|
# Installing depends
|
|
|
|
Install_package
|
|
|
|
|
2011-08-16 18:49:36 +00:00
|
|
|
# Handling local package lists
|
|
|
|
if ls config/package-lists/*.list > /dev/null 2>&1 || \
|
|
|
|
ls config/package-lists/*.list.chroot > /dev/null 2>&1 || \
|
|
|
|
ls config/package-lists/*.list.chroot_${_PASS} > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
for LIST in config/package-lists/*.list \
|
|
|
|
config/package-lists/*.list.chroot \
|
|
|
|
config/package-lists/*.list.chroot_${_PASS}
|
|
|
|
do
|
|
|
|
if [ -e "${LIST}" ]
|
|
|
|
then
|
|
|
|
# Generating package list
|
|
|
|
Expand_packagelist "$(basename ${LIST})" "config/package-lists" \
|
2011-09-07 13:59:48 +00:00
|
|
|
>> chroot/root/packages.chroot
|
2011-08-16 18:49:36 +00:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Creating stage file
|
2012-06-03 20:42:41 +00:00
|
|
|
Create_stagefile .build/chroot_package-lists.${_PASS}
|
2011-08-16 18:49:36 +00:00
|
|
|
fi
|
2012-07-28 21:29:14 +00:00
|
|
|
|
|
|
|
# Saving cache
|
|
|
|
Save_cache cache/packages.binary
|
|
|
|
|
|
|
|
# Removing dctrl-tools again if the user has not installed it
|
|
|
|
if ! grep -qs dctrl-tools chroot/root/packages.chroot
|
|
|
|
then
|
|
|
|
# Removing depends
|
|
|
|
Remove_package
|
|
|
|
fi
|