]> git.donarmstrong.com Git - lilypond.git/commitdiff
* stepmake/stepmake/install-targets.make (local-uninstall): idem.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 19 Dec 2005 01:58:11 +0000 (01:58 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 19 Dec 2005 01:58:11 +0000 (01:58 +0000)
* stepmake/stepmake/install-out-targets.make (local-install-outfiles): idem.

* stepmake/stepmake/help2man-targets.make (install-help2man): idem.

* stepmake/stepmake/generic-vars.make (Module): idem.

* stepmake/stepmake/executable-targets.make (default): use it.

* stepmake/bin/install.py (create_dir): new file. Replace install-sh.

* lily/main.cc (setup_paths): don't inspect $PATH for argv0 with
slashes.
(prepend_env_path): more verbosity.

ChangeLog
lily/main.cc
stepmake/bin/install.py [new file with mode: 0644]
stepmake/stepmake/executable-targets.make
stepmake/stepmake/generic-vars.make
stepmake/stepmake/help2man-targets.make
stepmake/stepmake/install-out-targets.make
stepmake/stepmake/install-targets.make

index 90bc5a37a49fb02137980f8a7279d4e5fad35f04..74d55936288ec38001e34b09e2bd19e9e6363043 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2005-12-19  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * stepmake/stepmake/install-targets.make (local-uninstall): idem.
+
+       * stepmake/stepmake/install-out-targets.make (local-install-outfiles): idem.
+
+       * stepmake/stepmake/help2man-targets.make (install-help2man): idem.
+
+       * stepmake/stepmake/generic-vars.make (Module): idem.
+
+       * stepmake/stepmake/executable-targets.make (default): use it.
+
+       * stepmake/bin/install.py (create_dir): new file. Replace install-sh.
+
        * make/GNUmakefile: don't install make rules.
 
        * lily/main.cc (setup_paths): don't inspect $PATH for argv0 with
index bcae55d5ee482fe7756c7e0f6250c685463e6402..14fa300e1f3c2121565d0a8ae2348e27b09d02f1 100644 (file)
@@ -302,16 +302,16 @@ prepend_env_path (char const *key, String value)
 {
   if (is_dir (value))
     {
+      if (be_verbose_global)
+       progress_indication (_f ("%s=%s\n", key, value.to_str0 ())); 
+
       if (char const *cur = getenv (key))
        value += to_string (PATHSEP) + cur;
 
-      if (be_verbose_global)
-       progress_indication (_f ("%s=%s", key, value.to_str0 ())); 
-
       return sane_putenv (key, value.to_str0 ());
     }
   else if (be_verbose_global)
-    warning (_f ("no such directory: %s", value));
+    warning (_f ("no such directory: %s for %s", value, key));
   return -1;
 }
 
diff --git a/stepmake/bin/install.py b/stepmake/bin/install.py
new file mode 100644 (file)
index 0000000..7da9c85
--- /dev/null
@@ -0,0 +1,89 @@
+#!@PYTHON@
+import string
+import getopt
+import sys
+import os
+import shutil
+(opts, args) = getopt.getopt (sys.argv[1:], 'b:cdg:m:o:st:', [])
+transform_base = None
+group = None
+owner = None
+transform = None
+mode = None 
+copy = False
+create_dir = False
+
+for (o,a) in opts:
+       if o == '-b':
+               transform_base = a
+       elif o == '-c':
+               copy = True
+       elif o == '-d':
+               create_dir = True
+       elif o == '-g':
+               group = a
+       elif o == '-m':
+               mode = string.atoi (a, 8)
+       elif o == '-o':
+               owner = a
+       elif o == '-s':
+               strip = True
+       elif o == '-t':
+               transform = a
+       elif o == '-h':
+               print ''' Usage: $0 [OPTION]... SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 -d DIRECTORIES...
+
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
+
+Options:
+-b=TRANSFORMBASENAME
+-c         copy source (using $cpprog) instead of moving (using $mvprog).
+-d         create directories instead of installing files.
+-g GROUP   $chgrp installed files to GROUP.
+-m MODE    $chmod installed files to MODE.
+-o USER    $chown installed files to USER.
+-s         strip installed files (using $stripprog).
+-t=TRANSFORM
+--help     display this help and exit.
+--version  display version info and exit.'''
+               sys.exit (0)
+
+if not mode:
+       if create_dir:
+               mode = 0755
+       else:
+               mode = 0644
+               
+
+chown_me = []
+
+dest = None
+if not create_dir:
+       dest = args.pop()
+
+for f in args:
+       if create_dir:
+               os.makedirs (f, mode=mode)
+               chown_me.append (f)
+       else:
+               if copy:
+                       shutil.copy2 (f, dest)
+               else:
+                       shutil.move (f, dest)
+               if os.path.isdir (dest):
+                       chown_me.append (os.path.join (dest, os.path.basename (f)))
+               else:
+                       chown_me.append (dest)
+
+for f in chown_me:
+       os.chmod (f, mode)
+       if group <> None or owner <> None:
+               os.chown (f, group, owner)
+       
+       
+
+               
+
index edf282ab0a31308bd54f4d2c8704f1207b260781..7afa1db57964a4ba2a08ac933e2c3371816dd6fa 100644 (file)
@@ -7,12 +7,11 @@ local-install: installexe
 local-uninstall: uninstallexe
 
 installexe: all
-       -$(INSTALL) -d $(DESTDIR)$(bindir)
+       -$(INSTALLPY) -d $(DESTDIR)$(bindir)
        $(foreach a, $(EXECUTABLES), \
-               $(INSTALL) -m 755 $(outdir)/$(a) \
+               $(INSTALLPY) -m 755 $(outdir)/$(a) \
                $(DESTDIR)$(bindir)/$(program_prefix)$(a)$(program_suffix) && ) true
-       $(foreach a, $(SEXECUTABLES), \
-               $(INSTALL) -m 755 $(outdir)/$(a) $(DESTDIR)$(bindir) &&) true
+       $(INSTALLPY) -c -m 755 $(addprefix $(outdir)/, $(SEXECUTABLES)) $(DESTDIR)$(bindir)
 
 uninstallexe:
        $(foreach a, $(EXECUTABLES), rm -f \
index e3fe7c76a800e871651b1323108ab9ee6d7e5e9a..110c1773938dc6acec28e2c8d6517e0d039fdf1c 100644 (file)
@@ -38,6 +38,8 @@ step-bindir = $(stepmake)/bin
 # stepmake package support.
 DEPTH = $(depth)/$(package-depth)
 
+INSTALLPY=$(PYTHON) $(step-bindir)/install.py -c
+
 group-dir = $(shell cd $(DEPTH);pwd)/..
 release-dir = $(group-dir)/releases
 patch-dir = $(group-dir)/patches
index 04dada703c89a8a139840a0555572acb803cf5c5..53782b63fc7d10eb36045db386ab93529a1a78b8 100644 (file)
@@ -3,9 +3,8 @@ default: man
 local-install: install-help2man
 
 install-help2man: man
-       -$(INSTALL) -d $(DESTDIR)$(mandir)/man1
-       $(foreach a, $(HELP2MAN_GROFFS), \
-               $(INSTALL) -m 644 $(a) $(DESTDIR)$(mandir)/man1 && ) true
+       -$(INSTALLPY) -d $(DESTDIR)$(mandir)/man1
+       $(INSTALLPY) -c -m 644 $(HELP2MAN_GROFFS) $(DESTDIR)$(mandir)/man1
 
 man: $(HELP2MAN_GROFFS)
 
index 2cbe3ebd92390304a4aeeba8e9c526492cfff1fd..6b987d8463a19be35fe861cb8e0fdd56b2d46885 100644 (file)
@@ -5,14 +5,11 @@ local-install-files:
 
 # urg, parameterise
 local-install-outfiles: $(INSTALLATION_OUT_FILES) $(foreach suff, $(INSTALLATION_OUT_SUFFIXES), $(INSTALLATION_OUT_FILES$(suff)))
-       -$(INSTALL) -d $(DESTDIR)$(INSTALLATION_OUT_DIR)
-       $(foreach i, $(INSTALLATION_OUT_FILES), \
-               $(INSTALL) -m 644 $(i) $(DESTDIR)$(INSTALLATION_OUT_DIR)/ && ) true
+       -$(INSTALLPY) -d $(DESTDIR)$(INSTALLATION_OUT_DIR)
+       $(INSTALLPY) -c -m 644 $(INSTALLATION_OUT_FILES) $(DESTDIR)$(INSTALLATION_OUT_DIR)/
        $(foreach suff, $(INSTALLATION_OUT_SUFFIXES),  \
-               ($(INSTALL) -d $(DESTDIR)$(INSTALLATION_OUT_DIR$(suff))/ || true) && \
-               $(foreach i, $(INSTALLATION_OUT_FILES$(suff)), \
-                       $(INSTALL) -m 644 $(i) $(DESTDIR)$(INSTALLATION_OUT_DIR$(suff))/ && ) true && ) true
-
+               ($(INSTALLPY) -d $(DESTDIR)$(INSTALLATION_OUT_DIR$(suff))/ || true) && \
+               $(INSTALLPY) -c -m 644 $(INSTALLATION_OUT_FILES$(suff)) $(DESTDIR)$(INSTALLATION_OUT_DIR$(suff))/ && ) true
 
 local-uninstall: local-uninstall-outfiles local-uninstall-files 
 
index 9e89eedbf6b65dd98ccfe8e8a15bae52646632a4..394270b3c956f5fa92fe49e9cf074f1e2ecd8565 100644 (file)
@@ -7,12 +7,11 @@ local-install-outfiles:
 local-install-files: $(INSTALLATION_FILES)
        $(PRE_INSTALL)
        -$(INSTALL) -d $(DESTDIR)$(INSTALLATION_DIR)
-       for i in $(foreach j,$(INSTALLATION_FILES),$(src-dir)/$(j)); do \
-               $(INSTALL) -m 644 $$i $(DESTDIR)$(INSTALLATION_DIR)/ ; done
+       $(INSTALLPY) -m 644 $(addprefix $(src-dir)/,$(INSTALLATION_FILES)) $(DESTDIR)$(INSTALLATION_DIR)/
+
        $(foreach suff, $(INSTALLATION_SUFFIXES),  \
                ($(INSTALL) -d $(DESTDIR)$(INSTALLATION_DIR$(suff)) || true) && \
-               for i in $(foreach j,INSTALLATION_FILES$(suff), $(src-dir)/$(j)); do \
-                       $(INSTALL) -m 644 $$i $(DESTDIR)$(INSTALLATION_DIR$(suff))/; done )
+               $(INSTALL) -m 644  $(addprefix $(src-dir)/, $(INSTALLATION_FILES$(suff))) $(DESTDIR)$(INSTALLATION_DIR$(suff))/ ) 
        $(POST_INSTALL)
 
 local-uninstall: local-uninstall-outfiles local-uninstall-files