-
Notifications
You must be signed in to change notification settings - Fork 32
/
file_types.go
47 lines (44 loc) · 1.8 KB
/
file_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package rpmpack
// FileType is the type of a file inside a RPM package.
type FileType int32
// https://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/pkgformat.html#AEN27560
// The RPMFile.Type tag value shall identify various characteristics of the file in the payload that it describes.
// It shall be an INT32 value consisting of either the value GenericFile (0) or
// the bitwise inclusive or of one or more of the following values. Some of these combinations may make no sense
const (
// GenericFile is just a basic file in an RPM
GenericFile FileType = 1 << iota >> 1
// ConfigFile is a configuration file, and an existing file should be saved during a
// package upgrade operation and not removed during a package removal operation.
ConfigFile
// DocFile is a file that contains documentation.
DocFile
// DoNotUseFile is reserved for future use; conforming packages may not use this flag.
DoNotUseFile
// MissingOkFile need not exist on the installed system.
MissingOkFile
// NoReplaceFile similar to the ConfigFile, this flag indicates that during an upgrade operation
// the original file on the system should not be altered.
NoReplaceFile
// SpecFile is the package specification file.
SpecFile
// GhostFile is not actually included in the payload, but should still be considered as a part of the package.
// For example, a log file generated by the application at run time.
GhostFile
// LicenceFile contains the license conditions.
LicenceFile
// ReadmeFile contains high level notes about the package.
ReadmeFile
// ExcludeFile is not a part of the package, and should not be installed.
ExcludeFile
)
// RPMFile contains a particular file's entry and data.
type RPMFile struct {
Name string
Body []byte
Mode uint
Owner string
Group string
MTime uint32
Type FileType
}