#1123500 scour should be able to update SVGs in place

Package:
scour
Source:
scour
Submitter:
Marnanel Thurman
Date:
2025-12-29 15:53:02 UTC
Severity:
normal
Tags:
#1123500#5
Date:
2025-12-16 23:53:56 UTC
From:
To:
Dear Maintainer,

At present, scour requires an input and an output filename. This is
occasionally a nuisance, especially in automated processing: it requires the
output file to be renamed over the input as a separate step.

Attached is a patch to add an --in-place / -I switch. I'm not sure the switch
names are the most appropriate, however.

#1123500#10
Date:
2025-12-29 15:34:06 UTC
From:
To:
Hello Marnanel,

Thank you for your contribution!

Marnanel Thurman [2025-12-16 23:53 +0000]:

I think it's ok -- sed calls it -i and --in-place as well, that's a good
reference. -i is already taken of course.

| -    if options.in_place:
| -        # at this point, infilename is not None, and outfilename is None
| -        options.outfilename = f'{options.infilename}.{os.getpid()}.temp'

Note, the patch is in the opposite direction again.

I don't like the static `.temp` suffix. It *should* be alright, but it's
dangerous/racy with parallel invocations.

Can you please forward this upstream? This changes behaviour and public API,
which isn't a good idea on the distro level. I don't expect that it actually
lands, but at least it's more visible and might spark some discussion from
other community members. I'm open to apply it in a month or so after that.

Cheers,

Martin