After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647834 - Stop using deprecated API in plug-ins
Stop using deprecated API in plug-ins
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
git master
Other All
: High normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2011-04-15 05:55 UTC by Martin Nordholts
Modified: 2011-11-10 02:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Tar containing all patch files (17.66 KB, application/x-compressed-tar)
2011-04-22 23:48 UTC, br0cc0li
  Details
Patch file containing all script-fu changes (92.03 KB, patch)
2011-04-23 20:35 UTC, br0cc0li
none Details | Review
Patch file containing all script-fu changes (87.15 KB, patch)
2011-04-27 22:03 UTC, br0cc0li
committed Details | Review
Another patch (3.63 KB, patch)
2011-11-05 19:35 UTC, Alexis Wilhelm
reviewed Details | Review
Fix the few remaining deprecated function calls after br0cc0li's patch (2.33 KB, patch)
2011-11-07 17:48 UTC, Alexis Wilhelm
none Details | Review
Fix remaining deprecated function calls (1.28 KB, patch)
2011-11-09 09:16 UTC, Alexis Wilhelm
none Details | Review
Fix remaining deprecated function calls (1.53 KB, patch)
2011-11-09 22:24 UTC, Alexis Wilhelm
reviewed Details | Review

Description Martin Nordholts 2011-04-15 05:55:31 UTC
In the GIMP 2.8 development cycle some plug-in API was deprecated, but not all plug-ins are ported to the new API, causing runtime warnings. Run for example Filters -> Light and Shadow -> Drop Shadow to see some warnings.

We need to fix this all of these before we can release 2.8.

As a side note, it would be nice to get warnings during compile time rather than run-time...
Comment 1 br0cc0li 2011-04-22 23:48:58 UTC
Created attachment 186508 [details]
Tar containing all patch files

I checked all script-fu-files for deprecated function calls and ported them to 2.8 where necessary.

Here's a list of my modificaions:
Works in 2.7? (x=no modifications needed, p=patched)
[x] font-map.scm
[x] copy-visible.scm
[x] select-to-image.scm
[p] starscape-logo.scm
[p] t-o-p-logo.scm
[x] beveled-pattern-hrule.scm
[p] chrome-logo.scm
[x] difference-clouds.scm
[x] distress-selection.scm
[x] comic-logo.scm
[x] guides-remove-all.scm
[x] text-circle.scm
[x] chrome-it.scm
[x] swirltile.scm
[p] predator.scm
[p] truchet.scm
[p] beveled-button.scm
[p] alien-neon-logo.scm
[p] perspective-shadow.scm
[p] frosty-logo.scm
[x] rendermap.scm
[p] alien-glow-bullet.scm
[p] news-text.scm
[x] guides-from-selection.scm
[x] grid-system.scm
[p] reverse-layers.scm
[x] blend-anim.scm
[p] chip-away.scm
[p] addborder.scm
[x] spinning-globe.scm
[x] circuit.scm
[x] palette-export.scm
[x] contactsheet.scm
[p] selection-round.scm
[x] ripply-anim.scm
[p] mkbrush.scm
[p] alien-glow-logo.scm
[p] glowing-logo.scm
[x] clothify.scm
[x] paste-as-brush.scm
[p] beveled-pattern-bullet.scm
[x] script-fu-set-cmap.scm
[x] gimp-online.scm
[x] paste-as-pattern.scm
[x] guides-new.scm
[x] land.scm
[x] add-bevel.scm
[p] neon-logo.scm
[p] sota-chrome-logo.scm
[x] carved-logo.scm
[p] swirly-pattern.scm
[p] erase-rows.scm
[x] unsharp-mask.scm
[p] drop-shadow.scm
[p] burn-in-anim.scm -> throws error using "PREPARE FOR GIF"
[p] alien-glow-arrow.scm
[x] camo.scm
[p] lava.scm
[x] spyrogimp.scm
[x] flatland.scm
[p] textured-logo.scm
[p] coffee.scm
[p] chalk.scm
[p] script-fu-util.scm
[p] beveled-pattern-button.scm
[p] fuzzyborder.scm
[p] basic2-logo.scm
[p] gradient-bevel-logo.scm
[p] speed-text.scm
[p] weave.scm
[x] waves-anim.scm
[x] guides-new-percent.scm
[p] beveled-pattern-arrow.scm
[x] ts-helloworld.scm
[p] i26-gunya2.scm
[p] alien-glow-bar.scm
[x] select-to-pattern.scm
[x] tileblur.scm
[p] blended-logo.scm
[x] beveled-pattern-heading.scm
[p] slide.scm
[p] crystal-logo.scm
[x] carve-it.scm
[x] 3d-outline.scm
[x] gradient-example.scm
[x] bovinated-logo.scm
[p] pupi-button.scm
[p] 3dTruchet.scm
[x] old-photo.scm
[p] basic1-logo.scm
[p] xach-effect.scm
[p] round-corners.scm
[p] coolmetal-logo.scm
[x] script-fu-util-setpt.scm
[p] line-nova.scm
[p] title-header.scm
[p] alien-glow-button.scm
[p] select-to-brush.scm
[p] glossy.scm
[p] test-sphere.scm
Comment 2 Martin Nordholts 2011-04-23 12:44:07 UTC
Thanks a lot for help with this.

Could you please create a single patch with git format-patch instead? It is a bit troublesome to apply the patches in the format you provided.
Also, how did you look for deprecated API? Through some script analyzing the source code?
Comment 3 br0cc0li 2011-04-23 20:35:57 UTC
Created attachment 186532 [details] [review]
Patch file containing all script-fu changes

I finally figured out how to create a git patch (first time working with git) and hope that is what you was asking for.

I found the deprecated scripts by simply manually executing them in GIMP. No script or the like.
Comment 4 Martin Nordholts 2011-04-24 12:16:17 UTC
Yep the patch format is correct, thanks.

To make it easier to review though and more atomical and to the point, could you remove changes that are not necessary for the API update? For example changing order of parameters of center-ellipse in 3dTruchet.scm
Comment 5 br0cc0li 2011-04-27 22:03:22 UTC
Created attachment 186783 [details] [review]
Patch file containing all script-fu changes

Here you go, the patch without any unnecessary changes.
Comment 6 Michael Natterer 2011-04-27 22:53:21 UTC
Thank, that looks excellent! :)
Comment 7 Kevin Cozens 2011-04-28 06:40:18 UTC
The patch looks good now that it doesn't change the parameter order for some procedures. It will take a while to review the changes in the 57 scripts modified by the patch. The scripts also need to be checked to ensure their behaviour won't be altered by changes in the global context now that some PDB procedures are affected by context settings.
Comment 8 Martin Nordholts 2011-05-04 23:06:55 UTC
I just made a commit so that we can list all remaining uses of deprecated APIs. After your patch is applied the number of uses of deprecated functions goes from 140 to 55 so it's a big improvement. Thanks! And many of the remaining uses of deprecated API is actually old and not newly introduced.

IMO we should get your patch in and then close this bug as FIXED. The warnings we get in the development version won't show in the stable version anyway when the PDB compatibility mode becomes GIMP_PDB_COMPAT_ON rather than the current GIMP_PDB_COMPAT_WARN.

commit 28983a5158196eb634050f8e22439cc7fc640b6a
Author: Martin Nordholts <martinn@src.gnome.org>
Date:   Thu May 5 00:58:08 2011 +0200

    app: Add a "check-for-deprecated-procedures-in-script-fu" make target
    
    Add a "check-for-deprecated-procedures-in-script-fu" make target that
    looks for usage of deprecated procedures in *.scm files. We currently
    use quite a bit of deprecated procedures. When we don't do that
    anymore, we should connect this to make check somehow so our nightly
    build fails if someone deprecated a procedures without also porting
    all clients.
    
    Run it like this from the source root:
    
      make -C plug-ins/script-fu check-for-deprecated-procedures-in-script-fu
Comment 9 Alexis Wilhelm 2011-11-05 19:35:29 UTC
Created attachment 200772 [details] [review]
Another patch

No, this script is wrong. grep treats - as a non-word character, so `grep -w gimp-text` finds gimp-text-font, for example. Moreover, some calls are commented out, so we should not worry about them. In fact, after applying br0cc0li's patch only 4 deprecated function calls remain.

This patch fixes Martin's diagnostic script and the few remaining deprecated function calls. Also, I replaced the script's inner loop with a regexp, so now it is much faster.

I did not test select-to-image.scm though, since I could not find how to run it.
Comment 10 Kevin Cozens 2011-11-06 21:05:25 UTC
commit ecd1cb09c410a23e014302ef94cbea6eeb8d0df5
Author: Kevin Cozens <kcozens@svn.gnome.org>
Date:   Sun Nov 6 15:55:45 2011 -0500

    Second stage in removing use of deprecated functions in Script-Fu scripts
    
    Applied most of the mega patch from br0cc0li (see bug #647834) with
    additional de-tabbing and changes in whitespace.
Comment 11 Kevin Cozens 2011-11-07 17:19:09 UTC
Review of attachment 200772 [details] [review]:

This patch mixed script updates with a change to a Makefile preventing the use of this patch as is. The script update portion of the patch can be extracted and used separately. The Makefile issue should be filed separately.
Comment 12 Kevin Cozens 2011-11-07 17:33:13 UTC
Review of attachment 186783 [details] [review]:

This patch has been commited (see comment #10)
Comment 13 Kevin Cozens 2011-11-07 17:33:59 UTC
I removed the Makefile change from Alexis' patch and applied it with a different commit message.


commit 150c274a7d8add0e9b8b68d43a9af6469b189cbc
Author: Alexis Wilhelm <alexiswilhelm@gmail.com>
Date:   Sat Nov 5 20:13:02 2011 +0100

    Removed use of deprecated functions in two Script-Fu scripts (bug #647834)
Comment 14 Alexis Wilhelm 2011-11-07 17:48:14 UTC
Created attachment 200901 [details] [review]
Fix the few remaining deprecated function calls after br0cc0li's patch
Comment 15 Alexis Wilhelm 2011-11-09 09:16:53 UTC
Created attachment 201048 [details] [review]
Fix remaining deprecated function calls

While testing a patch for bug #663576 I noticed that some deprecated functions remained in slide.scm.
Comment 16 Kevin Cozens 2011-11-09 18:35:47 UTC
The list of commits which removed the use of deprecated functions are:

commit 27bef34bd550320706b90a4fa29130c7022b2111
Author: Kevin Cozens <kcozens@svn.gnome.org>
Date:   Wed Nov 9 02:42:34 2011 -0500

    Don't change global context and protect scripts from global context settings.

commit 05d4e788300a3a796e4b1b85b5871bad91c1e6f7
Author: Alexis Wilhelm <alexiswilhelm@gmail.com>
Date:   Sat Nov 5 20:13:02 2011 +0100

    Removed use of deprecated functions in two Script-Fu scripts (bug #647834)

commit 176773dcfe07e15c38d8a7802353d4603d75c9c6
Author: Kevin Cozens <kcozens@svn.gnome.org>
Date:   Sun Nov 6 15:55:45 2011 -0500

    Second stage in removing use of deprecated functions in Script-Fu scripts

    Applied most of the mega patch from br0cc0li (see bug #647834) with
    additional de-tabbing and changes in whitespace.

commit 0bd1c2f09f54359d192e190467b06bb6deea8e66
Author: Kevin Cozens <kcozens@svn.gnome.org>
Date:   Thu Nov 3 22:29:49 2011 -0400

    Fix previous script-fu deprecation commit due to overzealous update script.

commit 5e015aebbaaa663d03cc6f47a58cbeaf56b08418
Author: Kevin Cozens <kcozens@svn.gnome.org>
Date:   Sun Oct 30 02:37:26 2011 -0400

    First stage in removing use of deprecated functions in Script-Fu scripts

    This commit replaces the names of deprecated procedures with the name of
    the new procedure where the new procedure takes the same argument list.
Comment 17 Alexis Wilhelm 2011-11-09 22:24:00 UTC
Created attachment 201103 [details] [review]
Fix remaining deprecated function calls

How embarrassing, I attached the wrong patch to my previous comment  :'(

I just rebased, and there is still gimp-rect-select in slide.scm.
Comment 18 Michael Natterer 2011-11-09 22:27:29 UTC
Indeed.
Comment 19 Kevin Cozens 2011-11-10 02:03:31 UTC
Review of attachment 201103 [details] [review]:

Thanks for spotting this, Alexis. There's often one that slips through the cracks when dealing with a lot of changes in many files.
Comment 20 Kevin Cozens 2011-11-10 02:08:06 UTC
commit dc25d699a9f0e5ebc8ca861f1e8b3c1611f7b6a9
Author: Kevin Cozens <kcozens@svn.gnome.org>
Date:   Wed Nov 9 19:14:10 2011 -0500

    slide.scm: Don't use deprecated procedures  (Fixes bug #647834)
    
    Spotted by, and patch from, Alexis Wilhelm with white space changes and
    a missing context-set added.