Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
c59d78dd
Kaydet (Commit)
c59d78dd
authored
Ock 06, 2021
tarafından
Adınız
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
inary mirror feature added
üst
ec0ed055
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
2 deletions
+70
-2
inarycli.py
inary/cli/inarycli.py
+1
-0
mirror.py
inary/cli/mirror.py
+67
-0
fetcher.py
inary/fetcher.py
+2
-2
No files found.
inary/cli/inarycli.py
Dosyayı görüntüle @
c59d78dd
...
...
@@ -33,6 +33,7 @@ import inary.cli.listinstalled
import
inary.cli.listcomponents
import
inary.cli.listavailable
import
inary.cli.listnewest
import
inary.cli.mirror
import
inary.cli.history
import
inary.cli.install
import
inary.cli.info
...
...
inary/cli/mirror.py
0 → 100644
Dosyayı görüntüle @
c59d78dd
# -*- coding:utf-8 -*-
#
# Copyright (C) 2017 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#
import
inary.db
import
inary.context
as
ctx
import
inary.cli.command
as
command
import
inary.data.index
as
index
import
optparse
import
os
# Gettext Library
import
gettext
__trans
=
gettext
.
translation
(
'inary'
,
fallback
=
True
)
_
=
__trans
.
gettext
class
Fetch
(
command
.
Command
,
metaclass
=
command
.
autocommand
):
__doc__
=
_
(
"""Mirror a repository
Usage: mirror [<package1> <package2> ... <packagen>]
<packagei>: repo name
Downloads the given inary packages to working directory
"""
)
def
__init__
(
self
,
args
):
super
(
Fetch
,
self
)
.
__init__
(
args
)
name
=
(
"mirror"
,
"mr"
)
def
options
(
self
):
group
=
optparse
.
OptionGroup
(
self
.
parser
,
_
(
"mirror options"
))
group
.
add_option
(
"-o"
,
"--output-dir"
,
action
=
"store"
,
default
=
os
.
path
.
curdir
,
help
=
_
(
"Output directory for the mirrored repository"
))
self
.
parser
.
add_option_group
(
group
)
def
run
(
self
):
import
inary.fetcher
as
fetcher
packages
=
inary
.
db
.
packagedb
.
PackageDB
()
self
.
init
(
database
=
False
,
write
=
False
)
if
not
self
.
args
:
self
.
help
()
return
full_packages
=
[]
for
repo
in
self
.
args
:
full_packages
=
packages
.
list_packages
(
repo
)
for
pkgname
in
full_packages
:
pkg
,
repo
=
packages
.
get_package_repo
(
pkgname
,
repo
)
output
=
os
.
path
.
join
(
ctx
.
config
.
options
.
output_dir
,
os
.
path
.
dirname
(
pkg
.
packageURI
))
fetcher
.
fetch
([
pkgname
],
output
,
repo
)
inary/fetcher.py
Dosyayı görüntüle @
c59d78dd
...
...
@@ -483,7 +483,7 @@ def fetch_from_mirror(url, destdir=None, progress=None, destfile=None):
# Operation function
def
fetch
(
packages
=
None
,
path
=
os
.
path
.
curdir
):
def
fetch
(
packages
=
None
,
path
=
os
.
path
.
curdir
,
repo
=
None
):
"""
Fetches the given packages from the repository without installing, just downloads the packages.
@param packages: list of package names -> list_of_strings
...
...
@@ -495,7 +495,7 @@ def fetch(packages=None, path=os.path.curdir):
packagedb
=
inary
.
db
.
packagedb
.
PackageDB
()
repodb
=
inary
.
db
.
repodb
.
RepoDB
()
for
name
in
packages
:
package
,
repo
=
packagedb
.
get_package_repo
(
name
)
package
,
repo
=
packagedb
.
get_package_repo
(
name
,
repo
)
ctx
.
ui
.
info
(
_
(
"
\"
{0}
\"
package found in
\"
{1}
\"
repository."
)
.
format
(
package
.
name
,
repo
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment