#10 FlatpakBuilder: Add end-of-life and end-of-life-rebase
Merged 3 years ago by kalev. Opened 3 years ago by kalev.
kalev/flatpak-module-tools end-of-life  into  master

@@ -683,15 +683,21 @@ 


          runtime_ref = 'runtime/{id}/{arch}/{branch}'.format(**args)


-         subprocess.check_call(['ostree', 'commit',

-                                '--repo', repo, '--owner-uid=0',

-                                '--owner-gid=0', '--no-xattrs',

-                                '--canonical-permissions',

-                                '--branch', runtime_ref,

-                                '--add-metadata-string', 'xa.metadata=' + metadata,

-                                '-s', 'build of ' + runtime_ref,

-                                '--tree=tar=' + tarred_filesystem,

-                                '--tree=dir=' + builddir])

+         commit_args = ['--repo', repo, '--owner-uid=0',

+                        '--owner-gid=0', '--no-xattrs',

+                        '--canonical-permissions',

+                        '--branch', runtime_ref,

+                        '-s', 'build of ' + runtime_ref,

+                        '--tree=tar=' + tarred_filesystem,

+                        '--tree=dir=' + builddir,

+                        '--add-metadata-string', 'xa.metadata=' + metadata]


+         if 'end-of-life' in info:

+             commit_args += ['--add-metadata-string', 'ostree.endoflife=' + info['end-of-life']]

+         if 'end-of-life-rebase' in info:

+             commit_args += ['--add-metadata-string', 'ostree.endoflife-rebase=' + info['end-of-life-rebase']]


+         subprocess.check_call(['ostree', 'commit'] + commit_args)

          subprocess.check_call(['ostree', 'summary', '-u', '--repo', repo])


          subprocess.check_call(['flatpak', 'build-bundle', repo,
@@ -753,6 +759,10 @@ 

              args = ['flatpak', 'build-export', repo, builddir, app_branch]

              if disable_sandbox:

                  args += ['--disable-sandbox']

+             if 'end-of-life' in info:

+                 args += ['--end-of-life' + info['end-of-life']]

+             if 'end-of-life-rebase' in info:

+                 args += ['--end-of-life-rebase' + info['end-of-life-rebase']]



          with open(os.devnull) as devnull:

end-of-life allows marking apps and runtimes as EOL. This is mostly
useful for runtimes where we can then mark older versions that are no
longer supported as EOL, so that they can be removed by client software.

end-of-life-rebase makes it possible to rename app IDs, so that users
get automatically migrated to the new ID. This commit wires it up for
runtimes as well, but I expect it won't get used there.

@otaylor Does this look good to you? If it does, I'd like to merge this (and get this fix and the xa.metadata addition from the other PR deployed in infra so we can rebuild the F30 runtime with the EOL marking before F30 goes EOL in Bodhi) and then after that I can submit PRs for docs for the new end-of-life and end-of-life-rebase yaml keys.

Looks fine to me to merge to me

Pull-Request has been merged by kalev

3 years ago