@@ -55,12 +55,11 @@ Currently repositories are required to be signed and you need to provide signing
55
55
56
56
``` python
57
57
from repopulator import AptRepo, PgpSigner
58
- from pathlib import Path
59
58
60
59
repo = AptRepo()
61
60
62
- package1 = repo.add_package(Path( ' /path/to/awesome_3.14_amd64.deb' ) )
63
- package2 = repo.add_package(Path( ' /path/to/awesome_3.14_arm64.deb' ) )
61
+ package1 = repo.add_package(' /path/to/awesome_3.14_amd64.deb' )
62
+ package2 = repo.add_package(' /path/to/awesome_3.14_arm64.deb' )
64
63
65
64
dist = repo.add_distribution(' jammy' ,
66
65
origin = ' my packages' ,
@@ -69,80 +68,76 @@ dist = repo.add_distribution('jammy',
69
68
version = ' 1.2' ,
70
69
description = ' my awesome repo' )
71
70
72
- dist.add_package( component = ' main' , package = package1 )
73
- dist.add_package( component = ' main' , package = package2 )
71
+ repo.assign_package(package1, dist, component = ' main' )
72
+ repo.assign_package(package2, dist, component = ' main' )
74
73
75
- signer = PgpSigner(Path.home() / ' .gnupg ' , ' name_of_key_to_use' , ' password_of_that_key' )
74
+ signer = PgpSigner(' name_of_key_to_use' , ' password_of_that_key' )
76
75
77
- repo.export(Path( ' /path/of/new/repo' ) , signer)
76
+ repo.export(' /path/of/new/repo' , signer)
78
77
79
78
```
80
79
81
- #### YUM/DNF
80
+ #### RPM
82
81
83
82
``` python
84
83
from repopulator import RpmRepo, PgpSigner
85
- from pathlib import Path
86
84
87
85
repo = RpmRepo()
88
- repo.add_package(Path( ' /path/to/awesome-3.14-1.el9.x86_64.rpm' ) )
89
- repo.add_package(Path( ' /path/to/awesome-3.14-1.el9.aarch64.rpm' ) )
86
+ repo.add_package(' /path/to/awesome-3.14-1.el9.x86_64.rpm' )
87
+ repo.add_package(' /path/to/awesome-3.14-1.el9.aarch64.rpm' )
90
88
91
- signer = PgpSigner(Path.home() / ' .gnupg ' , ' name_of_key_to_use' , ' password_of_that_key' )
89
+ signer = PgpSigner(' name_of_key_to_use' , ' password_of_that_key' )
92
90
93
- repo.export(Path( ' /path/of/new/repo' ) , signer)
91
+ repo.export(' /path/of/new/repo' , signer)
94
92
95
93
```
96
94
97
95
#### Pacman
98
96
99
97
``` python
100
98
from repopulator import PacmanRepo, PgpSigner
101
- from pathlib import Path
102
99
103
100
repo = PacmanRepo(' myrepo' )
104
101
# if .sig file is present next to the .zst file it will be used for signature
105
102
# otherwise new signature will be generated at export time
106
- repo.add_package(Path(' /path/to/awesome-3.14-1-x86_64.pkg.tar.zst' ))
103
+ repo.add_package(' /path/to/awesome-3.14-1-x86_64.pkg.tar.zst' )
104
+ repo.add_package(' /path/to/another-1.2-1-x86_64.pkg.tar.zst' )
107
105
108
- signer = PgpSigner(Path.home() / ' .gnupg ' , ' name_of_key_to_use' , ' password_of_that_key' )
106
+ signer = PgpSigner(' name_of_key_to_use' , ' password_of_that_key' )
109
107
110
- repo.export(Path( ' /path/of/new/repo' ) , signer)
108
+ repo.export(' /path/of/new/repo' , signer)
111
109
112
110
```
113
111
114
112
#### Alpine apk
115
113
116
114
``` python
117
- from repopulator import PacmanRepo, PkiSigner
118
- from pathlib import Path
115
+ from repopulator import AlpineRepo, PkiSigner
119
116
120
- repo = PacmanRepo (' my repo description' )
121
- repo.add_package(Path( ' /path/to/awesome-3.14-r0.apk' ) )
122
- repo.add_package(Path( ' /path/to/another-1.23-r0.apk' ) )
117
+ repo = AlpineRepo (' my repo description' )
118
+ repo.add_package(' /path/to/awesome-3.14-r0.apk' )
119
+ repo.add_package(' /path/to/another-1.23-r0.apk' )
123
120
124
- signer = PkiSigner(Path( ' /path/to/private/key' ) , ' password_or_None' )
121
+ signer = PkiSigner(' /path/to/private/key' , ' password_or_None' )
125
122
126
- # The last argument is the 'name' of the signer to use
127
- # Unlike `pkg` tool we do not parse it out of private key filename
128
- # and do not require you to name key files in certain way
129
- repo.export(Path(
' /path/of/new/repo' ), signer,
' [email protected] ' )
123
+ # Unlike `pkg` tool we do not parse signer name out of private key filename
124
+ # so you can name your key files whatever you wish
125
+ repo.export(
' /path/of/new/repo' , signer,
signer_name = ' [email protected] ' )
130
126
131
127
```
132
128
133
129
#### FreeBSD pkg
134
130
135
131
``` python
136
132
from repopulator import FreeBSDRepo, PkiSigner
137
- from pathlib import Path
138
133
139
134
repo = FreeBSDRepo()
140
- repo.add_package(Path( ' /path/to/awesome-3.14.pkg' ) )
141
- repo.add_package(Path( ' /path/to/another-1.2.pkg' ) )
135
+ repo.add_package(' /path/to/awesome-3.14.pkg' )
136
+ repo.add_package(' /path/to/another-1.2.pkg' )
142
137
143
- signer = PkiSigner(Path( ' /path/to/private/key' ) , ' password_or_None' )
138
+ signer = PkiSigner(' /path/to/private/key' , ' password_or_None' )
144
139
145
- repo.export(Path( ' /path/of/new/repo' ) , signer)
140
+ repo.export(' /path/of/new/repo' , signer)
146
141
147
142
```
148
143
0 commit comments