-
Notifications
You must be signed in to change notification settings - Fork 23
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
Draft script for fetching origins of required packages #289
Conversation
subrepo: subdir: "external/os-autoinst-common" merged: "db78c61" upstream: origin: "[email protected]:os-autoinst/os-autoinst-common.git" branch: "master" commit: "db78c61" git-subrepo: version: "0.4.6" origin: "???" commit: "???"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. The script generally looks good enough. I am still running it and it takes some time so I don't want to give my approval just yet :)
Just because of the name "obs-check-package-origin" that reminded me of similarly named tool which you might want to look into if not already done:
- https://github.com/openSUSE/openSUSE-release-tools/blob/master/check_source.py
- https://github.com/openSUSE/openSUSE-release-tools/blob/master/osc-origin.py
Would be great if you can put your addition in relation to those and describe differences
Yes, it takes a while. Also if you run it with
Yes, good point. Some if that would be probably doing similar things. The osc-origin plugin is probably the most prominent, however I am not sure if that is usable without checking out the package first. The advantage in my approach is, that we are basically doing https://en.opensuse.org/openSUSE:Maintenance_update_process#Check_if_a_Leap_package_is_inherited_from_SLE and that can be done just with plain osc without checking-out anything upfront. If I am not mistaken, the openSUSE-release-tools is wrapping around already created submission requests. The script is far from perfect and the very core is just |
obs-check-package-origin
Outdated
} | ||
|
||
init_check() { | ||
which yq &> /dev/null || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which yq &> /dev/null || { | |
command yq &> /dev/null || { |
This was failing on a TW container until I changed it, also if checking for dependencies, rpmspec
should also be included, and I guess osc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, so which
is not preinstalled in a TW container, good to know. Unfortunately command
is not an equivalent of which
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, so
which
is not preinstalled in a TW container, good to know. Unfortunatelycommand
is not an equivalent ofwhich
here.
why so? but either way at least is known now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are brave enough you can try the difference between which vim
and command vim
; but even if command -v
is used, it behaves differently (the difference is in respect of bash functions and aliases, which will be found by command but would not work without interactive shell).
obs-check-package-origin
Outdated
rpmspec -q -D "sysusers_requires BuildRequires: sysuser-tools" --buildrequires "$tmpfile" \ | ||
| sort -u \ | ||
| while read -r; do | ||
package="$(get_package_name "$REPLY")" | ||
test -n "$package" || { | ||
error "Unable to get package name for '$REPLY'" | ||
continue | ||
} | ||
echo "$package" | ||
done | ||
rm "$tmpfile" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baierjan maybe you want to look at how I did it at https://progress.opensuse.org/issues/154747#note-3
Not entirely sure if buildrequires will also pull requires (the distri doesn't have buildrequires for instance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely not, there were some assumptions in place when writing this script (for example, we know it could be run on Leap/SLES by adding devel:openQA:Leap:xx repositories). You probably want to include also the --requires
list.
Fetch requirements from package spec file, look for package names for such requirements, search all relevant instances where the package is maintained and fetch version info from spec file and from Tumbleweed repo Reference: https://progress.opensuse.org/issues/154723
Fetch requirements from package spec file, look for package names for
such requirements, search all relevant instances where the package is
maintained and fetch version info from spec file and from Tumbleweed
repo.
Reference: https://progress.opensuse.org/issues/154723
Note: The only related change is in the last commit.