aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2016-02-16 22:14:27 +0100
committerPapoteur <papoteur@mageialinux-online.org>2016-02-16 22:14:27 +0100
commit7db6e1f0fcfcd94ee1b89c6e1dedb860fcfd7e48 (patch)
tree5644266592bddedb03a5109e5d5c5c19820b357d /MgaRepo
parent14c5291c6b6b5afb4db67efa6ead28c195e2151f (diff)
downloadmgarepo-7db6e1f0fcfcd94ee1b89c6e1dedb860fcfd7e48.tar
mgarepo-7db6e1f0fcfcd94ee1b89c6e1dedb860fcfd7e48.tar.gz
mgarepo-7db6e1f0fcfcd94ee1b89c6e1dedb860fcfd7e48.tar.bz2
mgarepo-7db6e1f0fcfcd94ee1b89c6e1dedb860fcfd7e48.tar.xz
mgarepo-7db6e1f0fcfcd94ee1b89c6e1dedb860fcfd7e48.zip
add obsolete path in function layout_dir of layout.py
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/layout.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/MgaRepo/layout.py b/MgaRepo/layout.py
index 2cc670e..97f634d 100644
--- a/MgaRepo/layout.py
+++ b/MgaRepo/layout.py
@@ -15,7 +15,9 @@ def layout_dirs():
branches_dir = os.path.normpath(branches_dir)
backports_dir = config.get("global", "backports-dir", "backports/")
backports_dir = os.path.normpath(backports_dir)
- return devel_branch, branches_dir, backports_dir
+ obsolete_dir = config.get("global", "obsolete-dir", "obsolete/")
+ obsolete_dir = os.path.normpath(obsolete_dir)
+ return devel_branch, branches_dir, backports_dir, obsolete_dir
def get_url_revision(url, retrieve=True):
"""Get the revision from a given URL
@@ -133,7 +135,7 @@ def repository_url(mirrored=False):
return url
def package_url(name_or_url, version=None, release=None, distro=None, backports=None,
- mirrored=True):
+ mirrored=True, obsolete=None):
"""Returns a tuple with the absolute package URL and its name
@name_or_url: name, relative path, or URL of the package. In case it is
@@ -153,13 +155,15 @@ def package_url(name_or_url, version=None, release=None, distro=None, backports=
repository_url(), pkgdirurl)
else:
name = name_or_url
- devel_branch, branches_dir, backports_dir = layout_dirs()
+ devel_branch, branches_dir, backports_dir, obsolete_dir= layout_dirs()
if distro or "/" in name:
default_branch = branches_dir
if distro:
default_branch = os.path.join(default_branch, distro)
elif backports:
default_branch = os.path.join(backports_dir, backports)
+ elif obsolete:
+ default_branch = os.path.join(obsolete_dir)
else:
default_branch = devel_branch # cauldron
path = os.path.join(default_branch, name)
@@ -192,7 +196,7 @@ def distro_branch(pkgdirurl):
found = None
repo = repository_url()
if same_base(repo, pkgdirurl):
- devel_branch, branches_dir, backports_dir = layout_dirs()
+ devel_branch, branches_dir, backports_dir, obsolete_dir = layout_dirs()
repo_path = urllib.parse.urlparse(repo)[2]
devel_path = os.path.join(repo_path, devel_branch)
branches_path = os.path.join(repo_path, branches_dir)