Re: :action depend for D

"Lars Ivar Igesund" <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <00cf01c3a9c5$ff976830$0200000a@mesmer>
----- Original Message ----- 
From: "Bram Moolenaar" <[email protected]>
>
> I didn't try it, but it looks like it should work OK if the user can
> become root when necessary.  But it won't work for an ordinary user.
> I'm not sure how to solve this.  We should offer the choice whether the
> user wants to become root and install globally, or install in his home
> directory only.  But that last option is something new, I don't know
> what directory to use then.  ~/bin would be obvious, but not everybody
> has that in $PATH.

I've attached a diff for what I think is the best solution or at least on
the
path to the best solution. What do you think? It worked as expected for
me. I haven't tested it thouroughly though.

>
> Looks like some trouble with line endings.  My patch program didn't
> complain, thus I included this patch without trouble.

Ah, yes. It stopped by a windows prog before I diffed.

Lars Ivar Igesund
d.diff (application/octet-stream, 1.6 KB)
Index: d.aap
===================================================================
RCS file: /cvsroot/a-a-p/Exec/modules/d.aap,v
retrieving revision 1.9
diff -u -r1.9 d.aap
--- d.aap	5 Nov 2003 16:21:34 -0000	1.9
+++ d.aap	13 Nov 2003 09:03:14 -0000
@@ -37,7 +37,27 @@
     :mkdir {force} $bindir
     :print ddepcheck not found, building from: $toolsdir/ddepcheck.d
     :progsearch dc dmd
-    :sys $dc -O -of$bindir`os.sep`ddepcheck$EXESUF $toolsdir`os.sep`ddepcheck.d
+    @if not os.access(Global.aap_bindir, os.W_OK):
+        :print -----------
+	:print You don't have write access to the AAP binaries directory.
+	:print 1) To install it there anyways, you most log in as root/administrator.
+	:print 2) If that is impossible, you will be prompted for a path to
+                install in. 
+	@r = raw_input("Select an option ")
+	@if r == '1':
+           :asroot $dc -O -of$bindir`os.sep`ddepcheck$EXESUF 
+                        $toolsdir`os.sep`ddepcheck.d
+	@elif r == '2':
+            :print The path entered must be writable from your user.
+            @bindir = raw_input("Enter install path for ddepcheck ")
+            :sys $dc -O -of$bindir`os.sep`ddepcheck$EXESUF 
+                    $toolsdir`os.sep`ddepcheck.d
+            :print NOTE: It might be necessary to add $bindir to your PATH.
+            :print If you are using a shell, it might be necessary to restart
+                    it.
+    @else:
+        :sys $dc -O -of$bindir`os.sep`ddepcheck$EXESUF 
+                $toolsdir`os.sep`ddepcheck.d
     :del {q} ddepcheck$OBJSUF ddepcheck.map 
     :progsearch _top.DDEPCHECK ddepcheck
     @if not _top.DDEPCHECK:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.