~ubuntu-branches/ubuntu/saucy/cdebootstrap/saucy

« back to all changes in this revision

Viewing changes to src/download.c

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2008-05-05 11:47:32 UTC
  • Revision ID: james.westby@ubuntu.com-20080505114732-y8wv2nswph52qlwe
Tags: 0.5.1ubuntu1
* Merge from Debian unstable (Fix LP: #223442).
  Remaining Ubuntu changes:
  - Set NO_PKG_MANGLE while building nested package
  - Update maintainer field in debian/control
* config/suites:
  - Add Intrepid to known distributions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
19
 *
20
20
 * $LastChangedBy: bastian $
21
 
 * $LastChangedDate: 2007-05-13 21:11:02 +0000 (So, 13 Mai 2007) $
22
 
 * $LastChangedRevision: 1450 $
 
21
 * $LastChangedDate: 2008-02-27 16:16:49 +0100 (Mi, 27 Feb 2008) $
 
22
 * $LastChangedRevision: 1543 $
23
23
 */
24
24
 
25
25
#include <config.h>
32
32
#include <unistd.h>
33
33
 
34
34
#include "check.h"
 
35
#include "download.h"
35
36
#include "execute.h"
36
37
#include "frontend.h"
37
 
#include "download.h"
 
38
#include "gpg.h"
38
39
#include "packages.h"
39
 
#include "prepare.h"
 
40
#include "target.h"
40
41
 
41
42
int decompress_file (const char *file, const char *extension)
42
43
{
71
72
    if (authentication)
72
73
      log_message (LOG_MESSAGE_ERROR_DOWNLOAD_RETRIEVE, "Release.gpg");
73
74
  }
74
 
  else if (check_release (target, target1))
 
75
  else if (gpg_check_release (target, target1))
75
76
    log_message (authentication ? LOG_MESSAGE_ERROR_DOWNLOAD_VALIDATE : LOG_MESSAGE_WARNING_DOWNLOAD_VALIDATE, "Release");
76
77
 
77
78
  log_message (LOG_MESSAGE_INFO_DOWNLOAD_PARSE, "Release");
79
80
  if (!(ret = di_release_read_file (target)))
80
81
    log_message (LOG_MESSAGE_ERROR_DOWNLOAD_PARSE, "Release");
81
82
 
 
83
  if (!suite && suite_use (ret->codename))
 
84
    return NULL;
 
85
 
82
86
  return ret;
83
87
}
84
88
 
188
192
 
189
193
int download (di_packages **packages, di_packages_allocator **allocator, di_slist **install)
190
194
{
191
 
  int ret;
192
 
 
193
195
  *allocator = di_packages_allocator_alloc ();
194
196
  if (!*allocator)
195
197
    return 1;
196
198
 
197
199
  *packages = download_indices (*allocator);
198
 
  if (!packages)
 
200
  if (!*packages)
199
201
    return 1;
200
202
 
201
203
  (*install) = suite_packages_list (*packages, *allocator);
202
204
  if (!*install)
203
 
    log_text (DI_LOG_LEVEL_ERROR, "Couldn't not build installation list!");
204
 
 
205
 
  ret = download_debs (*install);
206
 
  if (ret)
207
 
    return 1;
208
 
 
209
 
  return 0;
 
205
    log_text (DI_LOG_LEVEL_ERROR, "Couldn't build installation list");
 
206
 
 
207
  return download_debs (*install);
210
208
}
211
209
 
212
210
int download_init (void)
213
211
{
214
 
  return prepare_download ();
 
212
  target_create_dir ("/var");
 
213
  target_create_dir ("/var/cache");
 
214
  target_create_dir ("/var/cache/bootstrap");
 
215
  return 0;
215
216
}
216
217