This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=131eef880f8d0b87cbb0918822d0c03294957d20

commit 131eef880f8d0b87cbb0918822d0c03294957d20
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Feb 7 00:33:48 2022 +0100

    u-a: Move filename generation outside alternative setup
    
    This is common to both symlinks being created, move it out of the code
    block, so that we might be able to conditionalize the first block to
    avoid doing redundant work if it does not need to change.
    
    Changelog: internal
---
 utils/update-alternatives.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c
index da2d4119e..f02426ddc 100644
--- a/utils/update-alternatives.c
+++ b/utils/update-alternatives.c
@@ -2015,9 +2015,10 @@ alternative_prepare_install_single(struct alternative 
*a, const char *name,
                free(root_altdir);
        }
 
+       fn = xasprintf("%s/%s", altdir, name);
+
        /* Create link in /etc/alternatives. */
        fntmp = xasprintf("%s/%s" ALT_TMP_EXT, altdir, name);
-       fn = xasprintf("%s/%s", altdir, name);
        fsys_symlink(file, fntmp);
        alternative_add_commit_op(a, OPCODE_MV, fntmp, fn);
        if (fsys_pathname_is_missing(fn))

-- 
Dpkg.Org's dpkg

Reply via email to