Bug 7505 - build/mkupdates/listpromotable deprecated goto
Summary: build/mkupdates/listpromotable deprecated goto
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: sysadmins (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All Linux
: P2 minor
Target Milestone: Undefined
Assignee: SpamAssassin SysAdmins
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-26 18:51 UTC by Dave Jones
Modified: 2021-04-21 10:36 UTC (History)
3 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Use "redo" instead of deprecated "goto" (jumping into a construct) to restart the current foreach iteration. patch None Karsten Bräckelmann [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Jones 2017-11-26 18:51:46 UTC
The daily rules promotion script, build/mkupdates/run_nightly, has the following error in the listpromotable script:

+ promote_active_rules
+ pwd
+ /usr/bin/perl build/mkupdates/listpromotable
/usr/local/spamassassin/automc/svn/trunk
HTTP get: http://ruleqa.spamassassin.org/1-days-ago?xml=1
Use of "goto" to jump into a construct is deprecated at build/mkupdates/listpromotable line 85.
Comment 1 Dave Jones 2018-01-17 19:16:14 UTC
This one is over my head since I don't have a lot of experience with perl.  I think the goto needs to be replaced with function calls but not sure.
Comment 2 Karsten Bräckelmann 2018-09-06 19:37:33 UTC
Created attachment 5597 [details]
Use "redo" instead of deprecated "goto" (jumping into a construct) to restart the current foreach iteration.
Comment 3 Karsten Bräckelmann 2018-09-06 19:39:16 UTC
Use "redo" instead of deprecated "goto" (jumping into a construct) to restart the current foreach iteration.

I don't fully understand when the first if-block is (not) entered. Thus using a dedicated variable to ensure entering the if-block in the case of restarting the iteration with a new offset.

Review appreciated.

Not comitting to trunk yet, to not risk breaking rules promotion with a release pending.

I cannot easily test the actual code in listpromotable. Dave, any chance you can test this?
Comment 4 Dave Jones 2018-09-06 21:57:04 UTC
I don't know of any way to test this without committing to production and waiting to see how the next run goes.
Comment 5 Kevin A. McGrail 2018-09-06 23:53:11 UTC
OK, then please hold off until after the release of 3.4.2 so we know everything is good for that if you don't mind?
Comment 6 Dave Jones 2018-10-22 12:04:42 UTC
What is your version of perl?  I am still running CentOS 6 so it's v5.14.1.

Can you show what the command is in the spamfilter-check-config.sh so I can see the whole line with arguments?  I would like to run the same command on my server to see if that makes a difference.
Comment 7 Henrik Krohns 2021-04-21 10:36:18 UTC
Patch testedly works.

Sending        trunk/build/mkupdates/listpromotable
Transmitting file data .done
Committing transaction...
Committed revision 1889050.