From c3a0318a9ebf4a443d606c191393c075f9474695 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@cd1c1023-2f26-0410-ae45-c471fc1f0318> Date: Fri, 30 Nov 2007 09:34:23 +0000 Subject: [PATCH] - added commit message support - improved RSS style git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@783 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- TODO | 1 - libraries/activatorTools.py | 26 +++++++++++++++++--------- libraries/entropyConstants.py | 3 ++- libraries/serverConstants.py | 2 ++ 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/TODO b/TODO index 3d4e2397c..ea826d22a 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,4 @@ TODO list: - - RSS Extension: let developer sumbit a comment along with the revision upload - Community repositories - server: handle multiple packages for each scope with these abilities: - enable/disable it diff --git a/libraries/activatorTools.py b/libraries/activatorTools.py index b93507679..9490d525c 100644 --- a/libraries/activatorTools.py +++ b/libraries/activatorTools.py @@ -68,6 +68,10 @@ def sync(options, justTidy = False): if (rc == False): exit(401) else: + if (not activatorRequestNoAsk) and etpConst['rss-feed']: + etpRSSMessages['commitmessage'] = readtext(print_info(darkgreen("Please insert a commit message: "))) + elif etpConst['rss-feed']: + etpRSSMessages['commitmessage'] = "Autodriven Update" # if packages are ok, we can sync the database database(["sync"]) # now check packages checksum @@ -192,7 +196,7 @@ def packages(options): elif (opt == "--do-packages-check"): activatorRequestPackagesCheck = True - if len(options) == 0: + if not options: return if (options[0] == "sync"): @@ -698,10 +702,10 @@ def packages(options): else: exit(470) - # Now we should start to check all the packages in the packages directory - if (activatorRequestPackagesCheck): - import reagentTools - reagentTools.database(['md5check']) + # Now we should start to check all the packages in the packages directory + if (activatorRequestPackagesCheck): + import reagentTools + reagentTools.database(['md5check']) def database(options): @@ -790,7 +794,7 @@ def database(options): break if (mirrorsLocked): - # if the mirrors are locked, we need to change if we have + # if the mirrors are locked, we need to check if we have # the taint file in place. Because in this case, the one # that tainted the db, was me. if (dbLockFile): @@ -975,7 +979,7 @@ def uploadDatabase(uris): import gzip import bz2 - + ### PREPARE RSS FEED if etpConst['rss-feed']: import rssTools @@ -990,14 +994,18 @@ def uploadDatabase(uris): except: revision = "N/A" pass - title = ": "+etpConst['systemname']+" "+etpConst['product'][0].upper()+etpConst['product'][1:]+" "+etpConst['branch']+" :: Revision: "+revision + commitmessage = '' + if etpRSSMessages['commitmessage']: + commitmessage = ' :: '+etpRSSMessages['commitmessage'] + title = ": "+etpConst['systemname']+" "+etpConst['product'][0].upper()+etpConst['product'][1:]+" "+etpConst['branch']+" :: Revision: "+revision+commitmessage link = etpConst['rss-base-url'] # create description added_items = db_actions.get("added") if added_items: for atom in added_items: + mylink = link+"?search="+atom.split("~")[0]+"&arch="+etpConst['currentarch']+"&product="+etpConst['product'] description = atom+": "+added_items[atom]['description'] - rssClass.addItem(title = "Added/Updated"+title, link = link, description = description) + rssClass.addItem(title = "Added/Updated"+title, link = mylink, description = description) removed_items = db_actions.get("removed") if removed_items: for atom in removed_items: diff --git a/libraries/entropyConstants.py b/libraries/entropyConstants.py index 801d579b3..831ff95b1 100644 --- a/libraries/entropyConstants.py +++ b/libraries/entropyConstants.py @@ -482,7 +482,8 @@ etpExitMessages = { # those dicts will be dumped to a file and used by activator to update and updload .rss etpRSSMessages = { 'added': {}, # packages that has been added - 'removed': {} # packages that has been removed + 'removed': {}, # packages that has been removed + 'commitmessage': "" # commit message from the guy who is going to submit a repository update } ### Application disk cache diff --git a/libraries/serverConstants.py b/libraries/serverConstants.py index 315bb12d2..6619f1547 100644 --- a/libraries/serverConstants.py +++ b/libraries/serverConstants.py @@ -95,6 +95,8 @@ if (os.path.isfile(etpConst['reagentconf'])): etpConst['rss-name'] = feedname elif line.startswith("rss-base-url|") and (len(line.split("rss-base-url|")) == 2): etpConst['rss-base-url'] = line.split("rss-base-url|")[1] + if not etpConst['rss-base-url'][-1] == "/": + etpConst['rss-base-url'] += "/" elif line.startswith("rss-website-url|") and (len(line.split("rss-website-url|")) == 2): etpConst['rss-website-url'] = line.split("rss-website-url|")[1]