Revision d259b27c snf-image-host/snf-image-update-helper.in
b/snf-image-host/snf-image-update-helper.in | ||
---|---|---|
149 | 149 |
add_cleanup umount "$root_dev" |
150 | 150 |
|
151 | 151 |
echo -n "Checking for cached root filesystem file \`$CACHE_FILE'..." |
152 |
if [ -f "$CACHE_FILE" ]; then
|
|
152 |
if [ -f "$CACHE_FILE" ]; then |
|
153 | 153 |
echo "found" |
154 | 154 |
|
155 |
while [[ 1 ]]; do |
|
155 |
|
|
156 |
missing_pkgs="no" |
|
157 |
if [ "$CACHE_FILE" == "$HELPER_CACHE_FILE" ]; then |
|
158 |
echo -n "Checking if needed packages are present..." |
|
159 |
if [ ! -f "$HELPER_CACHE_PKGS" ]; then |
|
160 |
missing_pkgs="yes" |
|
161 |
echo "packages file: \`$HELPER_CACHE_PKGS' does not exist" |
|
162 |
else |
|
163 |
OLD_IFS="$IFS" |
|
164 |
IFS=,; for pkg in $HELPER_EXTRA_PKGS; do |
|
165 |
if ! grep "^$pkg\$" "$HELPER_CACHE_PKGS" > /dev/null; then |
|
166 |
missing_pkgs="yes" |
|
167 |
echo "$pkg is missing." |
|
168 |
break |
|
169 |
fi |
|
170 |
done |
|
171 |
IFS="$OLD_IFS" |
|
172 |
if [ "$missing_pkgs" == "no" ]; then |
|
173 |
echo "done" |
|
174 |
fi |
|
175 |
fi |
|
176 |
if [ "$missing_pkgs" == "yes" ]; then |
|
177 |
do_debootstrap "$target" |
|
178 |
fi |
|
179 |
fi |
|
180 |
|
|
181 |
|
|
182 |
test "$missing_pkgs" == "no" && while [[ 1 ]]; do |
|
156 | 183 |
echo -n "Use the cached file [Y/n]? " |
157 | 184 |
if [ "x$NO_PROMPT" = "xyes" ]; then |
158 | 185 |
echo "y"; |
... | ... | |
168 | 195 |
break; |
169 | 196 |
fi |
170 | 197 |
done |
198 |
|
|
171 | 199 |
else |
172 | 200 |
echo "not found" |
173 | 201 |
do_debootstrap "$target" |
Also available in: Unified diff