|
@@ -52,45 +52,41 @@ bool Override::ReadOverride(string const &File,bool const &Source)
|
|
|
if (*Pkg == 0)
|
|
if (*Pkg == 0)
|
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
|
|
+#define APT_FIND_NEXT_FIELD \
|
|
|
|
|
+ for (End++; isspace(*End) != 0 && *End != 0; ++End) \
|
|
|
|
|
+ /* skip spaces */ ; \
|
|
|
|
|
+ Start = End; \
|
|
|
|
|
+ for (; isspace(*End) == 0 && *End != 0; ++End) \
|
|
|
|
|
+ /* find end of word */ ;
|
|
|
|
|
+
|
|
|
|
|
+#define APT_WARNING_MALFORMED_LINE(FIELD) \
|
|
|
|
|
+ if (*End == 0) \
|
|
|
|
|
+ { \
|
|
|
|
|
+ _error->Warning(_("Malformed override %s line %llu (%s)"),File.c_str(), \
|
|
|
|
|
+ Counter, FIELD ); \
|
|
|
|
|
+ continue; \
|
|
|
|
|
+ } \
|
|
|
|
|
+ *End = 0;
|
|
|
|
|
+
|
|
|
// Find the package and zero..
|
|
// Find the package and zero..
|
|
|
- char *Start = Pkg;
|
|
|
|
|
|
|
+ char *Start;
|
|
|
char *End = Pkg;
|
|
char *End = Pkg;
|
|
|
for (; isspace(*End) == 0 && *End != 0; End++);
|
|
for (; isspace(*End) == 0 && *End != 0; End++);
|
|
|
- if (*End == 0)
|
|
|
|
|
- {
|
|
|
|
|
- _error->Warning(_("Malformed override %s line %llu #1"),File.c_str(),
|
|
|
|
|
- Counter);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- *End = 0;
|
|
|
|
|
|
|
+ APT_WARNING_MALFORMED_LINE("pkgname");
|
|
|
|
|
+
|
|
|
|
|
+ APT_FIND_NEXT_FIELD;
|
|
|
|
|
|
|
|
// Find the priority
|
|
// Find the priority
|
|
|
if (Source == false)
|
|
if (Source == false)
|
|
|
{
|
|
{
|
|
|
- for (End++; isspace(*End) != 0 && *End != 0; End++);
|
|
|
|
|
- Start = End;
|
|
|
|
|
- for (; isspace(*End) == 0 && *End != 0; End++);
|
|
|
|
|
- if (*End == 0)
|
|
|
|
|
- {
|
|
|
|
|
- _error->Warning(_("Malformed override %s line %llu #2"),File.c_str(),
|
|
|
|
|
- Counter);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- *End = 0;
|
|
|
|
|
|
|
+ APT_WARNING_MALFORMED_LINE("priority");
|
|
|
Itm.Priority = Start;
|
|
Itm.Priority = Start;
|
|
|
|
|
+
|
|
|
|
|
+ APT_FIND_NEXT_FIELD;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Find the Section
|
|
// Find the Section
|
|
|
- for (End++; isspace(*End) != 0 && *End != 0; End++);
|
|
|
|
|
- Start = End;
|
|
|
|
|
- for (; isspace(*End) == 0 && *End != 0; End++);
|
|
|
|
|
- if (*End == 0)
|
|
|
|
|
- {
|
|
|
|
|
- _error->Warning(_("Malformed override %s line %llu #3"),File.c_str(),
|
|
|
|
|
- Counter);
|
|
|
|
|
- continue;
|
|
|
|
|
- }
|
|
|
|
|
- *End = 0;
|
|
|
|
|
|
|
+ APT_WARNING_MALFORMED_LINE("section");
|
|
|
Itm.FieldOverride["Section"] = Start;
|
|
Itm.FieldOverride["Section"] = Start;
|
|
|
|
|
|
|
|
// Source override files only have the two columns
|
|
// Source override files only have the two columns
|
|
@@ -99,7 +95,7 @@ bool Override::ReadOverride(string const &File,bool const &Source)
|
|
|
Mapping[Pkg] = Itm;
|
|
Mapping[Pkg] = Itm;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Find the =>
|
|
// Find the =>
|
|
|
for (End++; isspace(*End) != 0 && *End != 0; End++);
|
|
for (End++; isspace(*End) != 0 && *End != 0; End++);
|
|
|
if (*End != 0)
|
|
if (*End != 0)
|