NOTE   How to compress GLF live-build configurations                                     16 Jun 2023 GLF
-----------------------------------------------------------------------------------------------------------

Most of the GLF prepared configuration filesets for use with Debian 12 live-build system contain embedded symbolic links in various places withn the file tree.  These are problematic to archive to .tar.gz file using the default Engrampa Archiver utility.  Though Engrampa can correctly unpack the prior archive file for editing into a new configuration, it cannot subsequently recompress it.  An error stops the process, presumably due to the presence of links embedded to root or nonexistent (at the time) folders.

However, there is a workaround.  The command line archiver "tar" can correctly compress such a "boobytrapped" folder.  Use a command patterned after the following from the same folder in which the target subfolder resides:

Example:

    tar -zcvf gwine730_686.tar.gz gwine730_686/
    tar -zcvf gwine730_amd64.tar.gz gwine730_amd64/
    tar -zcvf gpers731_amd64.tar.gz gpers731_amd64/
    
  The trailing slash above is essential to specify a folder rather than a file.    

  The unpacking of the resulting archive "gpers731_amd64.tar.gz" with Engrampa sets symlinks under:

    config/includes.chroot/usr/share/work/user/esp_32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/xtensa-esp32-elf/
    
    instead of making extra copies of linked files, and does not show errors during decompression.

SCRIPT
------

Since the above command line template can be used for ANY of the GLF live boot Linux build sets regardless of any symlinks (or not), a more convenient script "compressdir" was developed to make the above relatively easy.  A copy of this script is found in the root folder of the work drive where the build configuration filesets are normally used.  This script requires one and ONLY one argument to the command.  That argument may be a string in quotes if for some reason a folder name contains spaces (not recomnmended).  Otherwise zero or two or more arguments will fail. So will a nonexistent folder.

Example (if compressdir script is found under the user's $HOME folder):

   ~/compressdir gwine730_686
   
   Should produce the archive file gwine730_686.tar.gz.  It overwrites any previously existing file
   of the same name, so if the pror version needs to be retained, be sure to copy or rename it first.


