diff options
author | Nicolas Vigier <boklm@mageia.org> | 2012-12-04 13:18:55 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2012-12-04 13:18:55 +0000 |
commit | fa6e28fa34acb6167d5a70c138c5041d1b19d03d (patch) | |
tree | 4e8227c9e722d7f74e2b88c0cdc4a6012bf8f216 | |
parent | ad16dbd1dafba41e04a00428dc6ad83ee1651e73 (diff) | |
download | mgarepo-fa6e28fa34acb6167d5a70c138c5041d1b19d03d.tar mgarepo-fa6e28fa34acb6167d5a70c138c5041d1b19d03d.tar.gz mgarepo-fa6e28fa34acb6167d5a70c138c5041d1b19d03d.tar.bz2 mgarepo-fa6e28fa34acb6167d5a70c138c5041d1b19d03d.tar.xz mgarepo-fa6e28fa34acb6167d5a70c138c5041d1b19d03d.zip |
Allow keeping old rpm log in package directory
With this change, it is now possible to store the old rpm log inside the
package directory instead of using a separate directory (usually /misc/
directory). This can be done by changing the oldurl setting in
mgarepo.conf to '.' or anything starting with './'.
It becomes possible to have different import logs if using different
packages in different versions of the distribution instead of one log
file shared for all versions of the distribution.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | MgaRepo/log.py | 7 | ||||
-rw-r--r-- | MgaRepo/rpmutil.py | 5 |
3 files changed, 11 insertions, 3 deletions
@@ -1,4 +1,6 @@ +- allow keeping the old rpm log in the package directory if the oldurl + config value is set to '.' or starts with './' - add putsrpm command in man page (#4055) - fix putsrpm --help message (#4053) - update URLs for new wiki diff --git a/MgaRepo/log.py b/MgaRepo/log.py index 643f397..a1ea0bf 100644 --- a/MgaRepo/log.py +++ b/MgaRepo/log.py @@ -545,8 +545,11 @@ def get_old_log(pkgdirurl): svn = SVN() tmpdir = tempfile.mktemp() try: - pkgname = layout.package_name(pkgdirurl) - pkgoldurl = os.path.join(oldurl, pkgname) + if oldurl == '.' or oldurl.startswith('./'): + pkgoldurl = os.path.join(pkgdirurl, oldurl) + else: + pkgname = layout.package_name(pkgdirurl) + pkgoldurl = os.path.join(oldurl, pkgname) try: # we're using HEAD here because fixes in misc/ (oldurl) may # be newer than packages' last changed revision. diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py index 3a9ee83..f0d413b 100644 --- a/MgaRepo/rpmutil.py +++ b/MgaRepo/rpmutil.py @@ -298,7 +298,10 @@ def put_srpm(srpmfile, markrelease=False, striplog=True, branch=None, chlog.seek(0) #FIXME move it to layout.py oldurl = baseold or config.get("log", "oldurl") - pkgoldurl = mirror._joinurl(oldurl, srpm.name) + if oldurl == '.' or oldurl.startswith('./'): + pkgoldurl = os.path.join(pkgurl, oldurl) + else: + pkgoldurl = mirror._joinurl(oldurl, srpm.name) svn.mkdir(pkgoldurl, noerror=1, log="created old log directory for %s" % srpm.name) logtmp = tempfile.mktemp() |