[Pkg-haskell-commits] [package-plan] 01/03: upgrade-to-lts.pl: Quick script to bump all LTS packages to their LTS version
Joachim Breitner
nomeata at moszumanska.debian.org
Sat Jun 27 13:42:12 UTC 2015
This is an automated email from the git hooks/post-receive script.
nomeata pushed a commit to branch LTS-2.15
in repository package-plan.
commit fc093f67a09fc9688b7a44ffa5d9164f678eb850
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Sat Jun 27 14:37:45 2015 +0200
upgrade-to-lts.pl: Quick script to bump all LTS packages to their LTS version
---
upgrade-to-lts.pl | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/upgrade-to-lts.pl b/upgrade-to-lts.pl
new file mode 100755
index 0000000..a9df954
--- /dev/null
+++ b/upgrade-to-lts.pl
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Slurp;
+
+my $packages = read_file('packages.txt');
+
+my %lts;
+print "Reading lts.config...\n";
+open LTS, "<", "lts.config" or die $!;
+while (<LTS>) {
+ chomp;
+ next if /^#/;
+ next if /^--/;
+ next if /^\s*$/;
+ next if /installed,?$/;
+ unless (m/^(?:constraints:)?\s+(.*?) ==(.*?),?$/) {
+ print "Ignoring unparseable line $.: $_\n";
+ }
+ my ($pkg,$version) = ($1,$2);
+
+ if ($packages =~ /^$pkg\s+([^\s]+)/m) {
+ my $before = $1;
+ if ($before ne $version) {
+ $packages =~ s/^$pkg\s+[^\s]+/$pkg $version/m;
+ printf "Bumped %s to %s\n", $pkg, $version;
+ }
+ }
+}
+close LTS;
+
+write_file('packages.txt', $packages);
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/package-plan.git
More information about the Pkg-haskell-commits
mailing list