git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Uninstalling Git
@ 2007-09-23 18:30 in-call
  2007-09-23 19:06 ` David Kastrup
  2007-09-23 19:31 ` Johannes Schindelin
  0 siblings, 2 replies; 7+ messages in thread
From: in-call @ 2007-09-23 18:30 UTC (permalink / raw)
  To: git

Hello!

This must be a stupid-obvious-newbie question but...

Well, the point is that I installed the git version 1.5.2.1 in an ubuntu 
box.  That was done following the INSTALL instructions in the 
corresponding tarball.  I typed:

$ make configure
$ ./configure --prefix=/usr/local
$ make all doc
$ sudo make install install-doc

First, I'd like to uninstall the thing completely, how do I do that?

Second, what would be the correct procedure to follow if I would like 
just to upgrade to a newer version? install over the older perhaps? Is 
that always safe in the sense that there won't be any dangling piece of 
bin nor doc?

Thanks in advance!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Uninstalling Git
  2007-09-23 18:30 Uninstalling Git in-call
@ 2007-09-23 19:06 ` David Kastrup
  2007-09-23 19:31 ` Johannes Schindelin
  1 sibling, 0 replies; 7+ messages in thread
From: David Kastrup @ 2007-09-23 19:06 UTC (permalink / raw)
  To: in-call; +Cc: git

in-call@gmx.net writes:

> This must be a stupid-obvious-newbie question but...
>
> Well, the point is that I installed the git version 1.5.2.1 in an
> ubuntu box.  That was done following the INSTALL instructions in the
> corresponding tarball.  I typed:
>
> $ make configure
> $ ./configure --prefix=/usr/local
> $ make all doc
> $ sudo make install install-doc
>
> First, I'd like to uninstall the thing completely, how do I do that?

Basically, you are screwed.  That being said, it might somewhat work
to do the following:

find /usr/local -depth -iname 'git*' -exec rm -rf {} \;

But I think you'll catch more if you apply the following patch, then
do

./configure --prefix=/opt/git
make all doc
sudo make install install-doc install-symlinks
sudo rm -rf /opt/git
sudo find /usr/local -lname '/opt/git/*' -delete

> Second, what would be the correct procedure to follow if I would
> like just to upgrade to a newer version? install over the older
> perhaps? Is that always safe in the sense that there won't be any
> dangling piece of bin nor doc?

There is some software called xstow which is supposed to do something
similar to the "install-symlinks" target of this patch.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

From: David Kastrup <dak@gnu.org>
Date: Wed, 18 Jul 2007 16:45:36 +0200
Subject: [PATCH] Makefile: create an install-symlinks target

[commit text mostly pinched from INSTALL]

An alternative global installation method making it much easier to
uninstall is to use a package-specific prefix like /opt/git, then
create symlinks from /usr/local into that hierarchy.  Uninstalling can
then be achieved by

	# rm -rf /opt/git; find /usr/local -lname '/opt/git/*' -delete

You can create a setup like that after having used one of the above
install recipes with prefix=/opt/git by writing

	# make prefix=/opt/git symlinkprefix=/usr/local install-symlinks

This works by copying the directory hierarchy of $prefix to
$symlinkprefix (not copying or descending to any directories of the
name git* matched case-insensitively), then linking all the rest.
---
 INSTALL  |   12 ++++++++++++
 Makefile |   10 +++++++++-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/INSTALL b/INSTALL
index 289b046..38d6fdd 100644
--- a/INSTALL
+++ b/INSTALL
@@ -21,6 +21,18 @@ set up install paths (via config.mak.autogen), so you can write instead
 	$ make all doc ;# as yourself
 	# make install install-doc ;# as root
 
+An alternative global installation method making it much easier to
+uninstall is to use a package-specific prefix like /opt/git, then
+create symlinks from /usr/local into that hierarchy.  Uninstalling can
+then be achieved by
+
+	# rm -rf /opt/git; find /usr/local -lname '/opt/git/*' -delete
+
+You can create a setup like that after having used one of the above
+install recipes with prefix=/opt/git by writing
+
+	# make prefix=/opt/git symlinkprefix=/usr/local install-symlinks
+
 
 Issues of note:
 
diff --git a/Makefile b/Makefile
index 0055eef..caea6fb 100644
--- a/Makefile
+++ b/Makefile
@@ -147,6 +147,7 @@ ALL_LDFLAGS = $(LDFLAGS)
 STRIP ?= strip
 
 prefix = $(HOME)
+symlinkprefix = /usr/local
 bindir = $(prefix)/bin
 gitexecdir = $(bindir)
 sharedir = $(prefix)/share
@@ -727,6 +728,7 @@ bindir_SQ = $(subst ','\'',$(bindir))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
 prefix_SQ = $(subst ','\'',$(prefix))
+symlinkprefix_SQ = $(subst ','\'',$(symlinkprefix))
 
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
@@ -1039,7 +1041,13 @@ install-info:
 quick-install-doc:
 	$(MAKE) -C Documentation quick-install
 
-
+# The somewhat strange looking lines start with an ignored $(MAKE) in
+# order to be executed also in make -n calls.
+install-symlinks:
+	@: $(MAKE) && echo cd '$(prefix_SQ)' && cd '$(prefix_SQ)' && $(FIND) . -type d ! \( -iname 'git*' -prune \) -exec echo $(INSTALL) -m 755 -d '$(symlinkprefix_SQ)/{}' \;
+	@cd '$(prefix_SQ)' && $(FIND) . -type d ! \( -iname 'git*' -prune \) -exec $(INSTALL) -m 755 -d '$(symlinkprefix_SQ)/{}' \;
+	@: $(MAKE) && echo cd '$(prefix_SQ)' && cd '$(prefix_SQ)' && $(FIND) . \( -type d -iname 'git*' -prune -o ! -type d \) -exec echo $(RM) -r '$(symlinkprefix_SQ)/{}' \; -exec echo ln -s '$(prefix_SQ)/{}' '$(symlinkprefix_SQ)/{}' \;
+	@cd '$(prefix_SQ)' && $(FIND) . \( -type d -iname 'git*' -prune -o ! -type d \) -exec $(RM) -r '$(symlinkprefix_SQ)/{}' \; -exec ln -s '$(prefix_SQ)/{}' '$(symlinkprefix_SQ)/{}' \;
 
 ### Maintainer's dist rules
 
-- 
1.5.3.1.96.g4568

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: Uninstalling Git
  2007-09-23 18:30 Uninstalling Git in-call
  2007-09-23 19:06 ` David Kastrup
@ 2007-09-23 19:31 ` Johannes Schindelin
  2007-09-23 19:47   ` in-call
  1 sibling, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2007-09-23 19:31 UTC (permalink / raw)
  To: in-call; +Cc: git

Hi,

On Sun, 23 Sep 2007, in-call@gmx.net wrote:

> $ make configure
> $ ./configure --prefix=/usr/local
> $ make all doc
> $ sudo make install install-doc
> 
> First, I'd like to uninstall the thing completely, how do I do that?

I'd use checkinstall to install it (again), and then use the distro's 
regular tools; in case of Ubuntu, that would be dpkg I believe.

> Second, what would be the correct procedure to follow if I would like 
> just to upgrade to a newer version? install over the older perhaps? Is 
> that always safe in the sense that there won't be any dangling piece of 
> bin nor doc?

On Linux this should be safe at all times.

Hth,
Dscho

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Uninstalling Git
  2007-09-23 19:31 ` Johannes Schindelin
@ 2007-09-23 19:47   ` in-call
  0 siblings, 0 replies; 7+ messages in thread
From: in-call @ 2007-09-23 19:47 UTC (permalink / raw)
  To: git

Hello!

Oh! great solution! I didn't know this tool, I'll do that! Thanks a lot!


Johannes Schindelin wrote:
> Hi,
> 
> On Sun, 23 Sep 2007, in-call@gmx.net wrote:
> 
>> $ make configure
>> $ ./configure --prefix=/usr/local
>> $ make all doc
>> $ sudo make install install-doc
>>
>> First, I'd like to uninstall the thing completely, how do I do that?
> 
> I'd use checkinstall to install it (again), and then use the distro's 
> regular tools; in case of Ubuntu, that would be dpkg I believe.
> 
>> Second, what would be the correct procedure to follow if I would like 
>> just to upgrade to a newer version? install over the older perhaps? Is 
>> that always safe in the sense that there won't be any dangling piece of 
>> bin nor doc?
> 
> On Linux this should be safe at all times.
> 
> Hth,
> Dscho
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* uninstalling Git
@ 2008-07-08  4:57 Christian Jaeger
  2008-07-08  5:30 ` Eric Hanchrow
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Jaeger @ 2008-07-08  4:57 UTC (permalink / raw)
  To: Git Mailing List

Hello,

There are two situations where I'm missing a way to uninstall Git:

- accidental install with prefix=/usr instead of prefix=/usr/local which 
I usually choose
- removing cruft from older gits, like tools and their man/info pages 
which don't exist anymore in newer Git releases

I wonder why there's no "uninstall" make target. Ok, maybe some people 
would argue that installing and uninstalling software through make has 
never been the best way, but usually I don't have problems with software 
providing "make uninstall", and I'm left with no solution for the above 
once I choose to use "make install" for Git.

[
Well, there's the "checkinstall" tool, but for some reason using 
checkinstall (version 1.6.1(-7) from Debian lenny) leads to some strange 
problems:

at first I always got (with a fresh tree):

...
if test -r /usr/share/info/dir; then \
      install-info --info-dir=/usr/share/info git.info ;\
      install-info --info-dir=/usr/share/info gitman.info ;\
    else \
      echo "No directory found in /usr/share/info" >&2 ; \
    fi

No `START-INFO-DIR-ENTRY' and no `This file documents'.
install-info(git.info): unable to determine description for `dir' entry 
- giving up

No `START-INFO-DIR-ENTRY' and no `This file documents'.
install-info(gitman.info): unable to determine description for `dir' 
entry - giving up
make[1]: *** [install-info] Error 1
make[1]: Leaving directory `/usr/src/GIT/T/git.1/Documentation'
make: *** [install-info] Error 2


and now I'm consistently getting (each time with a fresh tree):

asciidoc -b docbook -d book user-manual.txt
FAILED: unexpected error:
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/bin/asciidoc", line 4014, in asciidoc
    config.load_all(CONF_DIR)
  File "/usr/bin/asciidoc", line 3637, in load_all
    for f in os.listdir(filters):
OSError: [Errno 2] No such file or directory: '/etc/asciidoc/filters'
...


and now, again with a fresh tree but without -j2:

# checkinstall make prefix=/usr install install-doc install-info
...
asciidoc -b docbook -d manpage -f asciidoc.conf \
         -agit_version=1.5.6.GIT -o git-add.xml+ git-add.txt
FAILED: unexpected error:
------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/bin/asciidoc", line 4014, in asciidoc
    config.load_all(CONF_DIR)
  File "/usr/bin/asciidoc", line 3637, in load_all
    for f in os.listdir(filters):
OSError: [Errno 2] No such file or directory: '/etc/asciidoc/filters'
------------------------------------------------------------
make[1]: *** [git-add.xml] Error 1
make[1]: Leaving directory `/usr/src/GIT/T/git.1/Documentation'
make: *** [install-doc] Error 2

****  Installation failed. Aborting package creation.

Cleaning up...OK

Bye.


where /etc/asciidoc/filters clearly is a non-empty directory. It seems 
to behave non-deterministically. So my guess is that checkinstall is 
using LD_PRELOAD tricks or some such and just doesn't work for the task 
here, at least not without fixing something.
]

So,
- is there any (good?) reason there is no uninstall target? Should I 
look into creating one?
- do you have better or working alternative suggestions?

Actually I'd be happy if there are more elegant solutions than make 
uninstall, since there is the race/hen-and-egg problem of having to run 
"make uninstall" from the tree before checking out the new version, and 
checking out the new version of course needs git, meaning the "right" 
approach would be to keep the working dir of the last install for the 
purpose of uninstallation until after having built the new version. 
Maybe it's enough to just keep the toplevel Makefile, but that would be 
making assumptions. Maybe I should talk with the Debian people about how 
to build debs easily for such purposes (and not using the standard 
Debian packages -- I'd really like to just have an own single package 
without any applied patches etc.)?

Thanks,
Christian.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: uninstalling Git
  2008-07-08  4:57 uninstalling Git Christian Jaeger
@ 2008-07-08  5:30 ` Eric Hanchrow
  2008-07-08  6:28   ` Matthieu Moy
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Hanchrow @ 2008-07-08  5:30 UTC (permalink / raw)
  To: git

>>>>> "Christian" == Christian Jaeger <christian@jaeger.mine.nu> writes:

    Christian> I wonder why there's no "uninstall" make target.  

This is a problem with lots of packages, not just git.  Here are two
things I do:
            
* When I remember, I use "gnu stow" to manage installations; doing so
  makes uninstallation easy.

* Failing that, I run

        find /usr -printf '%T@ ' -ls | sort -n | cut -d\  -f 2-

  and assume that all the installed files have the same last-modified
  timestamps -- once you've found one of them in that pipeline's output,
  you've found them all, since they'll all be adjacent.

-- 
Asking the Iraqi people to assume Saddam's debts
is rather like telling a man who has been shot in the head
that he has to pay for the bullet.
        -- James Surowiecki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: uninstalling Git
  2008-07-08  5:30 ` Eric Hanchrow
@ 2008-07-08  6:28   ` Matthieu Moy
  0 siblings, 0 replies; 7+ messages in thread
From: Matthieu Moy @ 2008-07-08  6:28 UTC (permalink / raw)
  To: Eric Hanchrow; +Cc: git

Eric Hanchrow <offby1@blarg.net> writes:

> * Failing that, I run
>
>         find /usr -printf '%T@ ' -ls | sort -n | cut -d\  -f 2-
>

I usualy do

touch /tmp/dumb.txt
make install
find /usr -newer /tmp/dumb.txt

for that.

-- 
Matthieu

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-07-08  6:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08  4:57 uninstalling Git Christian Jaeger
2008-07-08  5:30 ` Eric Hanchrow
2008-07-08  6:28   ` Matthieu Moy
  -- strict thread matches above, loose matches on Subject: below --
2007-09-23 18:30 Uninstalling Git in-call
2007-09-23 19:06 ` David Kastrup
2007-09-23 19:31 ` Johannes Schindelin
2007-09-23 19:47   ` in-call

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).