#876 koji clone-tag raises "UnboundLocalError"
Closed: Fixed Opened by tkopecek.

$ koji clone-tag --all test-test-test test-test-test-2
UnboundLocalError: local variable 'build' referenced before assignment

Reproducer:
tl;dr; Have a tag with a blocked package, clone that tag, then modify the cloned tag (add a package there), then try to clone the first tag to the second tag again, it will fail.

$ koji add-tag test-test-test
$ koji add-pkg --owner xyz test-test-test bash
Adding 1 packages to tag test-test-test
$ koji block-pkg test-test-test bash
$ koji list-pkgs --show-blocked --tag test-test-test
Package                 Tag                     Extra Arches     Owner          
----------------------- ----------------------- ---------------- ---------------
bash                    test-test-test                           xyz         [BLOCKED]
$ koji clone-tag --all test-test-test test-test-test-2
$ koji list-pkgs --show-blocked --tag test-test-test-2
Package                 Tag                     Extra Arches     Owner          
----------------------- ----------------------- ---------------- ---------------
bash                    test-test-test-2                         xyz         [BLOCKED]
$ koji clone-tag --all test-test-test test-test-test-2
$ koji add-pkg --owner xyz test-test-test-2 gcc
Adding 1 packages to tag test-test-test-2
$ koji list-pkgs --show-blocked --tag test-test-test-2
Package                 Tag                     Extra Arches     Owner          
----------------------- ----------------------- ---------------- ---------------
bash                    test-test-test-2                         xyz         [BLOCKED]
gcc                     test-test-test-2                         xyz
$ koji clone-tag --all test-test-test test-test-test-2
UnboundLocalError: local variable 'build' referenced before assignment

PR #879

PR #877

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.17

Commit 2a505f59 fixes this issue

Metadata Update from @franzh:
- Issue set to the milestone: 1.16.1 (was: 1.17)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/876

Please continue any further discussion there.

Metadata