Changeset 405
- Timestamp:
- 11/15/11 09:54:40 (12 years ago)
- Files:
-
- 1 added
- 1 deleted
- 6 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
bot/trunk/Makefile.PL
r378 r405 4 4 # the contents of the Makefile that is written. 5 5 WriteMakefile( 6 NAME => 'Sophie:: Tools',6 NAME => 'Sophie::Bot', 7 7 VERSION_FROM => 'lib/Sophie/Bot.pm', # finds $VERSION 8 8 PREREQ_PM => {}, # e.g., Module::Name => 1.1 … … 12 12 EXE_FILES => [ qw( 13 13 bin/sophie-bot 14 bin/sophie-rpm15 14 ) ], 16 15 macro => { … … 34 33 \tsvn log > ChangeLog 35 34 36 sophie- tools.spec: sophie-tools.spec.in Makefile35 sophie-bot.spec: sophie-bot.spec.in Makefile 37 36 \tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@ 38 37 39 rpm: \$(DISTVNAME).tar.gz sophie- tools.spec38 rpm: \$(DISTVNAME).tar.gz sophie-bot.spec 40 39 \tmkdir ./noarch || : 41 40 \trpmbuild -ba --clean\\ … … 44 43 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 45 44 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 46 \t sophie- tools.spec45 \t sophie-bot.spec 47 46 48 svnrpm: \$(DISTVNAME).tar.gz sophie- tools.spec47 svnrpm: \$(DISTVNAME).tar.gz sophie-bot.spec 49 48 \tmkdir \$(DESTRPMDIR)/noarch || : 50 49 \trpmbuild -ba --clean\\ … … 54 53 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 55 54 \t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ 56 \t sophie- tools.spec55 \t sophie-bot.spec 57 56 58 57 EOF -
bot/trunk/sophie-bot.spec.in
r404 r405 1 1 # $Id$ 2 2 3 %define realname Sophie- Tools3 %define realname Sophie-Bot 4 4 %define version @VERSION@ 5 5 %define release %mkrel %{?svnrelease:0.%{svnrelease}}%{?!svnrelease:1} 6 6 7 Name: sophie- tools7 Name: sophie-bot 8 8 Version: %{version} 9 9 Release: %{release} -
tools/trunk/MANIFEST
r312 r405 4 4 README 5 5 bin/sophie-rpm 6 bin/sophie-rpm2 6 7 lib/Sophie/Client.pm 7 8 lib/Sophie/Client/Transaction.pm -
tools/trunk/Makefile.PL
r301 r405 4 4 # the contents of the Makefile that is written. 5 5 WriteMakefile( 6 NAME => 'Sophie -tools',6 NAME => 'Sophie::Tools', 7 7 VERSION_FROM => 'lib/Sophie/Client.pm', # finds $VERSION 8 8 PREREQ_PM => {}, # e.g., Module::Name => 1.1 9 9 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 10 (AUTHOR => 'Olivier Thauvin <nanardon@nanardon.zarb.org>') : ()), 10 (ABSTRACT_FROM => 'lib/Sophie/Client.pm', # retrieve abstract from module 11 AUTHOR => 'Olivier Thauvin <nanardon@nanardon.zarb.org>') : ()), 11 12 EXE_FILES => [ qw( 12 13 bin/sophie-rpm 13 )], 14 bin/sophie-rpm2 15 ) ], 16 macro => { 17 INSTALLMAN5DIR => '$(PERLPREFIX)/share/man/man5', 18 DESTINSTALLMAN5DIR => '$(DESTDIR)$(INSTALLMAN5DIR)', 19 INST_MAN5DIR => 'blib/man5', 20 DESTRPMDIR => '$(shell pwd)' 21 }, 14 22 ); 23 24 package MY; 25 26 sub postamble { 27 <<EOF; 28 #.PHONY .= svnmanifest 29 30 svnmanifest: 31 \tsvn ls -R| grep -v "/\$\$" > MANIFEST 32 33 ChangeLog: 34 \tsvn log > ChangeLog 35 36 sophie-tools.spec: sophie-tools.spec.in Makefile 37 \tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@ 38 39 rpm: \$(DISTVNAME).tar.gz sophie-tools.spec 40 \tmkdir ./noarch || : 41 \trpmbuild -ba --clean\\ 42 \t --define "_sourcedir `pwd`" \\ 43 \t --define "_specdir `pwd`" \\ 44 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 45 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 46 \t sophie-tools.spec 47 48 svnrpm: \$(DISTVNAME).tar.gz sophie-tools.spec 49 \tmkdir \$(DESTRPMDIR)/noarch || : 50 \trpmbuild -ba --clean\\ 51 \t --define "_sourcedir `pwd`" \\ 52 \t --define "_specdir `pwd`" \\ 53 \t --define "_srcrpmdir \$(DESTRPMDIR)" \\ 54 \t --define "_rpmdir \$(DESTRPMDIR)" \\ 55 \t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\ 56 \t sophie-tools.spec 57 58 EOF 59 } 60 61 sub installbin { 62 my $self = shift; 63 my $inherited = $self->SUPER::installbin(@_); 64 $inherited; 65 } 66 67 sub top_targets { 68 my $inherited = shift->SUPER::top_targets(@_); 69 $inherited; 70 } 71 72 sub install { 73 my ($self) = @_; 74 my $section = $self->SUPER::install(); 75 76 $section =~ s/(^install ::.*)/$1 install_config install_templates/m; 77 78 $section .= q[ 79 install_config :: 80 81 install_templates :: 82 ]; 83 84 return $section; 85 } -
tools/trunk/bin/sophie-rpm
r312 r405 142 142 } 143 143 144 my $res = $ts->run; 144 my $res = $ts->run( 145 verbose => $verbose, 146 ); 145 147 $ts->summary if (@ARGV > 1); 146 148 print "\nThis transaction would failed\n" if(!$res); -
tools/trunk/lib/Sophie/Client.pm
r312 r405 57 57 } 58 58 59 sub pkgid_to_filename { 60 my ($self, $pkgid) = @_; 61 62 my $res = $self->send_request('rpms.basicinfo', $pkgid); 63 if (ref $res && !$res->is_fault) { 64 return $res->value->{filename}; 65 } else { 66 die "XML RPC error"; 67 } 68 } 69 59 70 sub ts { 60 71 my ($self, $distrib) = @_; -
tools/trunk/lib/Sophie/Client/Transaction.pm
r313 r405 105 105 foreach($res->value->{pool}) { 106 106 } 107 } else { 108 die( ref $res ? $res->string : $res); 107 109 } 108 110 } … … 119 121 foreach(@{ $res->value->{pkg} || []}) { 120 122 $self->{removed}{pkg}{$_} = 1; 123 } 124 foreach(@{ $res->value->{pool} || []}) { 125 $self->{removed}{pool}{$_} = 1; 126 } 127 } 128 } 129 130 sub find_obsoletes { 131 my ($self, $rpmid, %options) = @_; 132 my $res = $self->client->send_request( 133 'analysis.find_obsoletes', 134 $self->distrib, 135 $rpmid, 136 $self->rpmid 137 ); 138 if (ref $res && !$res->is_fault) { 139 foreach(@{ $res->value->{pkg} || []}) { 140 if ($options{verbose}) { 141 warn sprintf("%s obsolete %s\n", 142 $self->{rpms}{$rpmid}, 143 $self->show_pkg($_) 144 ); 145 } 146 147 $self->{removed}{pkg}{$_} = 1; 148 } 149 foreach(@{ $res->value->{pool} || []}) { 150 $self->{removed}{pool}{$_} = 1; 151 } 152 } 153 } 154 155 sub find_updates { 156 my ($self, $rpmid, %options) = @_; 157 my $res = $self->client->send_request( 158 'analysis.find_updates', 159 $self->distrib, 160 $rpmid, 161 $self->rpmid 162 ); 163 if (ref $res && !$res->is_fault) { 164 foreach(@{ $res->value->{pkg} || []}) { 165 $self->{removed}{pkg}{$_} = 1; 166 if ($options{verbose}) { 167 warn sprintf("%s update %s\n", 168 $self->{rpms}{$rpmid}, 169 $self->show_pkg($_) 170 ); 171 } 121 172 } 122 173 foreach(@{ $res->value->{pool} || []}) { … … 235 286 my ($self, %options) = @_; 236 287 288 warn "Finding package to remove\n"; 289 foreach ($self->rpmid) { 290 $self->find_updates($_, %options); 291 $self->find_obsoletes($_, %options); 292 } 293 237 294 warn "Checking rpm are not obsoleted\n"; 238 295 foreach ($self->rpmid) { -
tools/trunk/sophie-tools.spec.in
r404 r405 1 %define realname Sophie-tools 2 %define version 0.01 3 %define release %mkrel 1 1 # $Id: sophie-tools.spec.in 400 2011-11-11 17:11:23Z nanardon $ 4 2 5 Name: Sophie-tools 3 %define realname Sophie-Tools 4 %define version @VERSION@ 5 %define release %mkrel %{?svnrelease:0.%{svnrelease}}%{?!svnrelease:1} 6 7 Name: sophie-tools 6 8 Version: %{version} 7 9 Release: %{release} 8 10 License: GPL or Artistic 9 11 Group: Development/Perl 10 Summary: Sophie Tools12 Summary: Sophie's tools 11 13 Source: %{realname}-%{version}.tar.gz 12 Url: http://s ophie.zarb.org/14 Url: http://search.cpan.org/dist/%{realname} 13 15 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot 14 16 BuildArch: noarch 17 BuildRequires: perl(RPC::XML) 15 18 16 BuildRequires: perl(RPC::XML::Client) 19 Requires: perl-Term-ReadLine-Gnu 20 Requires: perl(Config::General) 21 Requires: perl(POE::Component::IRC) 17 22 18 23 %description 19 Tools to query and check rpms using Sophie's website. 24 Command line tools to query Sophie website (http://sophie.zarb.org/) 20 25 21 26 %prep … … 33 38 %makeinstall_std 34 39 35 36 40 %clean 37 41 rm -rf %buildroot … … 41 45 %doc Changes README 42 46 %_bindir/* 43 %{_mandir}/man1/* 44 %{_mandir}/man3/* 47 %{_mandir}/*/* 45 48 %perl_vendorlib/* 46 49
Note: See TracChangeset
for help on using the changeset viewer.