URL: https://github.com/freeipa/bind-dyndb-ldap/pull/13
Author: tomaskrizek
 Title: #13: releng: remove obsolete Trac scripts
Action: opened

PR body:
"""
Helper scripts for Trac are no longer necessary, because project was
migrated to pagure.io.
"""

To pull the PR as Git branch:
git remote add ghbind-dyndb-ldap https://github.com/freeipa/bind-dyndb-ldap
git fetch ghbind-dyndb-ldap pull/13/head:pr13
git checkout pr13
From f8c1faede749c5a853e79424c217e1765dd69e6d Mon Sep 17 00:00:00 2001
From: Tomas Krizek <tkri...@redhat.com>
Date: Thu, 30 Mar 2017 15:05:52 +0200
Subject: [PATCH] releng: remove obsolete Trac scripts

Helper scripts for Trac are no longer necessary, because project was
migrated to pagure.io.
---
 releng/README      |  5 -----
 releng/trac.py     | 42 ------------------------------------------
 releng/tracvers.py | 47 -----------------------------------------------
 3 files changed, 94 deletions(-)
 delete mode 100644 releng/trac.py
 delete mode 100755 releng/tracvers.py

diff --git a/releng/README b/releng/README
index 8bdb169..54bb8a9 100644
--- a/releng/README
+++ b/releng/README
@@ -21,13 +21,8 @@ bumpver.py
 Increments version number in configure.ac and SPEC file and creates a signed
 tag for current release.
 
-tracvers.py
-~~~~~~~~~~~
-Creates Trac version for each Git tag.
-
 
 Auxiliary scripts
 -----------------
 These scripts are not intended for usage from command line:
 - srcversion.py
-- trac.py
diff --git a/releng/trac.py b/releng/trac.py
deleted file mode 100644
index cba97fe..0000000
--- a/releng/trac.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (C) 2014  bind-dyndb-ldap authors; see COPYING for license
-#
-
-import logging
-import os
-import re
-import json
-import xmlrpc.client
-
-log = logging.getLogger('trac')
-
-class Trac():
-    def __init__(self, protocol, url, username, passwd):
-        self.baseurl = '%s://%s' % (protocol, url)
-        loginurl = '%s://%s:%s@%s/login/xmlrpc' % (protocol, username, passwd, url)
-        self.api = xmlrpc.client.ServerProxy(loginurl)
-    
-    def match_ticket_url(self, line):
-        return re.match("^ +%s/ticket/([0-9]+) *$" % self.baseurl, line)
-
-    def get_ticket_attrs(self, ticketid):
-        ticket = self.api.ticket.get(ticketid)
-        assert str(ticket[0]) == str(ticketid)
-        return ticket[3]
-
-def trac_autoconf():
-    """
-    Configuration file format is:
-    {"protocol": "https",
-     "url": "fedorahosted.org/bind-dyndb-ldap",
-     "username": "FedoraUserName",
-     "passwd": "FedoraPassword"}
-    """
-    config = json.load(open(os.path.expanduser('~/.trac')))
-    return Trac(**config)
-
-if __name__ == "__main__":
-    t = trac_autoconf()
-    logging.basicConfig(level=logging.DEBUG)
-    log.debug(t.api)
diff --git a/releng/tracvers.py b/releng/tracvers.py
deleted file mode 100755
index 36b0f14..0000000
--- a/releng/tracvers.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (C) 2014  bind-dyndb-ldap authors; see COPYING for license
-#
-
-"""
-Create Trac version for each Git tag.
-"""
-
-from datetime import datetime
-import logging
-from subprocess import check_output, check_call
-
-from trac import trac_autoconf
-
-logging.basicConfig(level=logging.DEBUG)
-log = logging.getLogger('tracver')
-
-tr = trac_autoconf()
-
-# version in Trac has format '1.2'
-trac_versions = set()
-for ver in tr.api.ticket.version.getAll():
-    trac_versions.add("v%s" % ver)
-log.debug('Trac versions: %s', trac_versions)
-
-# version in Git is tag named like 'v1.2'
-git_versions = set()
-for tag in check_output(['git','tag']).decode('ascii').strip().split('\n'):
-    # these are sins of young developers
-    if tag == 'v0.1.0-b' or tag == 'v0.1.0-a1':
-        tag = tag.translate({ord('-'): None})
-    git_versions.add(tag)
-log.debug('Git versions: %s', git_versions)
-
-new_versions = git_versions - trac_versions
-log.debug('New versions missing in Trac: %s', new_versions)
-
-# add new versions to Trac
-for tag in new_versions:
-    time = check_output(['git', 'log', '--format=format:%ai', '%s~1..%s'
-        % (tag, tag)]).decode('ascii').strip()
-    time = datetime.strptime(time, "%Y-%m-%d %H:%M:%S %z")
-    version = tag[1:]
-    log.info('Adding version %s with timestamp %s', version, time)
-    tr.api.ticket.version.create(version, {'time': time, 'description': ''})
-
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to