View | Details | Raw Unified | Return to bug 41816
Collapse All | Expand All

(-)a/apt-pkg/indexfile.h (+4 lines)
Lines 64-69 class pkgIndexFile Link Here
64
   virtual bool GetIndexes(pkgAcquire *Owner) const;
64
   virtual bool GetIndexes(pkgAcquire *Owner) const;
65
65
66
   // CNC:2002-07-04
66
   // CNC:2002-07-04
67
   // The API has been extended in ALT for updating the in-memory cache
68
   // (namely, the contents of the pkgRepository objects stored in RepList
69
   // in rpmindexfile.cc; see https://bugzilla.altlinux.org/41816 ).
70
   virtual bool InvalidateReleases() const = 0; // the extension made in ALT
67
   virtual bool GetReleases(pkgAcquire *Owner) const = 0;
71
   virtual bool GetReleases(pkgAcquire *Owner) const = 0;
68
72
69
   // Interface for the record parsers
73
   // Interface for the record parsers
(-)a/apt-pkg/rpm/rpmindexfile.cc (+10 lines)
Lines 89-94 string rpmListIndex::ReleaseInfo(const string Type) const Link Here
89
   return Info;
89
   return Info;
90
}
90
}
91
									/*}}}*/
91
									/*}}}*/
92
// rpmListIndex::InvalidateReleases - Mark the index files for refetching	/*{{{*/
93
// ---------------------------------------------------------------------
94
/* */
95
bool rpmListIndex::InvalidateReleases() const
96
{
97
   if (Repository) // FIXME: GetReleases() did no such check. Who's right?
98
      Repository->Acquire = true;
99
   return true;
100
}
101
									/*}}}*/
92
// rpmListIndex::GetReleases - Fetch the index files			/*{{{*/
102
// rpmListIndex::GetReleases - Fetch the index files			/*{{{*/
93
// ---------------------------------------------------------------------
103
// ---------------------------------------------------------------------
94
/* */
104
/* */
(-)a/apt-pkg/rpm/rpmindexfile.h (+6 lines)
Lines 45-50 class rpmDatabaseIndex : public rpmIndexFile Link Here
45
   virtual string Describe(bool Short) const override {return "RPM Database";}
45
   virtual string Describe(bool Short) const override {return "RPM Database";}
46
46
47
   /* nothing to download in the case of the DB */
47
   /* nothing to download in the case of the DB */
48
   virtual bool InvalidateReleases() const override { return true; }
48
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
49
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
49
50
50
   // Interface for the Cache Generator
51
   // Interface for the Cache Generator
Lines 83-88 class rpmListIndex : public rpmIndexFile Link Here
83
84
84
   public:
85
   public:
85
86
87
   virtual bool InvalidateReleases() const override;
86
   virtual bool GetReleases(pkgAcquire *Owner) const override;
88
   virtual bool GetReleases(pkgAcquire *Owner) const override;
87
89
88
   // Interface for the Cache Generator
90
   // Interface for the Cache Generator
Lines 183-188 class rpmPkgDirIndex : public rpmPkgListIndex Link Here
183
185
184
   public:
186
   public:
185
187
188
   virtual bool InvalidateReleases() const override { return true; }
186
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
189
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
187
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
190
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
188
191
Lines 210-215 class rpmSrcDirIndex : public rpmSrcListIndex Link Here
210
213
211
   public:
214
   public:
212
215
216
   virtual bool InvalidateReleases() const override { return true; }
213
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
217
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
214
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
218
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
215
219
Lines 239-244 class rpmSinglePkgIndex : public rpmPkgListIndex Link Here
239
243
240
   public:
244
   public:
241
245
246
   virtual bool InvalidateReleases() const override { return true; }
242
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
247
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
243
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
248
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
244
249
Lines 265-270 class rpmSingleSrcIndex : public rpmSrcListIndex Link Here
265
270
266
   public:
271
   public:
267
272
273
   virtual bool InvalidateReleases() const override { return true; }
268
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
274
   virtual bool GetReleases(pkgAcquire *Owner) const override { return true; }
269
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
275
   virtual bool GetIndexes(pkgAcquire *Owner) const override { return true; }
270
276
(-)a/apt-pkg/sourcelist.cc (+12 lines)
Lines 419-424 bool pkgSourceList::GetIndexes(pkgAcquire *Owner) const Link Here
419
   return true;
419
   return true;
420
}
420
}
421
									/*}}}*/
421
									/*}}}*/
422
// CNC:2002-07-04's extension by ALT
423
// SourceList::IvalidateReleases - Mark all releases to be re-fetched	/*{{{*/
424
// ---------------------------------------------------------------------
425
/* */
426
bool pkgSourceList::InvalidateReleases() const
427
{
428
   for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
429
      if ((*I)->InvalidateReleases() == false)
430
	 return false;
431
   return true;
432
}
433
									/*}}}*/
422
// CNC:2002-07-04
434
// CNC:2002-07-04
423
// SourceList::GetReleases - Load release files into the downloader	/*{{{*/
435
// SourceList::GetReleases - Load release files into the downloader	/*{{{*/
424
// ---------------------------------------------------------------------
436
// ---------------------------------------------------------------------
(-)a/apt-pkg/sourcelist.h (+1 lines)
Lines 106-111 class pkgSourceList Link Here
106
   bool GetIndexes(pkgAcquire *Owner) const;
106
   bool GetIndexes(pkgAcquire *Owner) const;
107
107
108
   // CNC:2002-07-04
108
   // CNC:2002-07-04
109
   bool InvalidateReleases() const; // ALT's extension
109
   bool GetReleases(pkgAcquire *Owner) const;
110
   bool GetReleases(pkgAcquire *Owner) const;
110
111
111
   pkgSourceList();
112
   pkgSourceList();
(-)a/apt-pkg/update.cc (-1 / +1 lines)
Lines 61-67 bool ListUpdate(pkgAcquireStatus &Stat, Link Here
61
   bool Res = true;
61
   bool Res = true;
62
62
63
   // Populate it with release file URIs
63
   // Populate it with release file URIs
64
   if (!List.GetReleases(&Fetcher))
64
   if (! (List.InvalidateReleases() && List.GetReleases(&Fetcher)) )
65
      return false;
65
      return false;
66
66
67
   res = Fetcher.Run();
67
   res = Fetcher.Run();
(-)a/cmdline/apt-get.cc (-1 / +3 lines)
Lines 1139-1145 bool DoUpdate(CommandLine &CmdL) Link Here
1139
      pkgAcquire Fetcher(&Stat);
1139
      pkgAcquire Fetcher(&Stat);
1140
1140
1141
      // Populate it with release file URIs
1141
      // Populate it with release file URIs
1142
      if (!List.GetReleases(&Fetcher))
1142
      // InvalidateReleases() isn't really necessary, since apt-get is
1143
      // a one-shot process. It's here for consistency (with other utilities).
1144
      if (! (List.InvalidateReleases() && List.GetReleases(&Fetcher)) )
1143
         return false;
1145
         return false;
1144
1146
1145
      // Populate it with the source selection
1147
      // Populate it with the source selection
(-)a/cmdline/apt-shell.cc (-2 / +1 lines)
Lines 1067-1073 bool DoUpdate(CommandLine &CmdL) Link Here
1067
      pkgAcquire Fetcher(&Stat);
1067
      pkgAcquire Fetcher(&Stat);
1068
1068
1069
      // Populate it with release file URIs
1069
      // Populate it with release file URIs
1070
      if (!List.GetReleases(&Fetcher))
1070
      if (! (List.InvalidateReleases() && List.GetReleases(&Fetcher)) )
1071
         return false;
1071
         return false;
1072
1072
1073
      // Populate it with the source selection
1073
      // Populate it with the source selection
1074
- 

Return to bug 41816