Is it possible to export multiple files in one command?

5 views
Skip to first unread message

Bo Berglund

unread,
Jan 21, 2023, 4:31:16 AM1/21/23
to us...@subversion.apache.org
I have a script, which is used in our installer creation process and it works as
follows (on Windows):

- Create a new target directory
- Run svn commands to get the needed files into that dir
- Run svn command to download the installer engine binary into its own dir
- Run svn command to download the installer script itself
- Start the installer engine with the script as argument

This produces a new installation file in the installers directory.

The svn command I am using is svn export since I don't want to create a
versioned container and I also want to collect files from various different
locations including documentation which will be part of the installer.

What I would like to know is if there is an svn export command switch of some
kind that can be used to export a set of files in one go if they reside in the
same subversion directory?

Right now I am repeating the following typical sequence, where the svn commands
have to be run *inside* the target directory (variable SVNREPO has been set to
the repository URL earlier):

if EXIST Manager rmdir /s /q Manager
mkdir Manager
cd Manager
svn export %SVNREPO%/Manager.exe .\
if errorlevel 1 goto error
svn export %SVNREPO%/ssleay32.dll .\
if errorlevel 1 goto error
svn export %SVNREPO%/libeay32.dll .\
if errorlevel 1 goto error
svn export %SVNREPO%/doc/Manager_instructions.pdf .\

So to get these 4 files I have to issue 4 different svn commands...

And I have had to create the target dir and move into it before doing this
because otherwise the command instead of creating a subdir to stuff the file
into exports the source file into a file named as the directory it is supposed
to go into...

Example:
svn --force export %SVNREPO%/ssleay32.dll TargetDir

This creates a *file* TargetDir with the content of ssleay32.dll instead of
ssleay32.dll inside of TargetDir

I would like to use a single svn command per source dir and get all the needed
files from there at the same time according to a supplied list.

Is this possible at all?


--
Bo Berglund
Developer in Sweden

Jon Daley via users

unread,
Jan 21, 2023, 6:14:27 AM1/21/23
to us...@subversion.apache.org
I don't believe it is possible - you can export a file or a whole
directory.

You could export the tree with one command and then move/cherry pick the
files you want afterwards.
Jon Daley
https://jon.limedaley.com
~~
A man full of hope will be full of action.
-- Thomas Brooks

Bo Berglund

unread,
Jan 21, 2023, 10:31:08 AM1/21/23
to us...@subversion.apache.org
On Sat, 21 Jan 2023 06:14:06 -0500 (EST), "Jon Daley via users"
<us...@subversion.apache.org> wrote:

>I don't believe it is possible - you can export a file or a whole
>directory.
>
>You could export the tree with one command and then move/cherry pick the
>files you want afterwards.
>

Not really useful since the files needed for the setup are only a few (less than
5) out of several hundred in the full source tree...

So I will keep the separate exports for the individual files instead.

Daniel Shahaf

unread,
Jan 22, 2023, 5:24:14 AM1/22/23
to us...@subversion.apache.org
Bo Berglund wrote on Sat, 21 Jan 2023 09:30 +00:00:
> What I would like to know is if there is an svn export command switch of some
> kind that can be used to export a set of files in one go if they reside in the
> same subversion directory?

svn checkout --depth=empty https://svn.apache.org/repos/asf/subversion/trunk/notes
cd notes
svn up --set-depth=infinity -- svnsync.txt sasl.txt

Daniel Sahlberg

unread,
Jan 25, 2023, 4:19:56 PM1/25/23
to bo.be...@gmail.com, us...@subversion.apache.org
I believe you can do this using the svn:externals property. I have the following repository layout
[root]
|     +--- 1file
|     +--- 2file
|     +--- 3file
|     +--- 4file

The manyfiles directory contains 5 different files. The somefiles directory contains none, however it has the svn:externals property set to point to each of the files needed for the installation script (1file, 3file, 5file):
$ svn proplist -v somefiles
Properties on 'somefiles':
  svn:externals
    ^/manyfiles/1file 1file
    ^/manyfiles/3file 3file
    ^/manyfiles/5file 5file

I can now do
$ svn export REPOPATH/somefiles

This will give me a directory tree containing the requested files:
      +--- 1file
      +--- 3file
      +--- 5file

Obviously, you can get creative in your external definitions, for example pegging to a specific revision. See the SVN Book for the full syntax: https://svnbook.red-bean.com/en/1.7/svn.advanced.externals.html

Of course this means that you now have two places to maintain your build scripts; both the actual script do to the build process and the svn:externals property. You must decide if the additional burden of splitting out the file list to SVN is worth the effort. (You could potentially have the directory "somefiles" in the repository without the svn:externals property, check it out as a working copy, set the svn:externals property as part of the script and do an svn up to get all the files).

Kind regards,
Daniel Sahlberg


Lorenz via users

unread,
Jan 27, 2023, 1:49:25 AM1/27/23
to us...@subversion.apache.org
Daniel Sahlberg wrote:

>Den lör 21 jan. 2023 kl 10:31 skrev Bo Berglund <bo.be...@gmail.com>:
>
>> I have a script, which is used in our installer creation process and it
>> works as follows (on Windows):
>
> [...]
>
>I believe you can do this using the svn:externals property. I have the
>following repository layout
>[...]
>
>Of course this means that you now have two places to maintain your build
>scripts; both the actual script do to the build process and the
>svn:externals property. [...]

depends ...

you could maintain the folder with the svn:external definitions as
part of the source tree and modify the build process to work of this
folder (without the need to modify the build process)
--

Lorenz

Reply all
Reply to author
Forward
0 new messages