andsens / build-debian-cloud

This project has been superseeded by andsens/bootstrap-vz and is no longer maintained - Script to create Debian Squeeze & Wheezy Amazon Machine Images (AMIs) and Google Compute Engine images
Other
116 stars 43 forks source link

usage of "packages" #126

Closed osallou closed 10 years ago

osallou commented 10 years ago

Hi, I tried to use latest python branch and setup "packages" to install local and remote package.

I have defined:

    "packages": {
            "remote": [ "openssh-server", ... ],
            "local":  [  "path_package1", ...]
    },

but it ends with error:

Traceback (most recent call last):
 File "./build-debian-cloud", line 6, in <module>
    main()
  File "/home/symbiose/osallou/build-debian/build-new/build-debian-cloud/base/main.py", line 10, in main
     run(args)
  File "/home/symbiose/osallou/build-debian/build-new/build-debian-cloud/base/main.py", line 35, in run
    bootstrap_info = BootstrapInformation(manifest=manifest, debug=args.debug)
  File "/home/symbiose/osallou/build-debian/build-new/build-debian-cloud/base/bootstrapinfo.py", line 50, in __init__
    self.packages = PackageList(self.manifest.packages, self.manifest_vars, self.source_lists)
  File "/home/symbiose/osallou/build-debian/build-new/build-debian-cloud/base/pkg/packagelist.py", line 16, in __init__
    self.add(package, None)
  File "/home/symbiose/osallou/build-debian/build-new/build-debian-cloud/base/pkg/packagelist.py", line 35, in add
    raise PackageError(msg)
base.pkg.exceptions.PackageError: The target release wheezy was not found in the sources list

It seems to expect a wheezy definition in sources list.

I do not know if this is an error or a problem of definition, but looking at base manifest, it does not seem to require a different definition.

The code: if not self.source_lists.target_exists(target):

expect to find the target of package in source_lists, in my case it matches the default ie {system.release}

Thanks

andsens commented 10 years ago

oh balls! I know exactly what the problem is: 0612987fec88712921d73a334b37f4cffcd6fcb7. Instead of adding the packages right at the beginning, there should be a task that adds these packages and succeeds AddDefaultSources.

I did it this way because there actually might be a scenario where you want to replace the default mirrors with something completely different. If you have those hardcoded however, you can't remove that task from the list.

osallou commented 10 years ago

what do you mean by "If you have those hardcoded" ?

I just add a list of package to install with the "packages" tag in manifest.

What should I do ? Is it a bug?

andsens commented 10 years ago

It's a bug :-) I am fixing it right now

andsens commented 10 years ago

There you go, fixed! :-) Also added a few other niceties.