source: appstream-generator/src/asgen/backends/dummy/pkgindex.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 1.4 KB
Line 
1/*
2 * Copyright (C) 2016 Matthias Klumpp <matthias@tenstral.net>
3 *
4 * Licensed under the GNU Lesser General Public License Version 3
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the license, or
9 * (at your option) any later version.
10 *
11 * This software is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this software.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20module asgen.backends.dummy.pkgindex;
21
22import std.stdio;
23import std.path;
24import std.string;
25import std.algorithm : remove;
26
27import asgen.logging;
28import asgen.backends.interfaces;
29import asgen.backends.dummy.dummypkg;
30
31
32final class DummyPackageIndex : PackageIndex
33{
34
35private:
36    Package[][string] pkgCache;
37
38public:
39
40    this (string dir)
41    {
42    }
43
44    void release ()
45    {
46        pkgCache = null;
47    }
48
49    Package[] packagesFor (string suite, string section, string arch)
50    {
51        return [new DummyPackage ("test", "1.0", "amd64")];
52    }
53
54    bool hasChanges (DataStore dstore, string suite, string section, string arch)
55    {
56        return true;
57    }
58}
Note: See TracBrowser for help on using the repository browser.