project-navigation
Personal tools

Author Topic: Proposal for /base/archives.bat  (Read 3003 times)

odie

  • Guest
Proposal for /base/archives.bat
« on: April 15, 2009, 04:28:39 am »
Hi,

I read the archives.bat batch file in /base, and realises that it works on updating files only.

My question is what if there are new update / revised files?

Can i propose the original code
Code: [Select]
rem NOTE: This batch file requires you to have the 7-zip command line utility, 7za.exe, in your path.
rem You can get this utility here: http://www.7-zip.org/download.html
rem -r recurse subdirectories. for example, this ensures that 0models.pk3 will contain stuff from "models\aliens" as well as "models".

7za a -tzip 0base.pk3 *.cfg irc_motd.txt -x!".svn"
7za a -r -tzip 0maps.pk3 materials\*.mat maps\*.bsp maps\*.ump -x!".svn"
7za a -r -tzip 0media.pk3 shaders\*.fp shaders\*.vp media\*.ttf -x!".svn"
7za a -r -tzip 0models.pk3 models\*.md2 models\*.md3 models\*.jpg models\*.png models\*.tga models\*.anm models\*.txt models\*.tag -x!".svn"
7za a -r -tzip 0music.pk3 music\*.ogg -x!".svn"
7za a -r -tzip 0pics.pk3 pics\*.jpg pics\*.tga pics\*.png textures\*.jpg textures\*.tga textures\*.png -x!".svn"
7za a -r -tzip 0snd.pk3 sound\*.ogg sound\*.wav -x!".svn"
7za a -r -tzip 0ufos.pk3 ufos\*.ufo -x!".svn"
7za a -r -tzip 0vids.pk3 videos\*.roq -x!".svn"

be updated to:
Code: [Select]
rem NOTE: This batch file requires you to have the 7-zip command line utility, 7za.exe, in your path.
rem You can get this utility here: http://www.7-zip.org/download.html
rem -r recurse subdirectories. for example, this ensures that 0models.pk3 will contain stuff from "models\aliens" as well as "models".

7za u -tzip 0base.pk3 *.cfg irc_motd.txt -x!".svn"
7za u -r -tzip 0maps.pk3 materials\*.mat maps\*.bsp maps\*.ump -x!".svn"
7za u -r -tzip 0media.pk3 shaders\*.fp shaders\*.vp media\*.ttf -x!".svn"
7za u -r -tzip 0models.pk3 models\*.md2 models\*.md3 models\*.jpg models\*.png models\*.tga models\*.anm models\*.txt models\*.tag -x!".svn"
7za u -r -tzip 0music.pk3 music\*.ogg -x!".svn"
7za u -r -tzip 0pics.pk3 pics\*.jpg pics\*.tga pics\*.png textures\*.jpg textures\*.tga textures\*.png -x!".svn"
7za u -r -tzip 0snd.pk3 sound\*.ogg sound\*.wav -x!".svn"
7za u -r -tzip 0ufos.pk3 ufos\*.ufo -x!".svn"
7za u -r -tzip 0vids.pk3 videos\*.roq -x!".svn"

The a is for adding files to archives.
u is for updating, which should include adding new files, and refreshing old files.

For the uninformed of what the breakdown of the command is:
7za - the program used, 7za (a dos version of 7zip, a free archiver)
a - add files
u - update files
-tzip - specifies the type of archives, in this case, type = zip
the pk3 file name - eg 0vids.pk3 = the name of the archive
This is followed by a path\*.extension = the files to be archives, in this case is a wildcard.
-x".svn" = this tells the batch file not to include the file .svn, which is the file used for SVN updates and such.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Proposal for /base/archives.bat
« Reply #1 on: April 15, 2009, 07:59:38 am »
please submit a patch to our patch tracker - i will have a look when i find the time.

odie

  • Guest
Re: Proposal for /base/archives.bat
« Reply #2 on: April 15, 2009, 09:00:05 am »
please submit a patch to our patch tracker - i will have a look when i find the time.

Hi mattn,

Done that. :)

odie

  • Guest
Re: Proposal for /base/archives.bat
« Reply #3 on: April 16, 2009, 08:42:08 pm »