Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbc74781

Browse files
author
谢炜
committed
Added support for cnf directories
1 parente7cfd85 commitbc74781

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

‎CHANGELOG‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* 0.4.6 (2020-08-03)
2+
- #2 support for cnf directories
13
* 0.4.5 (2020-04-17)
24
- rsync use '-L' option
35
* 0.4.4 (2020-03-18)

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.5
1+
0.4.6

‎apt_mirror/__init__.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def run(self):
237237
self.download_skel()
238238
self.download_translation()
239239
self.download_dep11()
240+
self.download_cnf()
240241

241242
# Main download
242243
self.download_archive()
@@ -448,6 +449,25 @@ def download_dep11(self):
448449
forbase_url,rel_pathinself.urls_to_download.keys():
449450
path=os.path.join(base_url.split('://')[-1],rel_path)
450451
self.config.skipclean[path]=1
452+
453+
defdownload_cnf(self):
454+
# DEP-11 index download
455+
self.urls_to_download= {}
456+
output("Processing Commands indexes: [")
457+
formirrorinself.mirrors:
458+
forsuiteinmirror.suites:
459+
output('D')
460+
forrel_path,sizeinsuite.find_cnf_files_in_release().items():
461+
self.add_url_to_download(
462+
mirror.url,remove_double_slashes(rel_path),size)
463+
464+
output("]\n\n")
465+
466+
self.do_download('cnf')
467+
468+
forbase_url,rel_pathinself.urls_to_download.keys():
469+
path=os.path.join(base_url.split('://')[-1],rel_path)
470+
self.config.skipclean[path]=1
451471

452472
defdownload_archive(self):
453473
self.urls_to_download= {}

‎apt_mirror/apt_index.py‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,40 @@ def find_dep11_files_in_release(self):
212212
checksums=1
213213

214214
returnfiles
215+
216+
deffind_cnf_files_in_release(self):
217+
# Look in the dists/DIST/Release file for the cnf/Command-* files
218+
ifself.simple:
219+
return {}
220+
221+
release_url=os.path.join(self.url,'Release')
222+
release_path=os.path.join(self.skel_path,'Release')
223+
224+
release_file=open(release_path)
225+
226+
files= {}
227+
checksums=0
228+
forlineinrelease_file.readlines():
229+
line=line.rstrip()
230+
ifchecksums:
231+
ifre.match(r'^ +(.*)',line):
232+
parts=line.split()
233+
iflen(parts)==3:
234+
_sha1,size,filename=parts
235+
forcomponent,arch_listinself.components.items():
236+
fn_pattern=r'Commands-('+ \
237+
'|'.join(arch_list)+r')\.(gz|bz2|xz)'
238+
ifre.match(component+r'/cnf/'+fn_pattern,filename):
239+
files[os.path.join(self.rel_path,filename)]=int(
240+
size)
241+
break
242+
else:
243+
logging.warn("Malformed checksum line\"%s\" in %s"%
244+
(line,release_url))
245+
else:
246+
checksums=0
247+
ifnotchecksums:
248+
ifline=="SHA256:":
249+
checksums=1
250+
251+
returnfiles

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp