github.com/pkalwak/bagins@v0.0.0-20210317172317-694ac5ce2f54/CHANGELOG.md (about)

     1  # CHANGELOG
     2  
     3  ## 0.9.1
     4  
     5  * Fixed a bug which caused some file paths in manifests to be absolute instead of relative.
     6  
     7  ## 0.9.0
     8  
     9  * Added support for custom tag files.
    10  
    11  * Added support for tag manifests.
    12  
    13  * Custom tag files may be anywhere outside the data directory, including custom directories.
    14  
    15  * Custom tag files may be omitted from tagmanifests.
    16  
    17  ### New Methods and Breaking Changes
    18  
    19  This version includes the following breaking changes:
    20  
    21  * bagins.NewBag now takes a slice of hashNames, and will create manifests and optionally tag manifests for each named
    22    algorithm. The function signature was:
    23  
    24  ```go
    25  NewBag(location string, name string, hashName string) (*Bag, error)
    26  ```
    27  
    28  It is now:
    29  
    30  ```go
    31  NewBag(location string, name string, hashNames []string, createTagManifests bool) (*Bag, error)
    32  ```
    33  
    34  * bagins.ReadBag now automatically discovers payload manifests, and will support multiple payload manifests in the same
    35    bag. The function signature was:
    36  
    37  ```go
    38  func ReadBag(pth string, tagfiles []string, manifest string) (*Bag, error)
    39  ```
    40  
    41  It is now:
    42  
    43  ```go
    44  func ReadBag(pathToFile string, tagfiles []string) (*Bag, error)
    45  ```
    46  
    47  Note that the BagIt spec supports both parsed and unparsed tag files. The tagFiles param for ReadBag describes which tag
    48  files you want to parse when reading the bag. Other tag files in the bag will not be parsed.
    49  
    50  * The Bag.AddTagfile() method has not changed, but developers should understand that it adds *managed* tag files in
    51    which you add name-value pairs to the TagFile.Data map (which is map[string]string). The bagins library writes these
    52    name-value pairs to the tag file internally, ensuring they conform to the correct tag file format.
    53  
    54  * The new method Bag.AddCustomTagfile() adds unmanaged tag files to the bag. "Unmanaged" just means the bagins library
    55    makes no attempt to parse these custom tag files. You can use this method to add tag files of any type, text or
    56    binary, and bagins just copies them into the bag without question.
    57  
    58  * New function Bag.UnparsedTagFiles() returns a list of tag files that bagins found but did not try to parse. When you
    59    call ReadBag with ["bag-info.txt", "my-info.txt"] as the tagFiles param, bagins will parse the two named tag files,
    60    and they will not be in the list of files returned by Bag.UnparsedTagFiles(). All other files in the bag that are not
    61    manifests or tagmanifests or part of the payload will be returned by Bag.UnparsedTagFiles().
    62  
    63  * New constants bagins.PayloadManifest and bagins.TagManifest define the two types of manifests.
    64  
    65  * New Bag fuction `GetManifest(manifestType, algorithm string) (*Manifest)` returns the manifest of the specified type
    66    and algorithm, if it exists.
    67  
    68  * New Bag function `GetManifests(manifestType string) ([]*Manifest)` returns all manifests of the specified type, where
    69    type is either bagins.PayloadManifest or bagins.TagManifest.
    70  
    71  * The signature for function NewManifest has changed from this:
    72  
    73  ```go
    74  func NewManifest(pth string, hashName string) (*Manifest, error)
    75  ```
    76  
    77  To this:
    78  
    79  ```go
    80  func NewManifest(pathToFile string, hashName string, manifestType string) (*Manifest, error)
    81  ```
    82  
    83  The new manifestType param should be either bagins.PayloadManifest or bagins.TagManifest.
    84  
    85  * The new function Manifest.Type() returns either bagins.PayloadManifest or bagins.TagManifest.
    86  
    87  * The new function Manifest.Algorithm() returns the name of the manifest's checksum algorithm, in all lower-case.
    88  
    89  * The signature for function Payload.Add has changed from this:
    90  
    91  ```go
    92  func (p *Payload) Add(srcPath string, dstPath string, m *Manifest) (string, error)
    93  ```
    94  
    95  To this:
    96  
    97  ```go
    98  func (p *Payload) Add(srcPath string, dstPath string, manifests []*Manifest) (map[string]string, error)
    99  ```
   100  
   101  This allows the checksum of the newly added file to be written to multiple manifests.
   102  
   103  * Similarly, the signature of Payload.AddAll has changed from this:
   104  
   105  ```go
   106  func (p *Payload) AddAll(src string, m *Manifest) (fxs map[string]string, errs []error)
   107  ```
   108  
   109  To this:
   110  
   111  ```go
   112  func (p *Payload) AddAll(src string, manifests []*Manifest) (checksums map[string]map[string]string, errs []error)
   113  ```
   114  
   115  See the inline documentation for an explanation of the return values.
   116  
   117  ## 0.8.0
   118  
   119  * Added ability to open and read a bag directory on disk, tag files and manifests.
   120  
   121  * Reduced number of concurrent files processed in checksums from 100 to 5
   122  
   123  * Removed a number of unneeded methods.
   124  
   125  * Added support for multiple tag fields with the same name and tag files respect field order.
   126  
   127  # 0.7.0
   128  
   129  * Added a Bag.Contents method that lists all the files found in the bag directory regardless to weather they are managed
   130    by the bag object or not.
   131  
   132  * Added a Bag.FileManifest method to list all the files in a bag object it manages and can work on.
   133  
   134  * Added a Bag.Invetory method that confirms that all files lin Bag.FileManifest are indeed written inside the bag.
   135  
   136  * Added a Bag.Orphans method that lists any files in the bag that are not found in the Bag.FileManifest.
   137  
   138  ## 0.6.1
   139  
   140  * bagmaker runs with throttled go routines to avoid a too many open files error.
   141  
   142  ## 0.6.0
   143  
   144  * Can compile a command line executable basic bagger. See README.rst for info
   145  
   146  ## 0.5.0
   147  
   148  * Initial release. Library works to build basic bags.