@@ -50,17 +50,33 @@ def all_ids():
50
50
return tickets
51
51
52
52
53
+ def print_once (message ):
54
+ """
55
+ Print the given message just once, even if called multiple times.
56
+ """
57
+ # get the function-static storage
58
+ storage = getattr (print_once , "_storage" , {})
59
+ setattr (print_once , "_storage" , storage )
60
+ if message not in storage :
61
+ print (message )
62
+ storage [message ] = True
63
+
64
+
53
65
if __name__ == "__main__" :
54
66
script_requires_user ("resalloc" )
55
67
56
68
used = used_ids ()
69
+
70
+ # This is the oldest ticket that Copr Backend currently uses.
57
71
min_used = min (used )
72
+
58
73
all_known = all_ids ()
59
74
unknown = all_known - used
60
75
61
- print ("These are old tickets, Copr uses only newer IDs, close them:" )
62
76
for unknown_id in sorted (unknown ):
63
77
if unknown_id < min_used :
78
+ print_once ("These are old tickets, Copr only uses newer tickets, close them:" )
64
79
print (f"resalloc ticket-close { unknown_id } " )
65
80
else :
66
- print (f"This seems relatively new to blindly close: { unknown_id } " )
81
+ print_once ("These tickets are relatively new for closing blindly, double check!" )
82
+ print (f"resalloc ticket-check { unknown_id } " )
0 commit comments