~tom-gall/live-build/integrate-linaro-media-create

« back to all changes in this revision

Viewing changes to helpers/lh_chroot_packages

  • Committer: Daniel Baumann
  • Date: 2011-03-09 17:18:28 UTC
  • Revision ID: git-v1:677415f6d7efc1e5b888570d70af311d2900c69c
Adding live-helper 1.0~a2-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
Set_defaults
18
18
 
19
19
# Requiring stage file
20
 
Require_stagefile "${LIVE_ROOT}"/.stage/bootstrap
 
20
Require_stagefile .stage/bootstrap
21
21
 
22
22
# Checking stage file
23
 
Check_stagefile "${LIVE_ROOT}"/.stage/chroot_packages
 
23
Check_stagefile .stage/chroot_packages
24
24
 
25
25
# Checking lock file
26
 
Check_lockfile "${LIVE_ROOT}"/.lock
 
26
Check_lockfile .lock
27
27
 
28
28
# Creating lock file
29
 
Create_lockfile "${LIVE_ROOT}"/.lock
 
29
Create_lockfile .lock
30
30
 
31
31
if [ -n "${LIVE_PACKAGES}" ]
32
32
then
33
33
        # Restore old cache
34
 
        if [ -d "${LIVE_ROOT}"/cache/chroot ]
 
34
        if [ -d cache/chroot ]
35
35
        then
36
 
                cp "${LIVE_ROOT}"/cache/chroot_packages/*.deb "${LIVE_CHROOT}"/var/cache/apt/archives
 
36
                cp cache/chroot_packages/*.deb chroot/var/cache/apt/archives
37
37
        fi
38
38
 
39
39
        # Installing packages
40
40
        case "${LH_APT}" in
41
 
                apt)
 
41
                apt|apt-get)
42
42
                        Chroot "apt-get install --yes ${LIVE_PACKAGES}"
43
43
                        ;;
44
44
 
50
50
        # Saving new cache
51
51
        Chroot "apt-get autoclean"
52
52
 
53
 
        if ls "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb &> /dev/null
 
53
        if ls chroot/var/cache/apt/archives/*.deb &> /dev/null
54
54
        then
55
 
                if [ ! -d "${LIVE_ROOT}"/cache/chroot_packages ]
 
55
                if [ ! -d cache/chroot_packages ]
56
56
                then
57
 
                        mkdir -p "${LIVE_ROOT}"/cache/chroot_packages
 
57
                        mkdir -p cache/chroot_packages
58
58
                fi
59
59
 
60
 
                mv -f "${LIVE_CHROOT}"/var/cache/apt/archives/*.deb "${LIVE_ROOT}"/cache/chroot_packages
 
60
                mv -f chroot/var/cache/apt/archives/*.deb cache/chroot_packages
61
61
        fi
62
62
 
63
63
        # Creating stage file
64
 
        Create_stagefile "${LIVE_ROOT}"/.stage/chroot_packages
 
64
        Create_stagefile .stage/chroot_packages
65
65
fi