Open SkycoinSynth opened 3 years ago
You can use recursive glob patterns in version 1.8 and later.
I agree 100% with SkycoinSynth proposal to reintroduce -the R option in the command. Companies may depend on backward compatibility and stable commands when it's included in Linux distributions such as Debian. This command may be used in scripts, and automated developers build systems. Linux has a good reputation for not breaking users' systems, and this change does just that. It's unreasonable to say, "just change all your scripts and build a system with ...". Please urgently reconsider the request to revert to the old option with '-R'.
-R
was reintroduced in version 1.10, in April 2021.
Thanks for the quick answer. However, I am puzzled (maybe I'm doing something wrong), but I can not get rpl to work on Debian Bullseye. I try to clone a KiCAD design to work from that; the procedure is described here
rpl -R olddir newdir *
The response to this is "-R unrecognized command." I downloaded this old version, and it works as I remembered it a couple of months ago. The reason I say I'm puzzled is that rpl worked as described maybe six months ago. Then, I had to change the hard drive and reinstall Debian again. Are there any minor upgrades in the rpl-code that Debian has distributed since I'm on Bullseye 11.5 compared to the 11.0 release?
I should also inform you that my old Linux installation was a bit of a mess, with a mix of Debian releases. Thus, I'm unsure if I did an upgrade from Buster (v10) to Bullseye (v11), and maybe I also had some packages from testing. In the end, it punished me - and I did a complete only stable (Bullseye) installation on a clean hard drive. Thus I'm not sure which rpl version was working as expected back then, so you know the background.
I noticed that -R was not restored to the old code, instead introduced another way. " This implementation does not restore the previous manual tree walking, but instead relies on Python’s pathlib." It does not seem to work, at least not in the above test case.
@berrak, I believe that Debian has shipped the same version of rpl
, 1.8.0, which does not support -R
, with all versions of Bullseye.
You can get any version of rpl
you like from pypi.org (using pip
).
That's true, but to get a working rpl with -R, with the above test case, I must go back for years. In addition, two imperfections in the current version released by Debian.
apt-cache policy rpl
rpl:
Installed: 1.8.0-2
Candidate: 1.8.0-2
Version table:
*** 1.8.0-2 500
500 http://deb.debian.org/debian bullseye/main amd64 Packages
100 /var/lib/dpkg/status
To conclude, do you believe that the Debian maintainer(s) has removed the option -R in Bullseye?
I'm following up on your proposal using PyPI. Tell me which version of rpl on PyPi works, so I do not need to guess and try all /1.10/1.11/1.12/1.13/1.14/. Thanks.
To conclude, do you believe that the Debian maintainer(s) has removed the option -R in Bullseye?
The Debian maintainers, as far as I know, have never touched the code (except when they were also the upstream maintainers).
As I said, 1.8.0, shipping in Bullseye, lacks the -R
option. Note that this version was released in November 2020; Debian does not usually update packages once a testing distribution enters freeze, so this will have been the version shipped.
I'm following up on your proposal using PyPI. Tell me which version of rpl on PyPi works, so I do not need to guess and try all /1.10/1.11/1.12/1.13/1.14/. Thanks.
I'd use the latest. Please do report any bugs you find! (Homepage link for bug reporting is on the PyPI page.)
I removed all previous rpl's
and reinstalled Debian's rpl-package
(Bullseye - current stable release)
rpl --help
...
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--encoding ENCODING specify character set encoding
-i, --ignore-case search case-insensitively
-m, --match-case ignore case when searching, but try to match case of replacement to case of original, either capitalized, all upper-case, or mixed
-w, --whole-words whole words (OLD-TEXT matches on word boundaries only)
-b, --backup rename original FILE to FILE~ before replacing
-q, --quiet quiet mode
-v, --verbose verbose mode
-s, --dry-run simulation mode
-e, --escape expand escapes in OLD-TEXT and NEW-TEXT [deprecated]
-F, --fixed-strings treat OLD-TEXT and NEW-TEXT as fixed strings, not regular expressions
--files OLD-TEXT and NEW-TEXT are file names to read patterns from
--noglob disable globbing and other expansions
-p, --prompt prompt before modifying each file
-f, --force ignore errors when trying to preserve permissions
-d, --keep-times keep the modification times on modified files
rpl --version
rpl 1.8.0
Copyright (C) 2004-2005 Göran Weinholt <weinholt@debian.org>
Copyright (C) 2004 Christian Häggström <chm@c00.info>
Copyright (C) 2016 Kevin Coyner <kcoyner@debian.org>
Copyright (C) 2017 Jochen Kupperschmidt <homework@nwsnet.de>
Copyright (C) 2018-2020 Reuben Thomas <rrt@sc3d.org>
In conclusion, option -R is gone, and "rpl" is broken, i.e. does not work as in the previous release (Buster - old-stable). Then I installed "rpl" with 'pip install rpl', the latest version 1.14, as you suggested.
rpl --help
...
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--encoding ENCODING specify character set encoding
-E, --extended-regex use extended regular expression module `regex'
-i, --ignore-case search case-insensitively
-m, --match-case ignore case when searching, but try to match case of replacement to case of original, either capitalized, all upper-case, or mixed
-w, --whole-words whole words (OLD-TEXT matches on word boundaries only)
-b, --backup rename original FILE to FILE~ before replacing
-q, --quiet quiet mode
-v, --verbose verbose mode
-s, --dry-run simulation mode
-e, --escape expand escapes in OLD-TEXT and NEW-TEXT [deprecated]
-F, --fixed-strings treat OLD-TEXT and NEW-TEXT as fixed strings, not regular expressions
--files OLD-TEXT and NEW-TEXT are file names to read patterns from
-x GLOB, --glob GLOB modify only files matching the given glob (may be given more than once)
-R, --recursive search recursively
-p, --prompt prompt before modifying each file
-f, --force ignore errors when trying to preserve attributes
-d, --keep-times keep the modification times on modified files
rpl --version
rpl 1.14
Copyright (C) 2018-2022 Reuben Thomas <rrt@sc3d.org>
Copyright (C) 2017 Jochen Kupperschmidt <homework@nwsnet.de>
Copyright (C) 2016 Kevin Coyner <kcoyner@debian.org>
Copyright (C) 2004-2005 Göran Weinholt <weinholt@debian.org>
Copyright (C) 2004 Christian Häggström <chm@c00.info>
I'm pleased with pip rpl 1.14, since it works as before. Sorry, If I have consumed your time in vain. Suppose you have a good connection with the maintainer at Debian. In that case, you could point out the grievances this removal cause companies that run the Debian operating system as part of their IT infrastructure.
You can file a bug on the Debian BTS requesting an update to the rpl package with the next point update of Buster, and saying why you think it qualifies for an update within a stable release, if you like.
They modified the source for some reason. I could ask them why they break backward compatibility - which is very serious. As I said, companies depend on stability - I thought they understood such essential matters.
As I've said already, the Debian maintainers have not modified the source. Version 1.8.0 did not support -R
.
Buster (previous release) had working -R, and one release later it's gone. Thus they decided to use another code base and thought it is not necessary to keep the functionality - which is a flawed decision. Just look at the start of this thread.
The code base for some time has been the same, the one I maintain. At one point I removed -R
; later, I restored it. It has been the same codebase throughout that process.
It's like breaking an API. If Debian insists on not fixing it, at least use semantic versioning and change this to a significant change with 2. x.x to mark it as incompatible.
Sure, but none of this has anything to do with Debian, it's all my fault.
But your pip rpl 1.14 works great :-)
Maybe should we say enough of the thread -- I'm happy, the problem is solved after some frustration. Now it is soon the weekend - time to relax. :-)
there is no -R option , so no recursion in the version pulled on Debian using: apt-get install rpl
as of June 2024
@bossagypsy1 First, please file a Debian issue for Debian bugs. Secondly, Debian has version 1.14 in stable, which supports -R
, which I restored in version 1.10. Maybe you're still using oldstable?
@kcoyner this issue can be closed, as I restored -R
in version 1.10, released in September 2021.
Thanks , is it possible that apt -get will pull a previous version?
Please ask Debian questions in a suitable forum. This is the issue tracker for (upstream) rpl.
By the way, you can always install rpl directly from PyPI.
thanks, but I m not running Python
rpl is written in Python, you can't run rpl without Python.
rpl -R "a" b"
The R option is very important.
This commit should be reverted.
https://github.com/kcoyner/rpl/commit/753e84b769a00a4fc1caf35a31caeadf08f425ed
If there is no R option on rpl, then rpl should be removed from debian repo as it is the most common used variant of the command.