pungi/0001-hash-the-Packages-tree-by-default-adding-a-nohash-op.patch

54 lines
2.0 KiB
Diff

From 45964282afc6a662d325df7955414d01803177dd Mon Sep 17 00:00:00 2001
From: Dennis Gilmore <dennis@ausil.us>
Date: Thu, 9 Feb 2012 09:12:55 -0600
Subject: [PATCH] hash the Packages tree by default, adding a --nohash option
for old style layout
---
src/bin/pungi.py | 4 ++++
src/pypungi/__init__.py | 6 +++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/src/bin/pungi.py b/src/bin/pungi.py
index 6455342..2fe5e7d 100755
--- a/src/bin/pungi.py
+++ b/src/bin/pungi.py
@@ -81,6 +81,8 @@ def main():
config.set('pungi', 'alldeps', "False")
if opts.isfinal:
config.set('pungi', 'isfinal', "True")
+ if opts.nohash:
+ config.set('pungi', 'nohash', "True")
# Actually do work.
mypungi = pypungi.Pungi(config, ksparser)
@@ -190,6 +192,8 @@ if __name__ == '__main__':
help='Force reuse of an existing destination directory (will overwrite files)')
parser.add_option("--isfinal", default=False, action="store_true",
help='Specify this is a GA tree, which causes betanag to be turned off during install')
+ parser.add_option("--nohash", default=False, action="store_true",
+ help='disable hashing the Packages trees')
parser.add_option("-c", "--config", dest="config",
help='Path to kickstart config file')
diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py
index 1ef3b8d..5d79fe7 100644
--- a/src/pypungi/__init__.py
+++ b/src/pypungi/__init__.py
@@ -668,7 +668,11 @@ class Pungi(pypungi.PungiBase):
basename = os.path.basename(po.relativepath)
local = po.localPkg()
- target = os.path.join(pkgdir, basename)
+ nohash = self.config.get('pungi', 'nohash')
+ if nohash:
+ target = os.path.join(pkgdir, basename)
+ else:
+ target = os.path.join(pkgdir, po.name[0].lower(), basename)
# Link downloaded package in (or link package from file repo)
try:
--
1.7.7.6