Skip to content

Commit

Permalink
dnf.mark: mark packages in DNF state database
Browse files Browse the repository at this point in the history
This adjustment allows the definition of the mark with the RPMs and runs
DNF after installing the RPMs to put the proper markings in the DNF
state database. See osbuild#455.

This ensures that packages don't get removed during `autoremove` leading
to broken systems.
  • Loading branch information
supakeen committed Jun 27, 2023
1 parent c90b587 commit a511053
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions stages/org.osbuild.dnf.mark
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/python3
"""
Mark packages in the DNF state database.
"""

import sys

from osbuild import api

SCHEMA_2 = """
"options": {
"additionalProperties": false,
"properties": {
"packages": {
"type": "array",
"minItems": 1,
"description": "Packages and their marks.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Package name."
},
"mark": {
"type": "string",
"enum": ["user", "dependency"],
"description": "Package mark."
}
}
}
}
}
}
"""


def main(tree, options):
return 0


if __name__ == "__main__":
args = api.arguments()
r = main(args["tree"], args["options"])
sys.exit(r)

0 comments on commit a511053

Please sign in to comment.