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

packages install: local are installed before remote #127

Closed osallou closed 10 years ago

osallou commented 10 years ago

Hi Anders, your latest fix works fine to launch package install. I face however an issue we discussed before.Local packages are installed first. But, in my case, I need to install remote deps before installing local package. Both scenarii are possible.

How can we manage this ? One possibility would be to force the install of local packages even if some deps are missing (and will be fixed by next remote package install).

Olivier

andsens commented 10 years ago

It really is a bit of a conundrum. I was thinking to choose the order depending on which scenario occurs more often and then simply require whatever task needs to do it the other way around to install it manually. This does not work with packages specified in the manifest though

Your solution:

How can we manage this ? One possibility would be to force the install of local packages even if some deps are missing (and will be fixed by next remote package install).

Is the best option right now I think. What happens if a dependency cannot be satisfied?

andsens commented 10 years ago

I was also thinking: Is it somehow possible to install local packages at the same time as you install remote packages? This would entirely solve the problem.

osallou commented 10 years ago

Indeed, mixing local and remote would allow to do it in the order you expect.

Could be something like:

"packages":
    [  "remote1", "remote2", { name: "path_to_local1" :  target: "local" }, "remote3", ... ]

Local packages could be defined the same way than remote with a specific target, but the target "local" would be a special target executing the dpkg command.

I can this way instead some remote first then a specific local package then again some remote etc....

The only inconvenient is to install rmeote packages one by one instead of possibily executing an apt-get install command for all of the array.

andsens commented 10 years ago

I was actually talking about passing the local packages in to the apt-get invocation, but that simply isn't possible. Your solution is perfect, and you don't need to install things one by one, you can group remote and local packages together. If you have [remote, remote, remote, local, local, remote, local] all you need is 4 invocations.

andsens commented 10 years ago

Go ahead and try it. I also added a trusted-keys option in packages so you can add public keys from other repositories.

osallou commented 10 years ago

I have an error: match = remote.match(package).groupdict() AttributeError: 'NoneType' object has no attribute 'groupdict'

I think it is a definition error from my side.

Would you have a sample example of packages definition with your latest updates?

I do not see really what is expected def for packages:

  "anyOf": [
             { "pattern": "^[^/]+(/[^/]+)?$" },
            { "$ref": "#/definitions/absolute_path" }
 ]
andsens commented 10 years ago

Oh ffs. That's my fault, I didn't really test with local packages. the groupdict() should be called once we have determined whether we actually have a match.