summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2009-05-12 18:57:11 +0000
committerChristian Ruppert <idl0r@gentoo.org>2009-05-12 18:57:11 +0000
commit31ccf0ea750df895c50f281b2354d5f695bd74a0 (patch)
treea3db827bca5151f99fb7c3462da2cf6c1fae8fc8 /app-portage
parentVersion bump wrt security #269605. (diff)
downloadgentoo-2-31ccf0ea750df895c50f281b2354d5f695bd74a0.tar.gz
gentoo-2-31ccf0ea750df895c50f281b2354d5f695bd74a0.tar.bz2
gentoo-2-31ccf0ea750df895c50f281b2354d5f695bd74a0.zip
Revbump. echangelog: Update category/package when creating the initial ChangeLog, thanks to Serkan Kaba <serkan@gentoo.org>. Cleanup. Ignore .git dir when running echangelog in the repository root, fixes bug 199805 c8,c13. Improved git_unknown_objects(), git status parsing improved. Thanks to Andrew Gaffney <agaffney@gentoo.org> for testing etc. Fix regex, bug 269557, thanks to Samuli Suominen <ssuominen@gentoo.org>.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'app-portage')
-rw-r--r--app-portage/gentoolkit-dev/ChangeLog14
-rw-r--r--app-portage/gentoolkit-dev/files/echangelog-git.patch17
-rw-r--r--app-portage/gentoolkit-dev/files/echangelog.patch211
-rw-r--r--app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r2.ebuild (renamed from app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r1.ebuild)5
4 files changed, 226 insertions, 21 deletions
diff --git a/app-portage/gentoolkit-dev/ChangeLog b/app-portage/gentoolkit-dev/ChangeLog
index a0a887060dd9..43a868a3dc46 100644
--- a/app-portage/gentoolkit-dev/ChangeLog
+++ b/app-portage/gentoolkit-dev/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for app-portage/gentoolkit-dev
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/gentoolkit-dev/ChangeLog,v 1.63 2009/05/08 14:42:42 idl0r Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/gentoolkit-dev/ChangeLog,v 1.64 2009/05/12 18:57:11 idl0r Exp $
+
+*gentoolkit-dev-0.2.6.11-r2 (12 May 2009)
+
+ 12 May 2009; Christian Ruppert <idl0r@gentoo.org>
+ -gentoolkit-dev-0.2.6.11-r1.ebuild, +gentoolkit-dev-0.2.6.11-r2.ebuild,
+ +files/echangelog.patch, -files/echangelog-git.patch:
+ Revbump. echangelog: Update category/package when creating the initial
+ ChangeLog, thanks to Serkan Kaba <serkan@gentoo.org>. Cleanup. Ignore .git
+ dir when running echangelog in the repository root, fixes bug 199805
+ c8,c13. Improved git_unknown_objects(), git status parsing improved.
+ Thanks to Andrew Gaffney <agaffney@gentoo.org> for testing etc. Fix regex,
+ bug 269557, thanks to Samuli Suominen <ssuominen@gentoo.org>.
*gentoolkit-dev-0.2.6.11-r1 (08 May 2009)
diff --git a/app-portage/gentoolkit-dev/files/echangelog-git.patch b/app-portage/gentoolkit-dev/files/echangelog-git.patch
deleted file mode 100644
index b4651b66e8d4..000000000000
--- a/app-portage/gentoolkit-dev/files/echangelog-git.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: echangelog
-===================================================================
---- src/echangelog/echangelog (revision 589)
-+++ src/echangelog/echangelog (revision 617)
-@@ -686,6 +686,12 @@
- # Move things around and show the diff
- system "diff -U 0 $e $e.new";
- rename "$e.new", $e or warn("Can't rename $e.new: $!\n");
-+
-+ # git requires to re-add this file else it wouln't be included in the commit.
-+ if ($vcs eq "git")
-+ {
-+ system("$vcs{$vcs}{add} ${e}");
-+ }
- }
- }
-
diff --git a/app-portage/gentoolkit-dev/files/echangelog.patch b/app-portage/gentoolkit-dev/files/echangelog.patch
new file mode 100644
index 000000000000..b94d34a58d56
--- /dev/null
+++ b/app-portage/gentoolkit-dev/files/echangelog.patch
@@ -0,0 +1,211 @@
+--- src/echangelog/echangelog 2009-05-12 20:39:44.721829271 +0200
++++ src/echangelog/echangelog 2009-05-12 20:34:19.132577156 +0200
+@@ -11,6 +11,7 @@
+ use strict;
+ use POSIX qw(strftime getcwd setlocale);
+ use File::Find;
++use File::Basename;
+ use Getopt::Long;
+
+ # Fix bug 21022 by restricting to C locale
+@@ -144,6 +145,27 @@ sub changelog_info(%) {
+ close(INFO);
+ }
+
++sub update_cat_pn {
++ my $t = shift;
++ my $cwd = getcwd();
++
++ my $category = basename(dirname($cwd));
++ my $package_name = basename($cwd);
++
++ $t =~ s/^(# ChangeLog for).*/$1 $category\/$package_name/;
++
++ return $t;
++}
++
++# Just to ensure we don't get duplicate entries.
++sub mypush(\@@) {
++ my $aref = shift;
++
++ foreach my $value (@_) {
++ push(@{$aref}, $value) if !grep(/^\Q$value\E$/, @{$aref});
++ }
++}
++
+ GetOptions(
+ 'help' => \$opt_help,
+ 'strict' => \$opt_strict,
+@@ -166,7 +188,7 @@ if ( -d "CVS" ) {
+ open(GIT, '-|', "git rev-parse --git-dir 2>/dev/null");
+ $vcs = "git" if defined(<GIT>);
+ close(GIT);
+- last;
++ last if $vcs;
+ }
+ }
+ }
+@@ -178,22 +200,27 @@ if ( -d "CVS" ) {
+
+ # Read the current ChangeLog
+ if (-f 'ChangeLog') {
+- open I, '<ChangeLog' or die "Can't open ChangeLog for input: $!\n";
++ open(I, '<', 'ChangeLog') or die "Can't open ChangeLog for input: $!\n";
+ { local $/ = undef; $text = <I>; }
+- close I;
++ close(I);
+ } else {
+ # No ChangeLog here, maybe we should make one...
+ if (<*.ebuild>) {
+- open C, "portageq envvar PORTDIR |" or die "Can't find PORTDIR";
+- my ($new) = <C>;
+- close C;
+-
+- $new =~ s/\s+$//;
+- open I, "< $new/skel.ChangeLog"
+- or die "Can't open $new/skel.ChangeLog for input: $!\n";
++ open(C, '-|', "portageq portdir") or die "portageq returned with an error: $!\n";
++ my $portdir = <C>;
++ $portdir =~ s/\s+$//;
++ close(C);
++
++ die "Can't find PORTDIR\n" if (length $portdir == 0);
++
++ open(I, '<', "$portdir/skel.ChangeLog")
++ or die "Can't open $portdir/skel.ChangeLog for input: $!\n";
+ { local $/ = undef; $text = <I>; }
+- close I;
+- $text =~ s/^\*.*//ms; # don't need the fake entry
++ close(I);
++
++ $text =~ s/^\*.*//ms; # don't need the fake entry
++
++ $text = update_cat_pn($text);
+ } else {
+ die "This should be run in a directory with ebuilds...\n";
+ }
+@@ -238,49 +265,44 @@ while (<C>) {
+ my ($status, $filename) = ($1,$2);
+
+ if($vcs eq "git") {
+- open P, "git rev-parse --sq --show-prefix |";
++ open(P, '-|', "git rev-parse --sq --show-prefix");
+ my $prefix = <P>;
+- $prefix = substr($prefix, 0, -1);
+- close P;
++ close(P);
+
+- if ($filename =~ /$prefix(\S*)/) {
+- $filename = $1 ;
+- }
+- else {
+- next;
++ if (defined($prefix)) {
++ chomp($prefix);
++
++ if ($filename =~ /$prefix(\S*)/) {
++ $filename = $1 ;
++ }
++ else {
++ next;
++ }
+ }
+ }
+
+- if( -d $filename ) {
+- next;
+- }
++ next if -d $filename;
+
+- push @files, $filename;
++ push(@files, $filename);
+ ($actions{$filename} = $status) =~ tr/DARM/-+-/d;
+ }
+ }
+
+-# git only shows files already added so we need to check for unknown files
+-# separately here.
+-if($vcs eq "git") {
+- find(\&git_unknown_objects, "./");
+-}
+-
+ sub git_unknown_objects {
+ my $object = $_;
+- my ($dev,$ino,$mode,$nlink,$uid,$gid);
+
+- # Ignore empty directories - git doesn't version them and cvs removes them.
+- if ( (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && ! -d _ ) {
+- open C, $vcs." status $_ 2>&1 1>/dev/null |";
+-
+- while (<C>) {
+- $_ = <C>;
+- push @unknown, $object;
+- };
++ return if -d $object;
++ return if $File::Find::dir =~ m/^\.\/\.git\/?/;
+
+- close C;
+- };
++ open(C, '-|', "${vcs} status ${object} 2>&1 1>/dev/null");
++ push(@unknown, $object) if defined(<C>);
++ close(C);
++}
++
++# git only shows files already added so we need to check for unknown files
++# separately here.
++if($vcs eq "git") {
++ find(\&git_unknown_objects, "./");
+ }
+
+ # Separate out the trivial files for now
+@@ -398,18 +420,8 @@ sub sortfunc($$) {
+ return 0;
+ }
+
+-# Just to ensure we don't get duplicate entries.
+-sub mypush(\@@) {
+- my $aref = shift;
+-
+- foreach my $value (@_) {
+- push(@{$aref}, $value) if !grep(/^$value$/, @{$aref});
+- }
+-}
+-
+ # Forget ebuilds that only have changed copyrights, unless that's all
+ # the changed files we have
+-
+ @ebuilds = grep /\.ebuild$/, @files;
+ @files = grep !/\.ebuild$/, @files;
+
+@@ -626,18 +638,6 @@ if (@new_versions) {
+ or die "Failed to insert new entry (3)\n";
+ }
+
+-sub update_cat_pn {
+- my ($t) = @_;
+- my ($cwd) = getcwd();
+-
+- $cwd =~ m|.*/(\w+-\w+\|virtual)/([^/]+)|
+- or die "Can't figure out category/package.. sorry!\n";
+- my ($category, $package_name) = ($1, $2);
+- $t =~ s/^(# ChangeLog for).*/$1 $category\/$package_name/;
+-
+- return $t;
+-}
+-
+ # New packages and/or ones that have moved around often have stale data here.
+ # But only do that in places where ebuilds are around (as echangelog can be
+ # used in profiles/ and such places).
+@@ -686,6 +686,12 @@ for my $e (grep /\.ebuild$/, @files) {
+ # Move things around and show the diff
+ system "diff -U 0 $e $e.new";
+ rename "$e.new", $e or warn("Can't rename $e.new: $!\n");
++
++ # git requires to re-add this file else it wouln't be included in the commit.
++ if ($vcs eq "git")
++ {
++ system("$vcs{$vcs}{add} ${e}");
++ }
+ }
+ }
+
diff --git a/app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r1.ebuild b/app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r2.ebuild
index ad5aea2452d3..084992c06c1b 100644
--- a/app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r1.ebuild
+++ b/app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r1.ebuild,v 1.1 2009/05/08 14:42:42 idl0r Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-portage/gentoolkit-dev/gentoolkit-dev-0.2.6.11-r2.ebuild,v 1.1 2009/05/12 18:57:11 idl0r Exp $
EAPI="2"
@@ -20,8 +20,7 @@ DEPEND="sys-apps/portage
RDEPEND="${DEPEND}"
src_prepare() {
- # Re-add files to git if the copyright has been updated.
- epatch "${FILESDIR}/echangelog-git.patch"
+ epatch "${FILESDIR}/echangelog.patch"
}
src_install() {