Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37478681
en ru br
ALT Linux repos
S:0.02-alt2

Group :: System/Configuration/Packaging
RPM: apt-printchanges

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

pax_global_header00006660000000000000000000000064117152126120014510gustar00rootroot0000000000000052 comment=0fc7b17e20aebe8168b2c3be36200baef4a8db5c
apt-printchanges-0.01/000075500000000000000000000000001171521261200146755ustar00rootroot00000000000000apt-printchanges-0.01/.gear/000075500000000000000000000000001171521261200156715ustar00rootroot00000000000000apt-printchanges-0.01/.gear/rules000064400000000000000000000000071171521261200167430ustar00rootroot00000000000000tar: .
apt-printchanges-0.01/apt-printchanges000075500000000000000000000045641171521261200201030ustar00rootroot00000000000000#!/usr/bin/python
#
# apt-printchanges - Print changelog entry before
# installing/upgrading package
#
# Copyright (C) 2012 Evgenii Terechkov <evg@altlinux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, see
# <http://www.gnu.org/licenses/>.
#

from __future__ import with_statement
import sys
import time
import rpm

def getHeaders(filename):
"""Get package name, author, last changelog entry and timestamp for .rpm file.
"""
try:
with open(filename) as f:
(headers, _) = rpm.headerFromPackage(f.fileno())
Name = headers[rpm.RPMTAG_NAME]
Author = headers[rpm.RPMTAG_CHANGELOGNAME][0]
ChangelogEntry = headers[rpm.RPMTAG_CHANGELOGTEXT][0]
TimeStamp = headers[rpm.RPMTAG_CHANGELOGTIME][0]
except Exception, msg:
Name = filename
Author = Exception
ChangelogEntry = msg
TimeStamp = 0
return (Name,Author,ChangelogEntry, TimeStamp)

def Key(packager,text,timestamp):
"""Format key for packages dict
"""
keyformat = "%s %s\n%s"
return keyformat % (time.strftime("* %a %b %d %Y", time.localtime(timestamp)), packager, text)

if __name__ == '__main__':

filenames = sys.stdin.readlines()
pkgInfos = [getHeaders(f.rstrip()) for f in filenames]

try:
if pkgInfos:
print '=== apt-printchanges ==='
changesDict={}
for pkg, packager, text, timestamp in pkgInfos:
if not changesDict.has_key(Key(packager, text, timestamp)):
changesDict[Key(packager, text, timestamp)] = [pkg]
else:
changesDict[Key(packager, text, timestamp)].append(pkg)

for key, pkgs in changesDict.items():
print "==%s==\n%s" % (" ".join(pkgs),key)
except:
sys.exit(0)
apt-printchanges-0.01/apt-printchanges.spec000064400000000000000000000016341171521261200210240ustar00rootroot00000000000000Name: apt-printchanges
Version: 0.01
Release: alt3

Summary: Print last changelog for each installed/upgraded package
License: GPLv3+
Group: System/Configuration/Packaging

BuildArch: noarch

Packager: Evgenii Terechkov <evg@altlinux.org>

Source0: %name-%version.tar

%description
Print last changelog for each installed/upgraded package
%prep
%setup

%install
mkdir -p %buildroot%_bindir
install -p -m755 %name %buildroot%_bindir/
install -pD -m644 apt.conf %buildroot/etc/apt/apt.conf.d/20-%name.conf

%files
%_bindir/*
%config(noreplace) /etc/apt/apt.conf.d/*

%changelog
* Fri Feb 10 2012 Terechkov Evgenii <evg@altlinux.org> 0.01-alt3
- Format changelog record exactly as rpm do (date added)

* Wed Feb 8 2012 Terechkov Evgenii <evg@altlinux.org> 0.01-alt2
- Concat changelog for same packager/description pairs

* Sun Jan 29 2012 Terechkov Evgenii <evg@altlinux.org> 0.01-alt1
- Initial build for ALT Linux Sisyphus
apt-printchanges-0.01/apt.conf000064400000000000000000000000701171521261200163250ustar00rootroot00000000000000RPM::Pre-Install-Pkgs { "/usr/bin/apt-printchanges"; };
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin