- string Bins = Sect.FindS("Binary");
- char *Buf = Buffer;
- unsigned int Bin = 0;
- if (Bins.empty() == true)
- return 0;
-
- // Strip any leading spaces
- string::const_iterator Start = Bins.begin();
- for (; Start != Bins.end() && isspace(*Start) != 0; Start++);
+ const char *Start, *End;
+ if (Sect.Find("Binary", Start, End) == false)
+ return NULL;
+ for (; isspace(*Start) != 0; ++Start);
+ if (Start >= End)
+ return NULL;
+
+ StaticBinList.clear();
+ free(Buffer);
+ Buffer = strndup(Start, End - Start);
+
+ char* bin = Buffer;
+ do {
+ char* binStartNext = strchrnul(bin, ',');
+ char* binEnd = binStartNext - 1;
+ for (; isspace(*binEnd) != 0; --binEnd)
+ binEnd = '\0';
+ StaticBinList.push_back(bin);
+ if (*binStartNext != ',')
+ break;
+ *binStartNext = '\0';
+ for (bin = binStartNext + 1; isspace(*bin) != 0; ++bin);
+ } while (*bin != '\0');
+ StaticBinList.push_back(NULL);
+
+ return &StaticBinList[0];
+}
+ /*}}}*/
+// SrcRecordParser::BuildDepends - Return the Build-Depends information /*{{{*/
+// ---------------------------------------------------------------------
+/* This member parses the build-depends information and returns a list of
+ package/version records representing the build dependency. The returned
+ array need not be freed and will be reused by the next call to this
+ function */
+bool debSrcRecordParser::BuildDepends(std::vector<pkgSrcRecords::Parser::BuildDepRec> &BuildDeps,
+ bool const &ArchOnly, bool const &StripMultiArch)
+{
+ unsigned int I;
+ const char *Start, *Stop;
+ BuildDepRec rec;
+ const char *fields[] = {"Build-Depends",
+ "Build-Depends-Indep",
+ "Build-Conflicts",
+ "Build-Conflicts-Indep"};
+
+ BuildDeps.clear();