~ubuntu-branches/debian/experimental/apt/experimental

« back to all changes in this revision

Viewing changes to apt-pkg/deb/debsrcrecords.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2010-02-18 22:07:23 UTC
  • mfrom: (9.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100218220723-zb7zdh6fmsmp30tr
Tags: 0.7.26~exp2
fix crash when LANGUAGE is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
   ##################################################################### */
10
10
                                                                        /*}}}*/
11
11
// Include Files                                                        /*{{{*/
12
 
#include <apt-pkg/deb/deblistparser.h>
13
 
#include <apt-pkg/deb/debsrcrecords.h>
14
 
#include <apt-pkg/contrib/error.h>
15
 
#include <apt-pkg/contrib/strutl.h>
16
 
#include <apt-pkg/contrib/configuration.h>
 
12
#include <apt-pkg/deblistparser.h>
 
13
#include <apt-pkg/debsrcrecords.h>
 
14
#include <apt-pkg/error.h>
 
15
#include <apt-pkg/strutl.h>
 
16
#include <apt-pkg/configuration.h>
17
17
 
18
18
using std::max;
19
19
                                                                        /*}}}*/
54
54
   package/version records representing the build dependency. The returned 
55
55
   array need not be freed and will be reused by the next call to this 
56
56
   function */
57
 
bool debSrcRecordParser::BuildDepends(vector<pkgSrcRecords::Parser::BuildDepRec> &BuildDeps, bool ArchOnly)
 
57
bool debSrcRecordParser::BuildDepends(vector<pkgSrcRecords::Parser::BuildDepRec> &BuildDeps,
 
58
                                        bool const &ArchOnly, bool const &StripMultiArch)
58
59
{
59
60
   unsigned int I;
60
61
   const char *Start, *Stop;
77
78
      while (1)
78
79
      {
79
80
         Start = debListParser::ParseDepends(Start, Stop, 
80
 
                     rec.Package,rec.Version,rec.Op,true);
 
81
                     rec.Package,rec.Version,rec.Op,true, StripMultiArch);
81
82
         
82
83
         if (Start == 0) 
83
84
            return _error->Error("Problem parsing dependency: %s", fields[I]);
135
136
         string::size_type Tmp = F.Path.rfind('.',Pos);
136
137
         if (Tmp == string::npos)
137
138
            break;
 
139
         if (F.Type == "tar") {
 
140
            // source v3 has extension 'debian.tar.*' instead of 'diff.*'
 
141
            if (string(F.Path, Tmp+1, Pos-Tmp) == "debian")
 
142
               F.Type = "diff";
 
143
            break;
 
144
         }
138
145
         F.Type = string(F.Path,Tmp+1,Pos-Tmp);
139
146
         
140
 
         if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma")
 
147
         if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma" || F.Type == "tar")
141
148
         {
142
149
            Pos = Tmp-1;
143
150
            continue;
152
159
   return true;
153
160
}
154
161
                                                                        /*}}}*/
 
162
// SrcRecordParser::~SrcRecordParser - Destructor                       /*{{{*/
 
163
// ---------------------------------------------------------------------
 
164
/* */
 
165
debSrcRecordParser::~debSrcRecordParser()
 
166
{
 
167
   delete[] Buffer;
 
168
}
 
169
                                                                        /*}}}*/