Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rpmdev-bumpspec logic #364

Closed
1 of 2 tasks
xsuchy opened this issue Apr 4, 2024 · 2 comments · Fixed by #399
Closed
1 of 2 tasks

add rpmdev-bumpspec logic #364

xsuchy opened this issue Apr 4, 2024 · 2 comments · Fixed by #399
Labels
area/general Related to whole service, not a specific part/integration. complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. kind/feature New feature or a request for enhancement.

Comments

@xsuchy
Copy link
Contributor

xsuchy commented Apr 4, 2024

Description

Right now, the user has to implement release bumping, which can be quite complicated. It would be nice if we could copy logic from rpmdev-bumpspec. That would honor autorelease if used. And simply bump up something by one if needed.

Benefit

User does not need to study what can be in release and what should be bumped. Logic in one place.The user does not need to study what can be in the release and what should be bumped.

Importance

I have a workaround right now.

Workaround

  • There is an existing workaround that can be used until this feature is implemented.

Participation

  • I am willing to submit a pull request for this issue. (Packit team is happy to help!)
@xsuchy xsuchy added the kind/feature New feature or a request for enhancement. label Apr 4, 2024
@mfocko mfocko added complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. area/general Related to whole service, not a specific part/integration. labels Apr 8, 2024
@mfocko mfocko moved this from new to backlog in Packit Kanban Board Apr 8, 2024
@xsuchy
Copy link
Contributor Author

xsuchy commented Apr 21, 2024

Note for myself:
I use this code:

def increment_last_number(input_string):
    # Split the input string into parts based on the dot
    parts = input_string.split('.')
    
    index = -1
    success = False
    while not success:
        try:
            # Convert the last part to an integer, increment it by 1, and convert it back to string
            parts[index] = str(int(parts[index]) + 1)
            success = True
        except ValueError:
            index -= 1
    
    # Join the parts back into a single string with dots
    return '.'.join(parts)

if not specfile.has_autorelease:
    specfile.release = str(increment_last_number(specfile.expanded_release))

But this failed for

Release:       30%{?alphatag:.}%{?alphatag}%{?dist}

resulting with

Release:       31%{?dist}

@xsuchy
Copy link
Contributor Author

xsuchy commented Jul 17, 2024

Note for myself, the last issue can be fixed by

specfile.release = str(increment_last_number(specfile.release))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/general Related to whole service, not a specific part/integration. complexity/single-task Regular task, should be done within days. gain/low This doesn't bring that much value to users. impact/low This issue impacts only a few users. kind/feature New feature or a request for enhancement.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants