You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Thorsten Schöning <ts...@am-soft.de> on 2018/01/25 15:55:37 UTC
Is there some keyword providing the local path within the working copy?
Hi all,
I'm distributing software directly using SVN and the working copy
contians a configuration file which needs to contain some absolute
path to a special dir in that working copy. The goal is to not need to
commit that path of course, but automatically generate it during a
checkout/update. I had a look at the new custom kewords in SVN 1.8[1]
already, but didn't find any local working copy related path.
So, is there such a local working copy path available and I only
didn't find it yet?
If not, any plans to provide such a path I didn't find yet? I was not
even able to find discussion in that direction, but doubt I'm the
first one with such question.
Thanks!
[1]: http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html
Mit freundlichen Grüßen,
Thorsten Schöning
--
Thorsten Schöning E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme http://www.AM-SoFT.de/
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
Re: Is there some keyword providing the local path within the working
copy?
Posted by Branko Čibej <br...@apache.org>.
On 26.01.2018 08:50, Thorsten Schöning wrote:
> Guten Tag Johan Corveleyn,
> am Donnerstag, 25. Januar 2018 um 20:40 schrieben Sie:
>
>> But I don't understand what you're trying to do. You want to include
>> the WC-root-relative path to *another dir* inside some config file,
>> while you're checking out or updating that config file? That's weird.
> One use case is simply providing e.g. systemd service files in a dir
> structure like the following, while working around some limitations of
> systemd[1]:
>
>> /[...]/someProject
>> .svn
>> [...]
>> config
>> appConfig.xml
>> upstart.conf
>> systemd.service
>> startTheApp.sh
> The problem is that "systemd.service" needs the absolute path to
> "startTheApp.sh" in it's file and that path is unknown on commit time,
> because of very generic tags, but known during checkouts and updates.
You have to tell systemd about the location of its config file anyway.
Changing 'svn checkout' to 'svn checkout && install.sh' is surely the
sane way to do this. You have to 'svn update && restart service' too.
> The problem with a build script generating some unversioned file is
> that each user needs to do it for each working copy and each update
> chaning something on the file "systemd.service".
Each user has to check out the working copy, too. There's always some
step that needs to be done first.
-- Brane
Re: Is there some keyword providing the local path within the working copy?
Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag Johan Corveleyn,
am Donnerstag, 25. Januar 2018 um 20:40 schrieben Sie:
> But I don't understand what you're trying to do. You want to include
> the WC-root-relative path to *another dir* inside some config file,
> while you're checking out or updating that config file? That's weird.
One use case is simply providing e.g. systemd service files in a dir
structure like the following, while working around some limitations of
systemd[1]:
> /[...]/someProject
> .svn
> [...]
> config
> appConfig.xml
> upstart.conf
> systemd.service
> startTheApp.sh
The problem is that "systemd.service" needs the absolute path to
"startTheApp.sh" in it's file and that path is unknown on commit time,
because of very generic tags, but known during checkouts and updates.
So if something like "%R" for the root of the repo would be available
for the root of the working copy, e.g. "%LR" for "local root" or such,
getting the path itself dynamically into the file without additional
build steps would be a bit easier.
The "$...$" syntax for expanded keywords would be more of a problem.
For the use case "ExecStart" one can surely work around that problem
by invoking a shell and forwarding the path with "$" removed as some
arg. For other supported directives with paths this is not possible,
so some very special support to actually remove the "$" would be great
as well.
Breaking things like moving the whole working copy to some other place
can easily be ignored at least in my use cases, it simply doesn't
happen (very often).
> The keywords in SVN are only able to include information that's
> directly related to the file in question, not information about
> another file or dir.
The working copy root is a property of the file in question and
everything else would be something like the following:
> ExecStart=$%LR$/some/other/dir/burnTheHouse.sh
With a keyword providing the path to the file itself only, one might
be able to use the following:
> ExecStart=$%Lu$/../some/other/dir/burnTheHouse.sh
> But regardless, this sounds to me more like something you should solve
> with a build script or somesuch ...
The problem with a build script generating some unversioned file is
that each user needs to do it for each working copy and each update
chaning something on the file "systemd.service". I hoped there would
be some way to avoid that for very easy cases like those for path,
which in theory SVN alreadys knows about.
[1]: https://github.com/systemd/systemd/issues/6308
Mit freundlichen Grüßen,
Thorsten Schöning
--
Thorsten Schöning E-Mail: Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme http://www.AM-SoFT.de/
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
Re: Is there some keyword providing the local path within the working
copy?
Posted by Balogh Péter <ba...@xcite.hu>.
On 2018-01-25 20:40, Johan Corveleyn wrote:
> On Thu, Jan 25, 2018 at 4:55 PM, Thorsten Schöning
> <ts...@am-soft.de> wrote:
>> Hi all,
>>
>> I'm distributing software directly using SVN and the working copy
>> contians a configuration file which needs to contain some absolute
>> path to a special dir in that working copy. The goal is to not need to
>> commit that path of course, but automatically generate it during a
>> checkout/update. I had a look at the new custom kewords in SVN 1.8[1]
>> already, but didn't find any local working copy related path.
>>
>> So, is there such a local working copy path available and I only
>> didn't find it yet?
>>
>> If not, any plans to provide such a path I didn't find yet? I was not
>> even able to find discussion in that direction, but doubt I'm the
>> first one with such question.
>>
>> Thanks!
>>
>> [1]: http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html
> Yes, you're the first one asking for this, AFAIK :-).
>
> But I don't understand what you're trying to do. You want to include
> the WC-root-relative path to *another dir* inside some config file,
> while you're checking out or updating that config file? That's weird.
> The keywords in SVN are only able to include information that's
> directly related to the file in question, not information about
> another file or dir.
>
> But regardless, this sounds to me more like something you should solve
> with a build script or somesuch ...
>
Hi
I think this use case is similar to ours, the way we solved it, was
adding a config file one directory above the svn root folder, that's not
tracked
If subversion supported post checkout / update command execution in the
client side, or if a tracked file could be excluded from commit changes
on the client side, much better solutions could be implemented in our
case as well
One alternative that we've considered was generating the config file
when the application starts, and ignoring it by name, but we have not
implemented this
I hope this helps
Best regards,
Peter
Re: Is there some keyword providing the local path within the working copy?
Posted by Johan Corveleyn <jc...@gmail.com>.
On Thu, Jan 25, 2018 at 4:55 PM, Thorsten Schöning
<ts...@am-soft.de> wrote:
> Hi all,
>
> I'm distributing software directly using SVN and the working copy
> contians a configuration file which needs to contain some absolute
> path to a special dir in that working copy. The goal is to not need to
> commit that path of course, but automatically generate it during a
> checkout/update. I had a look at the new custom kewords in SVN 1.8[1]
> already, but didn't find any local working copy related path.
>
> So, is there such a local working copy path available and I only
> didn't find it yet?
>
> If not, any plans to provide such a path I didn't find yet? I was not
> even able to find discussion in that direction, but doubt I'm the
> first one with such question.
>
> Thanks!
>
> [1]: http://svnbook.red-bean.com/en/1.8/svn.advanced.props.special.keywords.html
Yes, you're the first one asking for this, AFAIK :-).
But I don't understand what you're trying to do. You want to include
the WC-root-relative path to *another dir* inside some config file,
while you're checking out or updating that config file? That's weird.
The keywords in SVN are only able to include information that's
directly related to the file in question, not information about
another file or dir.
But regardless, this sounds to me more like something you should solve
with a build script or somesuch ...
--
Johan