gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu-arch-users] How to fix the tagline problem


From: Matthew Dempsky
Subject: [Gnu-arch-users] How to fix the tagline problem
Date: Sat, 04 Sep 2004 17:12:25 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

After some discussion about a bug in the tagline extraction code,
James pointed out that we can't fix it right now because it causes an
extra byte to be read for tag ids and possibly changes them for files
with an arch-tag: line at the bottom without a whitespace character at
the end.

The discussion considered waiting until the archive version bump to
fix or adding changeset versions, but I don't see how these would
cleanly be implemented and they seem like a possible abstraction break
in arch's architecture.

I'm thinking perhaps a solution would be to use (something similar to)
the following comparison function for file ids instead of simply
str_cmp:

    int
    arch_id_equal (t_uchar * a, t_uchar * b, int strict)
    {
      int a_len;
      int b_len;

      if (!str_cmp (a, b))
        return 1;

      if (strict)
        return 0;

      a_len = str_length (a);
      b_len = str_length (b);

      if ((a_len != b_len - 1) && (a_len != b_len + 1))
        return 0;

      if (str_cmp_n (a, a_len, b, b_len))
        return 0;

      safe_printfmt (2, "tla: Warning! Loose file id matching used for `%s' and 
`%s'", a, b);

      return 1;
    }

(Basically, if the strings are equal then they're always the same.  If
`strict' is 0, then we allow the length to differ by one as long as
the rest is identical and print out a warning message.)

For the next couple of releases, we would make strict default to 0 and
provide a --strict-id-matching option to all appropriate tla commands
to override this.  After that, deprecate the old file ids and change
the default to 1 and instead provide --loose-id-matching.  Finally
after that, we can prune the code and change it back to str_cmp.

Even if we did go with the archive or changeset versioning, we'd need
the above code and the version would simply specify if we should use
strict or loose id matching, so it seems like a step in the right
direction.

"All" we then need to do is go over inv-ids.c with a fine tooth comb
and clean out all the bugs and implement everything correctly.
Perhaps *exactly* specifying id behaviour would be a good starting
place for the arch spec?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]