From b47224814547638776610647a510dd42e471d80b Mon Sep 17 00:00:00 2001
From: Jorge Camarero Vera <jorge.camarero@cern.ch>
Date: Wed, 19 Oct 2022 10:37:27 +0200
Subject: [PATCH] Resolve "Change Owner Identifier String and System Code of
 Creating System values in tape labels"

---
 ReleaseNotes.md                               |  1 +
 .../tape/tapeserver/file/Structures.cpp       | 21 +++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index 1e77761f52..ecb8747303 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -2,6 +2,7 @@
 
 ## Summary
 ### Features
+- cta/CTA#23 - Change Owner Identifier String and System Code of Creating System values in tape labels
 - cta/CTA#41 - Delete verification_status of tape when tape is reclaimed
 - cta/CTA#153 - Allow verification status to be cleared with cta-admin
 - cta/CTA#173 - Update release notes and small changes to refactoring of operation tools cmd line parsing - Compatible with operations 0.4-95 or later
diff --git a/tapeserver/castor/tape/tapeserver/file/Structures.cpp b/tapeserver/castor/tape/tapeserver/file/Structures.cpp
index 9bb835c24e..a5cb83d490 100644
--- a/tapeserver/castor/tape/tapeserver/file/Structures.cpp
+++ b/tapeserver/castor/tape/tapeserver/file/Structures.cpp
@@ -15,22 +15,23 @@
  *               submit itself to any jurisdiction.
  */
 
-#include "castor/tape/tapeserver/file/Structures.hpp"
-#include "common/exception/Exception.hpp"
 #include <time.h>
 #include <stdio.h>
 
-using namespace castor::tape;
+#include "version.h"
+
+#include "castor/tape/tapeserver/file/Structures.hpp"
+#include "common/exception/Exception.hpp"
 
-#define BASEVERSION "2.1.15"
+using namespace castor::tape;
 
-void tapeFile::VOL1::fill(std::string VSN, 
+void tapeFile::VOL1::fill(std::string VSN,
   unsigned char LBPMethod) {
   setString(m_label, "VOL1");
   setString(m_VSN, VSN);
   setString(m_lblStandard, "3");
-  setString(m_ownerID, "CASTOR");
-  std::stringstream hexLBP; 
+  setString(m_ownerID, "CTA");
+  std::stringstream hexLBP;
   hexLBP << std::setfill('0') << std::setw(2) << std::hex
       << std::noshowbase << static_cast<int>(LBPMethod);
   setString(m_LBPMethod, hexLBP.str());
@@ -61,9 +62,7 @@ void tapeFile::VOL1::verify(const char *const expectedLblStandard) {
     throw cta::exception::Exception("reserved2 is not empty");
 }
 
-void tapeFile::HDR1EOF1::fillCommon(
-  std::string fileId, std::string VSN, int fSeq) {
-
+void tapeFile::HDR1EOF1::fillCommon(std::string fileId, std::string VSN, int fSeq) {
   setString(m_fileId, fileId);
   setString(m_VSN, VSN);
   setInt(m_fSeq, fSeq);
@@ -80,7 +79,7 @@ void tapeFile::HDR1EOF1::fillCommon(
    * overwritten immediately.
    */
   setDate(m_expirationDate);
-  setString(m_sysCode, std::string("CASTOR ") + BASEVERSION); /* TODO: CASTOR BASEVERSION */
+  setString(m_sysCode, std::string("CTA ") + CTA_VERSION);
 }
 
 void tapeFile::HDR1EOF1::verifyCommon()
-- 
GitLab