Page 1 of 1
Modifying the machine package control file
Published: April 30, 2024 - 8:42 AM
by Carla Scardigli
Good morning,
I would like to be able to modify the "control" file of the machine package within a WAPT package.
For now, I am able to display it.
Here is the code that displays it:
Code: Select all
def install():
w = common.Wapt()
package = PackageEntry(w.host_uuid)
# Récupère les fichiers control de tous les paquets présent sur la machine
package_version = package.get("package_uuid")
l = w.list()
# Parcours ces fichiers
for elt in l:
# Si le nom du paquet est celui du paquet machine on l'affiche
if elt["package"] == w.host_uuid:
print(elt)
This code displays all the contents of the "control" file in the machine package.
I tried this:
This code displays the "control" file with the "depends" section empty, but this change is not saved.
I also couldn't find where this file is stored on the machine.
Do you have any idea how to do it?
Re: Modifying the machine package control file
Published: April 30, 2024 - 11:01 AM
by sfonteneau
Hello,
I don't understand what you're trying to do.
It seems you want to modify a machine package in WAPT.install.
However, the machine that will install the package doesn't have the private key needed to sign it (fortunately), and the machine doesn't have access to upload packages (fortunately).
In my opinion, there's probably something we can suggest, but you'd need to explain the exact context and purpose of what you want to do.
Re: Modifying the machine package control file
Published: May 3, 2024 - 12:05 PM
by Carla Scardigli
Good morning,
This request is related to the following request:
viewtopic.php?t=3833
We would like it so that when a packet has successfully passed through the machine (
Status OK) a code
removes the dependency from the machine package.
The script that would perform this deletion could be added to
the audit (For example)
Because we manage a fairly large number of packages and it is unnecessary to have dozens of dependent packages.
Our idea was therefore to remove this package (its name) from the "
depends"of the file"
control" from the machine package (package name = uuid)
We have this in the control file of the machine package:
After the code has executed, we would like to have this:
(part "
depends" empty)
As explained previously, we have a code that allows us to
display this file "
control"but we are unable to change it.".
How can we do it?
Do you have any other ideas for removing this dependency?
Re: Modifying the machine package control file
Published: May 3, 2024 - 3:33 PM
by dcardon
Hello Carla,
the machine package must be signed, so a signing key is required to modify the machine package's control file. The machine doesn't have a key, so it can't modify the control file because it can't be signed (or uploaded), and therefore the modified package will be useless.
Modifying the machine package can be done at the admin console level (which has a signing key) or with an automated script on the server, preferably using a key that isn't code-signing.
That said, could you clarify your needs? Having the package remain assigned to the machine allows for automatic application updates or reinstallation if it was accidentally deleted. Do you want to remove all dependencies from a machine package, or just a package that isn't intended to remain there?
Sincerely,
Denis
Re: Modifying the machine package control file
Published: May 6, 2024 - 08:13
by Carla Scardigli
Hello,
Accidental uninstallation is virtually impossible in our processes.
We need to be able to remove all dependencies of the `machine` package. When we clean our repository, packages dependent on the `machine` package return an error.
Thank you for helping us find a solution.
Sincerely,