live-build/scripts/build/source_live

63 lines
1.3 KiB
Plaintext
Raw Normal View History

2007-09-23 08:04:47 +00:00
#!/bin/sh
## live-build(7) - System Build Scripts
## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program 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:47 +00:00
set -e
2007-09-23 08:05:11 +00:00
# Including common functions
[ -e "${LIVE_BUILD}/scripts/build.sh" ] && . "${LIVE_BUILD}/scripts/build.sh" || . /usr/lib/live/build.sh
2007-09-23 08:04:47 +00:00
2007-09-23 08:05:11 +00:00
# Setting static variables
2013-07-01 14:50:08 +00:00
DESCRIPTION="$(Echo 'copy live config into source')"
2007-09-23 08:04:48 +00:00
HELP=""
USAGE="${PROGRAM} [--force]"
Arguments "${@}"
2007-09-23 08:04:47 +00:00
# Reading configuration files
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
2007-09-23 08:04:47 +00:00
Set_defaults
if [ "${LB_SOURCE}" != "true" ]
2007-09-23 08:04:47 +00:00
then
2007-09-23 08:04:50 +00:00
exit 0
fi
2007-09-23 08:04:47 +00:00
Echo_message "Begin copying live-build configuration..."
2007-09-23 08:05:11 +00:00
2007-09-23 08:04:50 +00:00
# Requiring stage file
Require_stagefile .build/config .build/bootstrap
2007-09-23 08:04:47 +00:00
2007-09-23 08:04:50 +00:00
# Checking stage file
2013-07-01 14:50:08 +00:00
Check_stagefile .build/source_live
2007-09-23 08:04:47 +00:00
2007-09-23 08:04:50 +00:00
# Checking lock file
Check_lockfile .lock
2007-09-23 08:04:47 +00:00
2007-09-23 08:04:50 +00:00
# Creating lock file
Create_lockfile .lock
2007-09-23 08:04:47 +00:00
2007-09-23 08:04:50 +00:00
# Remove old sources
2013-07-01 14:50:08 +00:00
if [ -d source/live ]
2007-09-23 08:04:50 +00:00
then
2013-07-01 14:50:08 +00:00
rm -rf source/live
2007-09-23 08:04:50 +00:00
fi
2007-09-23 08:04:47 +00:00
2007-09-23 08:04:50 +00:00
# Copy system configuration
2013-07-01 14:50:08 +00:00
mkdir -p source/live
cp -a config source/live
2007-09-23 08:04:47 +00:00
if Find_files auto/*
then
2013-07-01 14:50:08 +00:00
cp -a auto source/live
fi
2007-09-23 08:04:50 +00:00
# Creating stage file
2013-07-01 14:50:08 +00:00
Create_stagefile .build/source_live