Re: Is it possible to export multiple files in one command?
Daniel Sahlberg wrote: >Den lör 21 jan. 2023 kl 10:31 skrev Bo Berglund : > >> 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
Re: Is it possible to export multiple files in one command?
Den lör 21 jan. 2023 kl 10:31 skrev Bo Berglund : > 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? I believe you can do this using the svn:externals property. I have the following repository layout [root] +-- manyfiles | +--- 1file | +--- 2file | +--- 3file | +--- 4file | +--- 5file +--- somefiles 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: +--- somefiles +--- 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
Re: Is it possible to export multiple files in one command?
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
Re: Is it possible to export multiple files in one command?
On Sat, 21 Jan 2023 06:14:06 -0500 (EST), "Jon Daley via users" 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. -- Bo Berglund Developer in Sweden
Re: Is it possible to export multiple files in one command?
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. On Sat, 21 Jan 2023, Bo Berglund wrote: 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? -- Jon Daley https://jon.limedaley.com ~~ A man full of hope will be full of action. -- Thomas Brooks