If a previous version of git was installed on a system without a
proper Error.pm, git will install its own. But the next time
git is compiled on that system, that Error.pm will prevent git from
installing its own copy the second time. This causes a broken
git install on such systems.
This patch fixes this bug by tagging git's Error.pm with an
INSTALLED_BY flag, and checking for it during the compile.
Signed-off-by: Chris Frey <cdfrey@foursquare.net>
---
I use 'stow' to handle multiple versions of git installations.
So when I uninstall a version of git, all those files are
truly gone. Including Error.pm.
I think it is wise to mark our own copy of Error.pm in some way
anyhow, just so people can tell the difference between
versions on their systems.
The drawback to this patch is that once git installs its own
copy, it will always install its own copy, unless the user
uninstalls the old git first. Usually this is the desired
behaviour, but my perl-fu isn't strong enough to make this
check even smarter. Ideally, if a newer version is on the
system already, git shouldn't have to install its own.
And on the last hand, this whole automated, secondary Error.pm
installation method is rather suspect when it comes to creating
binary packages. Hopefully distro maintainers never build git
packages on systems with a git-Error.pm, while also blindly trusting
git's make install.
I'd love to see this in the official git tree soon, so I don't
run into these issues myself. :-) Tips on how to make this
smarter are welcome.
- Chris
perl/Makefile.PL | 14 ++++++++++++--
perl/private-Error.pm | 1 +
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 320253e..26f7a8c 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -11,9 +11,19 @@ MAKE_FRAG
my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');
# We come with our own bundled Error.pm. It's not in the set of default
-# Perl modules so install it if it's not available on the system yet.
+# Perl modules. So, unless it was a copy we installed, install it
+# if it's not available on the system yet.
eval { require Error };
-if ($@ || $Error::VERSION < 0.15009) {
+if ($@ || $Error::VERSION < 0.15009 || $Error::INSTALLED_BY eq 'git') {
+ if ($Error::INSTALLED_BY eq 'git') {
+ print "**************************************************\n";
+ print "WARNING: detected an Error.pm from a previous git\n";
+ print " install, so assuming that you wish to\n";
+ print " continue using git's version. If this is\n";
+ print " not the case, uninstall your old version\n";
+ print " of git before compiling the new.\n";
+ print "**************************************************\n";
+ }
$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';
}
diff --git a/perl/private-Error.pm b/perl/private-Error.pm
index 11e9cd9..a399983 100644
--- a/perl/private-Error.pm
+++ b/perl/private-Error.pm
@@ -16,6 +16,7 @@ use vars qw($VERSION);
use 5.004;
$VERSION = "0.15009";
+$Error::INSTALLED_BY = "git";
use overload (
'""' => 'stringify',
--
1.5.4.4
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Linus Torvalds | Linux 2.6.27-rc8 |
| Andi Kleen | [PATCH x86] [2/16] Add a counter for per cpu clocksource watchdog checks and repor... |
| David Miller | Slow DOWN, please!!! |
| Greg KH | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
git: | |
| Jeff King | Re: [PATCH] Color support added to git-add--interactive. |
| Yann Dirson | Re: irc usage.. |
| Peter Stahlir | Git as a filesystem |
| Junio C Hamano | Re: [PATCH 3/3] Teach "git branch" about --new-workdir |
| new_guy | Code signing in OpenBSD |
| Jason Dixon | Wasting our Freedom |
| Nick Guenther | Re: Real men don't attack straw men |
| Daniel Ouellet | identifying sparse files and get ride of them trick available? |
| Wolfgang Walter | Re: Kernel oops with 2.6.26, padlock and ipsec: probably problem with fpu state ch... |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Tomasz Grobelny | [PATCH 0/5] [DCCP]: Queuing policies |
| Arjan van de Ven | Re: [GIT]: Networking |
| high memory | 8 hours ago | Linux kernel |
| semaphore access speed | 11 hours ago | Applications and Utilities |
| the kernel how to power off the machine | 12 hours ago | Linux kernel |
| Easter Eggs in windows XP | 15 hours ago | Windows |
| Shared swap partition | 16 hours ago | Linux general |
| Root password | 16 hours ago | Linux general |
| Where/when DNOTIFY is used? | 18 hours ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 20 hours ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 21 hours ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 1 day ago | Linux general |
