/usr/bin/gen-ruby-trans-pkgs is in gem2deb 0.30.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #!/usr/bin/ruby
# Generate debian/control snippets
if ARGV.length != 1
puts "generate-ruby-transitional-packages OLD_SOURCE_PACKAGE"
exit(1)
end
version = `dpkg-parsechangelog`.split($/).grep(/^Version: /)[0].split[1]
package = `dh_listpackages`.split[0]
allpackages = `dh_listpackages`.split
binaries = []
`apt-cache showsrc #{ARGV[0]}`.split($/).grep(/^Binary/).each do |l|
binaries += l.split(/[, ]+/)[1..-1]
end
binaries.uniq!
binaries -= allpackages
rstring = binaries.map { |pkg| "#{pkg} (<< #{version}~)" }.join(', ')
puts "# For the replacement package"
puts "Replaces: #{rstring}"
puts "Breaks: #{rstring}"
puts "Provides: #{binaries.join(', ')}"
puts
puts "# Transitional packages"
binaries.each do |pkg|
puts <<-EOF
Package: #{pkg}
Section: oldlibs
Priority: extra
Architecture: all
Depends: ${misc:Depends}, #{package}
Description: Transitional package for #{package}
This is a transitional package to ease upgrades to the #{package}
package. It can safely be removed.
EOF
end
__END__
=head1 NAME
gen-ruby-trans-pkgs - generate ruby transitional packages
=head1 SYNOPSIS
B<gen-ruby-trans-pkgs> I<SOURCE_PKG_TO_REPLACE>
=head1 DESCRIPTION
B<gen-ruby-trans-pkgs> reads debian/control, debian/changelog, and the output
of apt-cache showsrc I<SOURCE_PKG_TO_REPLACE>, and generates debian/control
snippets to add transitional packages.
=head1 SEE ALSO
L<B<gem2deb>>(1)
=head1 COPYRIGHT AND AUTHORS
Copyright (c) 2011, Lucas Nussbaum <lucas@debian.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/>.
|