Imported Upstream version 3.3.0
[debian/amanda] / server-src / tapefile.c
index d3afe12bbfd42bb467554ad395c48578e3f1b581..b4212e5894238b47bc4d49e9801938ba26f4d78e 100644 (file)
@@ -102,6 +102,10 @@ write_tapelist(
        g_fprintf(tapef, "%s %s", tp->datestamp, tp->label);
        if(tp->reuse) g_fprintf(tapef, " reuse");
        else g_fprintf(tapef, " no-reuse");
+       if (tp->barcode)
+           g_fprintf(tapef, " BARCODE:%s", tp->barcode);
+       if (tp->meta)
+           g_fprintf(tapef, " META:%s", tp->meta);
        if (tp->comment)
            g_fprintf(tapef, " #%s", tp->comment);
        g_fprintf(tapef, "\n");
@@ -397,6 +401,26 @@ parse_tapeline(
        skip_whitespace(s, ch);
     }
 
+    if (strncmp_const(s - 1, "BARCODE:") == 0) {
+       s1 = s - 1 + 8;
+       skip_non_whitespace(s, ch);
+       s[-1] = '\0';
+       skip_whitespace(s, ch);
+       tp->barcode = stralloc(s1);
+    } else {
+       tp->barcode = NULL;
+    }
+
+    if (strncmp_const(s - 1, "META:") == 0) {
+       s1 = s - 1 + 5;
+       skip_non_whitespace(s, ch);
+       s[-1] = '\0';
+       skip_whitespace(s, ch);
+       tp->meta = stralloc(s1);
+    } else {
+       tp->meta = NULL;
+    }
+
     if (*(s - 1) == '#') {
        tp->comment = stralloc(s); /* skip leading '#' */
     } else {