]>
cygwin.com Git - cygwin-apps/setup.git/blob - package_source.h
2 * Copyright (c) 2001, Robert Collins.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #ifndef SETUP_PACKAGE_SOURCE_H
17 #define SETUP_PACKAGE_SOURCE_H
19 /* this is the parent class for all package source (not source code - installation
20 * source as in http/ftp/disk file) operations.
23 /* required to parse this file */
27 #include "csu_util/MD5Sum.h"
30 /* standard binary package metadata:
32 * Vendor Version (ie 2.5.1)
33 * Package Version (ie 16)
38 /* For non installed files, this class can be populated via information about
39 * what is available on the net, or by parsing a specific package file.
40 * for installed packages, this class should represent what is currently installed,
41 * - updated by what net metadata has about it.
42 * i.e. the stability of this version will change simply because the net mirrors
43 * now consider it old.
49 site (const std::string
& newkey
);
52 bool operator == (site
const &rhs
)
54 return casecompare(key
, rhs
.key
) == 0;
61 packagesource ():size (0), canonical (0), base (0), filename (0), cached (),
64 memset (sha512sum
, 0, sizeof sha512sum
);
67 /* how big is the source file */
69 /* how much space do we need to install this ? */
70 virtual unsigned long installedSize () const
72 return _installedSize
;
74 virtual void setInstalledSize (unsigned long size
)
76 _installedSize
= size
;
78 /* The canonical name - the complete path to the source file
79 * i.e. foo/bar/package-1.tar.bz2
81 virtual const char *Canonical () const
85 /* The basename - without extention
88 virtual const char *Base () const
92 /* The basename - with extention
93 * i.e. package-1.tar.bz2
95 virtual const char *Filename () const
99 /* what is the cached filename, to prevent directory scanning during install */
100 virtual char const *Cached () const
102 /* Pointer-coerce-to-boolean is used by many callers. */
105 return cached
.c_str();
107 /* sets the canonical path, and parses and creates base and filename */
108 virtual void set_canonical (char const *);
109 virtual void set_cached (const std::string
& );
110 unsigned char sha512sum
[SHA512_DIGEST_LENGTH
];
113 typedef std::vector
<site
> sitestype
;
116 virtual ~ packagesource ()
131 unsigned long _installedSize
;
134 #endif /* SETUP_PACKAGE_SOURCE_H */
This page took 0.042701 seconds and 6 git commands to generate.