Ticket #6: repodiff-clogdelta.patch

File repodiff-clogdelta.patch, 1.5 kB (added by mschwendt, 3 years ago)

patch for yum-utils repodiff

  • repodiff

    old new  
    77# This program is distributed in the hope that it will be useful, 
    88# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    99# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    10 # GNU Library General Public License for more details. 
     10# GNU General Public License for more details. 
    1111# 
    1212# You should have received a copy of the GNU General Public License 
    1313# along with this program; if not, write to the Free Software 
     
    1717import yum 
    1818import rpmUtils 
    1919import sys 
    20 import time 
     20import time, datetime 
    2121import os 
    2222import locale 
    2323from yum.misc import to_unicode 
     
    199199            # for any newer clog in pkg 
    200200            # print it 
    201201            oldlogs = oldpkg.changelog 
    202             oldlogs.sort() 
    203             oldlogs.reverse() 
    204202            if len(oldlogs): 
    205203                oldtime = oldlogs[0][0] 
    206                 clogdelta = [] 
    207204                for (t, author, content) in  pkg.changelog: 
    208                       if t > oldtime: 
    209                           msg += "* %s %s\n%s\n\n" % (time.ctime(int(t)),  
     205                    if t > oldtime: 
     206                        msg += "* %s %s\n%s\n\n" % (datetime.date.fromtimestamp(int(t)).strftime("%a %b %d %Y"),  
    210207                            to_unicode(author), to_unicode(content)) 
    211208            if opts.size: 
    212209                sizechange = int(pkg.size) - int(oldpkg.size)