-
Notifications
You must be signed in to change notification settings - Fork 96
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
select --from tries to select packages from a different staging as well #1708
Comments
Based on the documentation that is an invalid command. Personally, I never use
In general, the following should work:
I am going to assume the command you included is not what actually ran, otherwise I'd have to stare at this code a bit more to see how it passed the following condition. elif request in staged_requests and (move or supersede): Additionally, request Either I am missing something or this report either needs more information or has some incorrect information in it. |
That's literally what I ran and what the output was.
That was a typo, I meant |
To be clear, you wrote:
I wrote:
I am going to assume you ran:
The devil is in the details. From what you wrote:
Again, the specifics here matter. |
Right, another typo. This time copy and pasted:
It did not fail - it had as output that the request was moved but nothing happened. |
Alright, so the message is wrong in that it should say failed to find request in K or something along those lines? In the future can you just skip |
I guess so.
Use case for the call was to move all Plasma packages from D to K, but the list of package names given also included packages which are part of adi stagings. |
|
Given that it can find the requests where ever they are staged I am going to assume there was some legacy reason for |
It makes sense as such an additional constraint though and apparently works fine - just the message needs to be improved. |
But why would you need it if you have explicitly list all the packages you want to move anyway? It can figure out that they come from |
The point is that I did not want to move those which are in an adi staging. |
And based on the various checks and design...one should never have multiple requests staged for the same package. As such a list of either package names or request ids is already unique and does not require a |
I am baffled it took this much to get the one sentence that should have been in the original description. This is an entirely different discussion...using it as an input filter. |
I thought it was sufficiently explained in the issue title... Apparently not, sorry for that. |
The sentence is correct, but does not describe your intent at all. Sounds more like an issue in that it doesn't actually move the request like you think it should. Furthered by, "It doesn't actually move the request though AFAICT." The original code was design as an aid in the way I already described. There was no filtering and the additional stuff I added is completely separate. openSUSE-release-tools/osclib/select_command.py Lines 76 to 81 in 5a2cd2d
As such it would be best to fully understand the use-case before deciding how we might proceed.
I assume if you are filtering this has something to do with having a full list of kde related packages and just wanting to move the ones in The current flag serves no purpose as far as I can tell. |
Yup!
Maybe - only that an interactive window doesn't make it easily possible to use a list of packages in a file as selection:
|
Well, I am not opposed to changing the behavior to print a message there that ignoring since not matching Untest, but you can try if you want since sounds like you use this. diff --git a/osclib/select_command.py b/osclib/select_command.py
index 88edf6e3..b690e729 100644
--- a/osclib/select_command.py
+++ b/osclib/select_command.py
@@ -73,12 +73,11 @@ class SelectCommand(object):
return self.api.rq_to_prj(request, self.target_project)
elif request in staged_requests and (move or supersede):
# 'select' command becomes a 'move'
- fprj = None
- if from_:
- fprj = self.api.prj_from_letter(from_)
- else:
- # supersede = (new_rq, package, project)
- fprj = self.api.packages_staged[staged_requests[request]]['prj'] if not supersede else supersede[2]
+ # supersede = (new_rq, package, project)
+ fprj = self.api.packages_staged[staged_requests[request]]['prj'] if not supersede else supersede[2]
+ if from_ != fprj:
+ print('Ignoring "{}" in "{}" since not "{}"'.format(request, fprj, from_))
+ return True
if supersede:
print('"{} ({}) is superseded by {}'.format(request, supersede[1], supersede[0]))
@@ -133,6 +132,7 @@ class SelectCommand(object):
requests = RequestFinder.find_sr(requests, self.api, newcand)
requests_count = len(requests)
+ from_ = self.api.prj_from_letter(from_)
for index, request in enumerate(requests, start=1):
print('({}/{}) '.format(index, requests_count), end='')
if not self.select_request(request, move, from_): |
That diff seems to work (ignoring the missing "in"):
|
With
xdg-desktop-portal-kde
in an adi staging,osc staging select --from D K xdg-desktop-portal-kde
tries to move it as well:(1/1) Moving "636539" from "openSUSE:Factory:Staging:D" to "openSUSE:Factory:Staging:K"
It doesn't actually move the request though AFAICT.
The text was updated successfully, but these errors were encountered: