source: live-build/trunk/fuentes/scripts/build/lb_chroot_package-lists @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/sh
2
3## live-build(7) - System Build Scripts
4## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
5##
6## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7## This is free software, and you are welcome to redistribute it
8## under certain conditions; see COPYING for details.
9
10
11set -e
12
13# Including common functions
14( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
15
16# Setting static variables
17DESCRIPTION="$(Echo 'queue install of package lists into chroot')"
18HELP=""
19USAGE="${PROGRAM} {install|live} [--force]"
20
21_PASS="${1}"
22shift
23
24Arguments "${@}"
25
26# Reading configuration files
27Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
28Set_defaults
29
30Echo_message "Begin queueing installation of package lists (${_PASS} pass)..."
31
32# Requiring stage file
33Require_stagefile .build/config .build/bootstrap
34
35# Checking stage file
36Check_stagefile .build/chroot_package-lists.${_PASS}
37
38# Checking lock file
39Check_lockfile .lock
40
41# Creating lock file
42Create_lockfile .lock
43
44# Handling local package lists
45if ls config/package-lists/*.list > /dev/null 2>&1 || \
46   ls config/package-lists/*.list.chroot > /dev/null 2>&1 || \
47   ls config/package-lists/*.list.chroot_${_PASS} > /dev/null 2>&1
48then
49        case "${LB_BUILD_WITH_CHROOT}" in
50                true)
51                        # Checking depends
52                        Check_package chroot/usr/bin/grep-aptavail dctrl-tools
53
54                        # Restoring cache
55                        Restore_cache cache/packages.chroot
56
57                        # Installing depends
58                        Install_package
59                        ;;
60
61                false)
62                        if [ ! -e /usr/bin/grep-aptavail ]; then
63                                # dctrl-tools
64                                Echo_error "/usr/bin/grep-aptavail - no such file."
65                                exit 1
66                        fi
67                        ;;
68        esac
69
70        if [ -e "${LIVE_BUILD}/share/bin/Packages" ]
71        then
72                cp "${LIVE_BUILD}/share/bin/Packages" chroot/bin
73        else
74                cp /usr/share/live/build/bin/Packages chroot/bin
75        fi
76
77        for LIST in config/package-lists/*.list \
78                    config/package-lists/*.list.chroot \
79                    config/package-lists/*.list.chroot_${_PASS}
80        do
81                if [ -e "${LIST}" ]
82                then
83                        # Generating package list
84                        Expand_packagelist "$(basename ${LIST})" "config/package-lists" \
85                                >> chroot/root/packages.chroot
86                fi
87        done
88
89        rm -f chroot/bin/Packages
90
91        case "${LB_BUILD_WITH_CHROOT}" in
92                true)
93                        # Removing dctrl-tools again if the user has not installed it
94                        if ! grep -qs dctrl-tools chroot/root/packages.chroot
95                        then
96                                # Removing depends
97                                Remove_package
98                        fi
99
100                        # Saving cache
101                        Save_cache cache/packages.binary
102                        ;;
103        esac
104
105        # Creating stage file
106        Create_stagefile .build/chroot_package-lists.${_PASS}
107fi
Note: See TracBrowser for help on using the repository browser.