{"thread":{"id":"6850","subject":"Error.pm: add configuration variable in Makefile","startedAt":"2007-02-16T21:00:15Z","lastAt":"2007-02-18T08:45:32Z","messageCount":4,"participants":["Michael","Junio C Hamano","Sergio Callegari"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34830","messageId":"200702162200.15241.barra_cuda@katamail.com","threadId":"6850","inReplyTo":null,"subject":"Error.pm: add configuration variable in Makefile","fromName":"Michael","fromEmail":"barra_cuda@katamail.com","sentAt":"2007-02-16T21:00:15Z","receivedAt":"2007-02-16T21:00:15Z","isPatch":false,"sender":{"key":"barra_cuda@katamail.com","avatar":"https://avatars.githubusercontent.com/u/16371673?v=4"},"body":"When compiling, we check in perl/Makefile.PL if Error.pm is available. If not, \nwe use our Error.pm instead. So, after a \"make install\" the system does have \nan Error.pm. This is fine, unless we are used to create an \nrpm/deb/whatever-it-is by ourselves and install it with the system's package \nmanager: in this case, in fact, the git package we are building will have an \nError.pm only if the package currently installed does not. Of course, once we \ninstall the new package, the next one won't ship Error.pm because \nperl/Makefile.PL thinks it doesn't need to; but that's obviously wrong, since \nthe package manager will delete the old Error.pm when installing the new git \npackage.\n\nI guess we should use at least a configuration variable\n(USE_PRIVATE_ERROR_PERL?) to let the user decide what to do: either force\nthe use of Error.pm shipped with git or just go on as we do today.\n\nSomething like the following, but less ugly...\n\n---\ndiff --git a/Makefile b/Makefile\nindex 40bdcff..ff886df 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -101,6 +101,9 @@ all::\n # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's\n # MakeMaker (e.g. using ActiveState under Cygwin).\n #\n+# Define USE_PRIVATE_ERROR_PERL if you want to force the use of\n+# perl/private-Error.pm (e.g. for packaging purposes).\n+#\n \n GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n \t@$(SHELL_PATH) ./GIT-VERSION-GEN\n@@ -580,6 +583,9 @@ endif\n ifdef NO_PERL_MAKEMAKER\n \texport NO_PERL_MAKEMAKER\n endif\n+ifdef USE_PRIVATE_ERROR_PERL\n+\texport USE_PRIVATE_ERROR_PERL\n+endif\n \n # Shell quote (do not use $(call) to accommodate ancient setups);\n \ndiff --git a/perl/Makefile b/perl/Makefile\nindex 099beda..84b16f9 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -27,6 +27,9 @@ $(makfile): ../GIT-CFLAGS Makefile\n \tcp private-Error.pm $(instdir_SQ)/Error.pm' >> $@\n \techo instlibdir: >> $@\n \techo '\techo $(instdir_SQ)' >> $@\n+else ifdef USE_PRIVATE_ERROR_PERL\n+$(makfile): Makefile.PL ../GIT-CFLAGS\n+\t'$(PERL_PATH_SQ)' $< useerror PREFIX='$(prefix_SQ)'\n else\n $(makfile): Makefile.PL ../GIT-CFLAGS\n \t'$(PERL_PATH_SQ)' $< PREFIX='$(prefix_SQ)'\ndiff --git a/perl/Makefile.PL b/perl/Makefile.PL\nindex 9b117fd..f11affc 100644\n--- a/perl/Makefile.PL\n+++ b/perl/Makefile.PL\n@@ -13,7 +13,7 @@ my %pm = ('Git.pm' => '$(INST_LIBDIR)/Git.pm');\n # We come with our own bundled Error.pm. It's not in the set of default\n # Perl modules so install it if it's not available on the system yet.\n eval { require Error };\n-if ($@) {\n+if ($@ || $ARGV[0] eq 'useerror') {\n \t$pm{'private-Error.pm'} = '$(INST_LIBDIR)/Error.pm';\n }\n \n"},{"id":"34832","messageId":"7vzm7d3iod.fsf@assigned-by-dhcp.cox.net","threadId":"6850","inReplyTo":"200702162200.15241.barra_cuda@katamail.com","subject":"Re: Error.pm: add configuration variable in Makefile","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-16T21:18:42Z","receivedAt":"2007-02-16T21:18:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael <barra_cuda@katamail.com> writes:\n\n> When compiling, we check in perl/Makefile.PL if Error.pm is available. If not, \n> we use our Error.pm instead. So, after a \"make install\" the system does have \n> an Error.pm. This is fine, unless we are used to create an \n> rpm/deb/whatever-it-is by ourselves and install it with the system's package \n> manager.\n\nThe private copy is only to help people who build from the\nsource _and_ are lazy enough to install Error.pm from more\nofficial sources (either CPAN or officially pacakged ones).\n\nMy preference is to never allow out private copy to leak into\nbinary packages, and have our binary packages _always_ depend on\nthe officially packaged ones.\n"},{"id":"34871","messageId":"loom.20070217T152508-6@post.gmane.org","threadId":"6850","inReplyTo":"200702162200.15241.barra_cuda@katamail.com","subject":"Re: Error.pm: add configuration variable in Makefile","fromName":"Sergio Callegari","fromEmail":"scallegari@arces.unibo.it","sentAt":"2007-02-17T14:38:58Z","receivedAt":"2007-02-17T14:38:58Z","isPatch":false,"sender":{"key":"scallegari@arces.unibo.it","avatar":null},"body":"Michael <barra_cuda <at> katamail.com> writes:\n\n> \n> When compiling, we check in perl/Makefile.PL if Error.pm is available. If not, \n> we use our Error.pm instead. So, after a \"make install\" the system does have \n> an Error.pm. This is fine, unless we are used to create an \n> rpm/deb/whatever-it-is by ourselves and install it with the system's package \n> manager: in this case, in fact, the git package we are building will have an \n> Error.pm only if the package currently installed does not. Of course, once we \n> install the new package, the next one won't ship Error.pm because \n> perl/Makefile.PL thinks it doesn't need to; but that's obviously wrong, since \n> the package manager will delete the old Error.pm when installing the new git \n> package.\n> \n> \n\nApart from those making rpm/deb/whatever, I see another scenario where the\ncurrent selection logic for systemwide Error.pm and private Error.pm may fail.\nThis is if one uses GNU Stow for managing software that is not managed by the\ndistro packaging system... whatever.\n\nA typical upgrade flow would be:\n\nYou have Git version X installed in /usr/local/stow/Git-X and stowed.\nYou now compile version X+1 of git, with prefix /usr/local/stow/Git-X+1\n(here the current Error.pm logic thinks that there is no need for the private  \n Error.pm since it finds an Error.pm -- only it is the Error.pm from the Git-X\nstowing)\nYou install Git version X+1 in /usr/local/stow/Git-X+1\nYou unstow Git version X\nYou stow Git version X+1\nGit version X+1 fails because of missing Error.pm\n\nI.e. identical problem as with a true package manager.\nProblem is that the \"private\" Error.pm is put in a \"public\" location and not\nkept private with the current installation of Git.\n  \n"},{"id":"34943","messageId":"7virdzj1lf.fsf@assigned-by-dhcp.cox.net","threadId":"6850","inReplyTo":"loom.20070217T152508-6@post.gmane.org","subject":"Re: Error.pm: add configuration variable in Makefile","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-18T08:45:32Z","receivedAt":"2007-02-18T08:45:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergio Callegari <scallegari@arces.unibo.it> writes:\n\n> Problem is that the \"private\" Error.pm is put in a \"public\" location and not\n> kept private with the current installation of Git.\n\nI see.\n\nI do not think anybody minds too much if the private Error.pm is\ninstalled in $(prefix)/share/git-core/perl/ or somesuch, as long\nas you arrange things so that Git.pm can find it, so go wild.\n"}]}