gsrc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gsrc-commit] /srv/bzr/gsrc/trunk r1340: optionally colorize output


From: Brandon Invergo
Subject: [Gsrc-commit] /srv/bzr/gsrc/trunk r1340: optionally colorize output
Date: Fri, 07 Dec 2012 18:21:11 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 1340
committer: Brandon Invergo <address@hidden>
branch nick: trunk
timestamp: Fri 2012-12-07 18:21:11 +0100
message:
  optionally colorize output
modified:
  gar.conf.mk
  gar.lib.mk
  gar.mk
=== modified file 'gar.conf.mk'
--- a/gar.conf.mk       2012-12-07 15:49:13 +0000
+++ b/gar.conf.mk       2012-12-07 17:21:11 +0000
@@ -13,19 +13,20 @@
 
 # If you want GSRC messages to be printed in color, set USE_COLOR to y. This 
may
 # help in distinguishing GSRC output from that of the packages you build.
-# The default colors are cyan for messages, red for errors, and green for 
-# success. 
+# The default colors are bold white for messages, red for errors, and green 
for 
+# success. If you don't want colors, you can insert symbols to designate GSRC 
+# output.
 USE_COLOR = y
 ifeq ($(USE_COLOR),y)
        OFF="\\e[00m"
-       MSG="\\e[00\;36m"
+       MSG="\\e[01\;37m"
        ERR="\\e[01\;31m"
        OK="\\e[00\;32m"
 else
-       OFF=
-       MSG=
-       ERR=
-       OK=
+       OFF=""
+       MSG="==> "
+       ERR="*** "
+       OK=""
 endif
 
 

=== modified file 'gar.lib.mk'
--- a/gar.lib.mk        2012-12-07 14:38:04 +0000
+++ b/gar.lib.mk        2012-12-07 17:21:11 +0000
@@ -63,14 +63,14 @@
 # get one that doesn't return an error code.
 $(DOWNLOADDIR)/%:  
        @if test -f $(COOKIEDIR)/checksum-$*; then : ; else \
-               echo " ==> Grabbing $@"; \
+               echo -e "[$(OK)fetch$(OFF)] $(MSG)Grabbing $(OFF)$@"; \
                for i in $(filter %/$*,$(URLS)); do  \
-                       echo "  ==> Trying $$i"; \
+                       echo -e "[$(OK)fetch$(OFF)] $(MSG)Trying $(OFF)$$i"; \
                        $(MAKE) $$i || continue; \
                        break; \
                done; \
                if test -r $@ ; then : ; else \
-                       echo '*** GAR GAR GAR!  Failed to download 
address@hidden  GAR GAR GAR! ***' 1>&2; \
+                       echo -e "[$(ERR)fetch$(OFF)] $(MSG)Failed to download 
$(OFF)address@hidden(MSG)!$(OFF)" 1>&2; \
                        false; \
                fi; \
        fi
@@ -194,23 +194,23 @@
 # error out if it mentions the file without an "OK".
 
 sha256sums:
-       @echo "No checksum file available!"
-       @echo "If you trust the downloaded files you can generate the checksums 
with"
-       @echo "  make -C $(shell pwd) makesums GPGV=true"
+       @echo -e "[$(ERR)sha256sums$(OFF)] $(MSG)No checksum file available!"
+       @echo -e "$(MSG)If you trust the downloaded files you can generate the 
checksums with"
+       @echo -e "make -C $(shell pwd) makesums GPGV=true$(OFF)"
        @exit 1
 
 checksum-%: $(CHECKSUM_FILE) 
-       @echo " ==> Running $(CHECKSUM_CMD) on $*"
+       @echo -e "[$(OK)checksum$(OFF)] $(MSG)Running $(CHECKSUM_CMD) on 
$(OFF)$*"
        @if grep -- '  $(DOWNLOADDIR)/$*$$' $(CHECKSUM_FILE); then \
                if LC_ALL="C" LANG="C"  grep -- '  $(DOWNLOADDIR)/$*$$' 
$(CHECKSUM_FILE) | $(CHECKSUM_CMD) -c | grep ':[ ]\+OK'; then \
-                       echo '$(CHECKSUM_FILE) is OK'; \
+                       echo -e "[$(OK)checksum$(OFF)] $(MSG)$(CHECKSUM_FILE) 
is OK$(OFF)"; \
                        $(DOMAKECOOKIE); \
                else \
-                       echo '*** GAR GAR GAR!  $* failed checksum test!  GAR 
GAR GAR! ***' 1>&2; \
+                       echo -e "[$(ERR)checksum$(OFF)] $(MSG)$* failed 
checksum test!$(OFF)" 1>&2; \
                        false; \
                fi \
        else \
-               echo '*** GAR GAR GAR!  $* not in $(CHECKSUM_FILE) file!  GAR 
GAR GAR! ***' 1>&2; \
+               echo -e "[$(ERR)checksum$(OFF)] $(MSG)$* not in 
$(CHECKSUM_FILE) file!$(OFF)" 1>&2; \
                false; \
        fi
 
@@ -218,47 +218,47 @@
 GPGV ?= gpgv --keyring $(GPG_KEYRING)
 
 checksig-%.sig.asc:
-       @echo " ==> Checking GPG signature $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking GPG signature $(OFF)$*"
        $(GPGV) $(DOWNLOADDIR)/$*.sig.asc $(DOWNLOADDIR)/$*
        $(MAKECOOKIE)
 
 checksig-%.asc.txt:
-       @echo " ==> Checking GPG signature $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking GPG signature $(OFF)$*"
        $(GPGV) $(DOWNLOADDIR)/$*.asc.txt $(DOWNLOADDIR)/$*
        $(MAKECOOKIE)
 
 checksig-%-asc.txt:
-       @echo " ==> Checking GPG signature $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking GPG signature $(OFF)$*"
        $(GPGV) $(DOWNLOADDIR)/$*-asc.txt $(DOWNLOADDIR)/$(subst -tar-,.tar.,$*)
        $(MAKECOOKIE)
 
 checksig-%.sig:
-       @echo " ==> Checking GPG signature $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking GPG signature $(OFF)$*"
        $(GPGV) $(DOWNLOADDIR)/$*.sig
        $(MAKECOOKIE)
 
 checksig-%.sign:
-       @echo " ==> Checking GPG signature $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking GPG signature $(OFF)$*"
        $(GPGV) $(DOWNLOADDIR)/$*.sign
        $(MAKECOOKIE)
 
 checksig-%.asc:
-       @echo " ==> Checking GPG signature $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking GPG signature $(OFF)$*"
        $(GPGV) $(DOWNLOADDIR)/$*.asc
        $(MAKECOOKIE)
 
 checksig-%.md5sum:
-       @echo " ==> Checking MD5 checksums $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking MD5 checksums $(OFF)$*"
        cd $(DOWNLOADDIR) && md5sum -c $*.md5sum
        $(MAKECOOKIE)
 
 checksig-%.sha1:
-       @echo " ==> Checking SHA1 checksums $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking SHA1 checksums $(OFF)$*"
        cd $(DOWNLOADDIR) && sha1sum -c $*.sha1
        $(MAKECOOKIE)
 
 checksig-%.sha256:
-       @echo " ==> Checking SHA256 checksums $*"
+       @echo -e "[$(OK)checksig$(OFF)] $(MSG)Checking SHA256 checksums 
$(OFF)$*"
        cd $(DOWNLOADDIR) && sha256sum -c $*.sha256
        $(MAKECOOKIE)
 
@@ -283,49 +283,49 @@
 
 # rule to extract files with tar xzf
 extract-%.tar.Z extract-%.tgz extract-%.tar.gz extract-%.taz: 
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        gzip -dc $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) | tar xf - 
$(TAR_OPTS) -C $(EXTRACTDIR)
        $(MAKECOOKIE)
 
 # rule to extract files with tar and bzip
 extract-%.tar.bz extract-%.tar.bz2 extract-%.tbz: 
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        bzip2 -dc $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) | tar xf - 
$(TAR_OPTS) -C $(EXTRACTDIR)
        $(MAKECOOKIE)
 
 # rule to extract files with tar and lzip
 extract-%.tar.lz:
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        lzip -dc $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) | tar xf - 
$(TAR_OPTS) -C $(EXTRACTDIR)
        $(MAKECOOKIE)
 
 # rule to extract files with tar and xz
 extract-%.tar.xz extract-%.tar.lzma:
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        xz -dc $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) | tar xf - $(TAR_OPTS) 
-C $(EXTRACTDIR)
        $(MAKECOOKIE)
 
 # rule to extract files with tar
 extract-%.tar:
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        tar xf $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) $(TAR_OPTS) -C 
$(EXTRACTDIR)
        $(MAKECOOKIE)
 
 # rule to extract files with cpio
 extract-%.cpio.gz:
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        gzip -dc $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) | (cd $(EXTRACTDIR) 
&& cpio -mid $(CPIO_OPTS))
        $(MAKECOOKIE)
 
 # rule to extract files with zip
 extract-%.zip:
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        unzip -o $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) -d $(EXTRACTDIR)
        $(MAKECOOKIE)
 
 # rule to extract RPM files with rpm2cpio and cpio
 extract-%.rpm:
-       @echo " ==> Extracting $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Extracting $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        rpm2cpio $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) | (cd $(EXTRACTDIR) 
&& cpio -mid $(CPIO_OPTS))
        $(MAKECOOKIE)
 
@@ -333,7 +333,7 @@
 # This is a bit of a kludge -- it's to allow us to have packages that are built
 # from a load of downloaded files (i.e. cvsweb checkouts) and a patch.
 extract-%:
-       @echo " ==> Copying $(patsubst extract-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)extract$(OFF)] $(MSG)Copying $(OFF)$(patsubst 
extract-%,$(DOWNLOADDIR)/%,$@)"
        mkdir -p $(WORKSRC)
        cp $(patsubst extract-%,$(DOWNLOADDIR)/%,$@) $(WORKSRC)
        $(MAKECOOKIE)
@@ -346,25 +346,25 @@
 
 # apply bzipped patches
 patch-%.bz patch-%.bz2: 
-       @echo " ==> Applying patch $(patsubst patch-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)patch$(OFF)] $(MSG)Applying patch $(OFF)$(patsubst 
patch-%,$(DOWNLOADDIR)/%,$@)"
        bzip2 -dc $(patsubst patch-%,$(DOWNLOADDIR)/%,$@) | $(PATCH)
        $(MAKECOOKIE)
 
 # apply gzipped patches
 patch-%.gz: 
-       @echo " ==> Applying patch $(patsubst patch-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)patch$(OFF)] $(MSG)Applying patch $(OFF)$(patsubst 
patch-%,$(DOWNLOADDIR)/%,$@)"
        gzip -dc $(patsubst patch-%,$(DOWNLOADDIR)/%,$@) | $(PATCH)
        $(MAKECOOKIE)
 
 # apply normal patches
 patch-%: 
-       @echo " ==> Applying patch $(patsubst patch-%,$(DOWNLOADDIR)/%,$@)"
+       @echo -e "[$(OK)patch$(OFF)] $(MSG)Applying patch $(OFF)$(patsubst 
patch-%,$(DOWNLOADDIR)/%,$@)"
        $(PATCH) < $(patsubst patch-%,$(DOWNLOADDIR)/%,$@)
        $(MAKECOOKIE)
 
 # This is used by makepatch
 %/gar-base.diff:
-       @echo " ==> Creating patch $@"
+       @echo -e "[$(OK)makepatch$(OFF)] $(MSG)Creating patch $(OFF)$@"
        @EXTRACTDIR=$(SCRATCHDIR) COOKIEDIR=$(SCRATCHDIR)-$(COOKIEDIR) $(MAKE) 
extract
        @if diff -x 'config.log' -x 'config.status' -ru $(SCRATCHDIR) 
$(WORKDIR) | grep -v '^Only in' > $@; then :; else \
                rm $@; \
@@ -374,11 +374,11 @@
 ####################### HELP RULES ######################
 
 help-%/configure:
-       @echo " ==> Running configure --help in $*"
+       @echo -e "[$(OK)help$(OFF)] $(MSG)Running configure --help in $(OFF)$*"
        cd $* && $(CONFIGURE_ENV) ./configure --help
 
 help-%/setup.py:
-       @echo " ==> Running python setup.py --help in $*"
+       @echo -e "[$(OK)help$(OFF)] $(MSG)Running python setup.py --help in 
$(OFF)$*"
        cd $* && python setup.py --help
 
 #################### CONFIGURE RULES ####################
@@ -404,7 +404,7 @@
 
 # Rebuild autoconf files in a source directory.
 configure-%/autoreconf:
-       @echo " ==> Running autoreconf in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running autoreconf in $(OFF)$*"
        cd $* && $(AUTORECONF_ENV) autoreconf $(AUTORECONF_ARGS)
        $(MAKECOOKIE)
 
@@ -412,14 +412,14 @@
 
 # Rebuild libtool files in a source directory.
 configure-%/libtoolize:
-       @echo " ==> Running libtoolize in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running libtoolize in $(OFF)$*"
        cd $* && $(LIBTOOLIZE_ENV) libtoolize $(LIBTOOLIZE_ARGS)
        $(MAKECOOKIE)
 
 # configure a package that has an autoconf-style configure script, coping
 # correctly when WORKOBJ is set to something other than WORKDIR.
 configure-%/configure: 
-       @echo " ==> Running $(CONFIGURE_NAME) in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running $(CONFIGURE_NAME) in 
$(OFF)$*"
        mkdir -p $(WORKOBJ)
        cd $(if $(WORKOBJ_CHANGED_P),$(WORKOBJ),$*) && $(CONFIGURE_ENV) $(if 
$(WORKOBJ_CHANGED_P),$(LEAVE_WORKOBJ)/$*,.)/$(CONFIGURE_NAME) $(CONFIGURE_ARGS)
        $(MAKECOOKIE)
@@ -430,7 +430,7 @@
 # FIXME: untested and likely not the right way to handle the
 # arguments
 configure-%/Imakefile: 
-       @echo " ==> Running xmkmf in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running xmkmf in $(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) xmkmf $(XMKMF_ARGS)
        $(MAKECOOKIE)
 
@@ -445,14 +445,14 @@
 
 # configure a package that uses CMake
 configure-%/CMakeLists.txt:
-       @echo " ==> Running cmake in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running cmake in $(OFF)$*"
        @mkdir -p $(WORKOBJ)
        @cd $(if $(WORKOBJ_CHANGED_P),$(WORKOBJ),$*) && $(CONFIGURE_ENV) cmake 
$(if $(WORKOBJ_CHANGED_P),$(LEAVE_WORKOBJ)/$* ,)$(CMAKE_CONFIGURE_ARGS)
        $(MAKECOOKIE)
 
 # configure using Python distutils
 configure-%/setup.py:
-       @echo " ==> Running setup.py config in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running setup.py config in 
$(OFF)$*"
        @cd $* && $(BUILD_ENV) python setup.py config $(PY_BUILD_ARGS)
        $(MAKECOOKIE)
 
@@ -461,19 +461,19 @@
 
 # configure a Ruby extension
 configure-%/extconf.rb:
-       @echo " ==> Running extconf.rb in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running extconf.rb in $(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) ruby extconf.rb $(RUBY_CONFIGURE_ARGS)
        $(MAKECOOKIE)
 
 # configure the other sort of Ruby extension
 configure-%/setup.rb:
-       @echo " ==> Running setup.rb config in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running setup.rb config in 
$(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) ruby setup.rb config $(RUBY_CONFIGURE_ARGS)
        $(MAKECOOKIE)
 
 # configure a third sort of Ruby extension
 configure-%/install.rb:
-       @echo " ==> Running install.rb config in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running install.rb config in 
$(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) ruby install.rb config $(RUBY_CONFIGURE_ARGS)
        $(MAKECOOKIE)
 
@@ -485,7 +485,7 @@
 
 # configure using SCons (which is only needed by some packages...)
 configure-%/SConstruct:
-       @echo " ==> Running scons configure in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running scons configure in 
$(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) scons configure $(SCONS_DEBUG) $(SCONS_ARGS)
        $(MAKECOOKIE)
 
@@ -493,9 +493,9 @@
 
 # configure using Cabal
 configure-%/Setup.hs:
-       @echo " ==> Compiling Setup in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Compiling Setup in $(OFF)$*"
        @cd $* && ghc --make Setup -o Setup
-       @echo " ==> Running Setup configure in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running Setup configure in 
$(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) ./Setup configure $(CABAL_CONFIGURE_ARGS)
        $(MAKECOOKIE)
 
@@ -503,7 +503,7 @@
 
 # configure using waf
 configure-%/waf:
-       @echo " ==> Running waf configure in $*"
+       @echo -e "[$(OK)configure$(OFF)] $(MSG)Running waf configure in 
$(OFF)$*"
        @cd $* && $(CONFIGURE_ENV) ./waf configure $(WAF_CONFIGURE_ARGS)
        $(MAKECOOKIE)
 
@@ -513,49 +513,49 @@
 
 # build from a standard gnu-style makefile's default rule.
 build-%/Makefile build-%/makefile build-%/GNUmakefile:
-       @echo " ==> Running make in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running make in $(OFF)$*"
        @$(BUILD_ENV) $(MAKE) -C $* $(MAKE_ARGS) $(BUILD_ARGS)
        $(MAKECOOKIE)
 
 build-%/Makefile-BSD:
-       @echo " ==> Running make in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running make in $(OFF)$*"
        @cd $* && $(BUILD_ENV) pmake $(BUILD_ARGS)
        $(MAKECOOKIE)
 
 # build using Python distutils
 build-%/setup.py:
-       @echo " ==> Running setup.py build in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running setup.py build in $(OFF)$*"
        @cd $* && $(BUILD_ENV) python setup.py build $(PY_BUILD_ARGS)
        $(MAKECOOKIE)
 
 # build using Ruby setup.rb
 build-%/setup.rb:
-       @echo " ==> Running setup.rb setup in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running setup.rb setup in $(OFF)$*"
        @cd $* && $(BUILD_ENV) ruby setup.rb setup $(RUBY_BUILD_ARGS)
        $(MAKECOOKIE)
 
 # build using Ruby install.rb
 build-%/install.rb:
-       @echo " ==> Running install.rb setup in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running install.rb setup in $(OFF)$*"
        @cd $* && $(BUILD_ENV) ruby install.rb setup $(RUBY_BUILD_ARGS)
        $(MAKECOOKIE)
 
 # build using SCons (which pretends not to have a seperate configure step,
 # having "sticky options" instead...)
 build-%/SConstruct:
-       @echo " ==> Running scons in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running scons in $(OFF)$*"
        @cd $* && $(BUILD_ENV) scons $(SCONS_DEBUG) $(SCONS_ARGS)
        $(MAKECOOKIE)
 
 # build using Cabal
 build-%/Setup.hs:
-       @echo " ==> Running Setup build in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running Setup build in $(OFF)$*"
        @cd $* && $(BUILD_ENV) ./Setup build $(CABAL_BUILD_ARGS)
        $(MAKECOOKIE)
 
 # build using waf
 build-%/waf:
-       @echo " ==> Running waf in $*"
+       @echo -e "[$(OK)build$(OFF)] $(MSG)Running waf in $(OFF)$*"
        @cd $* && $(BUILD_ENV) ./waf $(WAF_BUILD_ARGS)
        $(MAKECOOKIE)
 
@@ -565,7 +565,7 @@
 
 # Test a program where "make check" (or similar) runs the test.
 test-%/Makefile test-%/makefile test-%/GNUmakefile:
-       @echo " ==> Testing in $*"
+       @echo -e "[$(OK)test$(OFF)] $(MSG)Testing in $(OFF)$*"
        @$(TEST_ENV) $(MAKE) -C $* $(MAKE_ARGS) $(TEST_ARGS)
        $(MAKECOOKIE)
 
@@ -574,22 +574,22 @@
 test-%/setup.py:
        @set -e; cd $* && \
                if python setup.py --help test >/dev/null 2>&1; then \
-                       echo " ==> Running setup.py test in $*"; \
+                       echo -e "[$(OK)test$(OFF)] $(MSG)Running setup.py test 
in $(OFF)$*"; \
                        $(TEST_ENV) python setup.py test $(PY_TEST_ARGS); \
                else \
-                       echo " ==> No test support in $*"; \
+                       echo -e "[$(ERR)test$(OFF)] $(MSG)No test support in 
$(OFF)$*"; \
                fi
        $(MAKECOOKIE)
 
 # Test a program using Cabal.
 test-%/Setup.hs:
-       @echo " ==> Running Setup test in $*"
+       @echo -e "[$(OK)test$(OFF)] $(MSG)Running Setup test in $(OFF)$*"
        @cd $* && $(TEST_ENV) ./Setup test $(CABAL_TEST_ARGS)
        $(MAKECOOKIE)
 
 # Test using waf
 test-%/waf:
-       @echo " ==> Running waf check in $*"
+       @echo -e "[$(OK)test$(OFF)] $(MSG)Running waf check in $(OFF)$*"
        @cd $* && $(TEST_ENV) ./waf check $(WAF_TEST_ARGS)
        $(MAKECOOKIE)
 
@@ -628,7 +628,7 @@
        root /
 
 prepare-install:
-       @echo " ==> Preparing staging area"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Preparing staging area$(OFF)"
        rm -fr $(packageDESTDIR)
        mkdir -p $(packageDESTDIR)$(prefix)
        set -e; \
@@ -644,7 +644,7 @@
        $(MAKECOOKIE)
 
 finish-install:
-       @echo " ==> Moving files from staging area"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Moving files from staging 
area$(OFF)"
        set -e; \
                set -- $(CREATED_MERGE_DIRS); \
                while [ "$$1" != "" ]; do \
@@ -668,19 +668,19 @@
 
 # Use "make install" with prefix-changing.
 install-%/Makefile install-%/makefile install-%/GNUmakefile: 
-       @echo " ==> Running make $(INSTALL_TARGET) in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running make $(INSTALL_TARGET) in 
$(OFF)$*"
        $(INSTALL_ENV) $(MAKE) -C $* $(MAKE_ARGS) $(INSTALL_ARGS) 
$(INSTALL_TARGET)
        $(MAKECOOKIE)
 
 # Use "make install" with DESTDIR.
 DESTDIR_INSTALL_ARGS ?=
 install-%/Makefile-DESTDIR:
-       @echo " ==> Running make $(INSTALL_TARGET) with DESTDIR in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running make $(INSTALL_TARGET) 
with DESTDIR in $(OFF)$*"
        $(INSTALL_ENV) $(MAKE) -C $* $(MAKE_ARGS) $(DESTDIR_INSTALL_ARGS) 
$(INSTALL_TARGET) DESTDIR=$(packageDESTDIR)
        $(MAKECOOKIE)
 
 install-%/Makefile-BSD:
-       @echo " ==> Running pmake $(INSTALL_TARGET) in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running pmake $(INSTALL_TARGET) in 
$(OFF)$*"
        cd $* && $(INSTALL_ENV) pmake $(INSTALL_ARGS) $(INSTALL_TARGET)
        $(MAKECOOKIE)
 
@@ -692,20 +692,20 @@
 # We have to create the installation directory first because otherwise
 # setuptools (spit) will complain.
 install-%/setup.py:
-       @echo " ==> Running setup.py install in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running setup.py install in 
$(OFF)$*"
        mkdir -p $(packageDESTDIR)`python -c 'from distutils.sysconfig import 
get_python_lib; print get_python_lib()'`
        cd $* && $(INSTALL_ENV) python setup.py install 
--root=$(packageDESTDIR) $(PY_INSTALL_ARGS)
        $(MAKECOOKIE)
 
 # install using Ruby setup.rb
 install-%/setup.rb:
-       @echo " ==> Running setup.rb install in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running setup.rb install in 
$(OFF)$*"
        cd $* && $(INSTALL_ENV) ruby setup.rb install $(RUBY_INSTALL_ARGS)
        $(MAKECOOKIE)
 
 # install using Ruby install.rb
 install-%/install.rb:
-       @echo " ==> Running install.rb install in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running install.rb install in 
$(OFF)$*"
        cd $* && $(INSTALL_ENV) ruby install.rb install $(RUBY_INSTALL_ARGS)
        $(MAKECOOKIE)
 
@@ -715,7 +715,7 @@
 
 # install using SCons
 install-%/SConstruct:
-       @echo " ==> Running scons in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running scons in $(OFF)$*"
        cd $* && $(INSTALL_ENV) scons install $(SCONS_ARGS) 
$(SCONS_INSTALL_ARGS)
        $(MAKECOOKIE)
 
@@ -723,9 +723,9 @@
 
 # install using Cabal
 install-%/Setup.hs:
-       @echo " ==> Running Setup copy in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running Setup copy in $(OFF)$*"
        cd $* && $(INSTALL_ENV) ./Setup copy $(CABAL_INSTALL_ARGS)
-       echo " ==> Generating Haskell package config in $*"
+       echo " $(MSG)Generating Haskell package config in $(OFF)$*"
        cd $* && $(INSTALL_ENV) ./Setup register --gen-pkg-config=package.conf
        if [ -e $*/package.conf ]; then \
                mkdir -p $(packagedotgardir)/haskell; \
@@ -735,13 +735,13 @@
 
 # install using CMake
 install-%/cmake_install.cmake:
-       @echo " ==> Running cmake in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running cmake in $(OFF)$*"
        cd $* && $(INSTALL_ENV) env DESTDIR=$(packageDESTDIR) cmake -P 
cmake_install.cmake
        $(MAKECOOKIE)
 
 # install using waf
 install-%/waf:
-       @echo " ==> Running waf install in $*"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Running waf install in $(OFF)$*"
        cd $* && $(INSTALL_ENV) env DESTDIR=$(packageDESTDIR) ./waf install 
$(WAF_INSTALL_ARGS)
        $(MAKECOOKIE)
 
@@ -791,7 +791,7 @@
 
 # FIXME: using -D may not be the right thing to do!
 install-$(MANIFEST_FILE):
-       @echo " ==> Installing from $(MANIFEST_FILE)"
+       @echo -e "[$(OK)install$(OFF)] $(MSG)Installing from 
$(MANIFEST_FILE)$(OFF)"
        WORKSRC=$(WORKSRC) ; $(foreach ZORCH,$(shell cat $(MANIFEST_FILE)), 
install -Dc $(join $(wordlist 3,$(MANIFEST_SIZE),$(MANIFEST_FLAGS)),$(wordlist 
3,$(MANIFEST_SIZE),$(MANIFEST_LINE))) $(word 1,$(MANIFEST_LINE)) 
$(packageprefix)/$(word 2,$(MANIFEST_LINE)) ;)
        $(MAKECOOKIE)
 
@@ -806,9 +806,9 @@
 # the install tree.  Most dependencies work this way.
 dep-$(GARDIR)/%:
        @if [ "$(filter $*,$(IGNORE_DEPS))" != "" ] ; then \
-               echo ' ==> Ignoring dependency $*' ; \
+               echo -e "[$(OK)install-deps$(OFF)] $(MSG)Ignoring dependency 
$(OFF)$*" ; \
        else \
-               echo ' ==> Building $* as a dependency' ; \
+               echo -e "[$(OK)install-deps$(OFF)] $(MSG)Building $* as a 
dependency" ; \
                $(if $(FORCE_REBUILD),,$(MAKE) -C $(DEP) install-p 2>/dev/null 
|| ($(MAKE) -C $(DEP) reinstall-p && $(MAKE) -C $(DEP) reinstall 2>/dev/null) ) 
|| $(MAKE) -C $(DEP) install ; \
        fi
 
@@ -857,7 +857,7 @@
                n=`basename $$x`; \
                maybe_mv () { \
                        if [ -f $$1 ] ; then \
-                               echo " ==> Renaming $$1 to $$2"; \
+                               echo "Renaming $$1 to $$2"; \
                                mv $$1 $$2; \
                        fi \
                }; \
@@ -884,12 +884,12 @@
 depcheck-users:
        @set -e; for user in $(NEED_USERS) -; do \
                [ "$$user" = "-" ] && continue; \
-               echo ' ==> Checking user' $$user 'exists'; \
+               echo -e "[$(OK)depcheck-users$(OFF)] $(MSG)Checking user" 
$$user "exists"; \
                python -c "import pwd; pwd.getpwnam('$$user')" 2>/dev/null; \
        done
        @set -e; for group in $(NEED_GROUPS) -; do \
                [ "$$group" = "-" ] && continue; \
-               echo ' ==> Checking group' $$group 'exists'; \
+               echo "[$(OK)depcheck-users$(OFF)] $(MSG)Checking group" $$group 
"exists"; \
                python -c "import grp; grp.getgrnam('$$group')" 2>/dev/null; \
        done
        $(MAKECOOKIE)
@@ -942,6 +942,7 @@
 PACKAGE_VARS = \
        GARNAME \
        GARVERSION \
+       GARPROFILE \
        prefix \
        sysconfdir \
        vardir \
@@ -970,17 +971,17 @@
        Makefile
 
 sysinstall-collisions:
-       @echo ' ==> Removing collisions'
+       @echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Removing collisions$(OFF)"
        rm -rf $(foreach FILE,$(COLLISIONS),$(packagedir)/$(FILE))
        $(MAKECOOKIE)
 
 sysinstall-normalise:
-       @echo ' ==> Normalising directory layout'
+       @echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Normalising directory 
layout$(OFF)"
        set -e; \
        normalise () { \
                rmdir $$1 2>/dev/null || true; \
                if [ -d $$1 ]; then \
-                       echo " ==> Moving contents of $$1 to $$2"; \
+                       echo "[$(OK)sysinstall$(OFF)] $(MSG)Moving contents of 
$$1 to $$2$(OFF)"; \
                        mkdir -p $$2; \
                        cp -a $$1/* $$2; \
                        rm -fr $$1; \
@@ -993,7 +994,7 @@
        $(MAKECOOKIE)
 
 sysinstall-packagevars:
-       @echo ' ==> Writing package metadata'
+       @echo -e "[$(OK)sysinstall$(OFF)] $(MSG)Writing package metadata$(OFF)"
        test -d $(dotgardir) || mkdir -p $(dotgardir);
        (cd $(packagedir) \
        && find . -not -type d -print > $(dotgardir)/FILES \
@@ -1008,7 +1009,7 @@
 
 sysinstall-uninstall:
        @rm -f $(COOKIEDIR)/sysinstall-*
-       (test -d $(dotgardir) || (echo "$(GARNAME) is not installed" && exit 
1)) && \
+       (test -d $(dotgardir) || (echo "[$(ERR)sysinstall$(OFF)] 
$(MSG)$(GARNAME) is not installed$(OFF)" && exit 1)) && \
        ( cd $(prefix) ; \
        test -f $(dotgardir)/FILES && rm -f -- `cat $(dotgardir)/FILES` ; \
        test -f $(dotgardir)/DIRS && rmdir --ignore-fail-on-non-empty -v -- 
`cat $(dotgardir)/DIRS` ; \

=== modified file 'gar.mk'
--- a/gar.mk    2012-12-07 14:40:38 +0000
+++ b/gar.mk    2012-12-07 17:21:11 +0000
@@ -54,7 +54,7 @@
 
 # For rules that do nothing, display what dependencies they
 # successfully completed
-DONADA = @echo "       address@hidden complete.  Finished rules: $+"
+DONADA = @echo -e "[$(OK)address@hidden(OFF)] $(MSG)Complete.  Finished rules: 
$(OFF)$+"
 
 # TODO: write a stub rule to print out the name of a rule when it
 # *does* do something, and handle indentation intelligently.
@@ -124,19 +124,25 @@
 # The main rules also run the $(DONADA) code, which prints out
 # what just happened when all the dependencies are finished.
 
+pkg-info:
+       @echo -e "$(MSG)Name:$(OFF) $(GARNAME)"
+       @echo -e "$(MSG)Version:$(OFF) $(GARVERSION)"
+       @echo -e "$(MSG)Description:$(OFF) $(DESCRIPTION)"
+
+
 # fetch-list   - Show list of files that would be retrieved by fetch.
 # NOTE: DOES NOT RUN pre-everything!
 fetch-list:
-       @echo "Name: $(GARNAME)"
-       @echo "Version: $(GARVERSION)"
-       @echo "Location: $(firstword $(MASTER_SITES))$(MASTER_SUBDIR)"
-       @echo "Distribution files: "
+       @echo -e "$(MSG)Name:$(OFF) $(GARNAME)"
+       @echo -e "$(MSG)Version:$(OFF) $(GARVERSION)"
+       @echo -e "$(MSG)Location:$(OFF) $(firstword 
$(MASTER_SITES))$(MASTER_SUBDIR)"
+       @echo -e "$(MSG)Distribution files:$(OFF) "
        @for i in $(DISTFILES); do echo "       $$i"; done
-       @echo "Patch files: "
+       @echo -e "$(MSG)Patch files:$(OFF) "
        @for i in $(PATCHFILES); do echo "      $$i"; done
-       @echo "Signature files: "
+       @echo -e "$(MSG)Signature files:$(OFF) "
        @for i in $(SIGFILES); do echo "        $$i"; done
-       @echo "Dependencies: "
+       @echo -e "$(MSG)Dependencies:$(OFF) "
        @for i in $(LIBDEPS) $(BUILDDEPS) $(if $(USE_TESTS),$(TESTDEPS),) ; do 
echo "   $$i"; done
 
 # fetch                        - Retrieves $(DISTFILES) (and $(PATCHFILES) if 
defined)
@@ -292,8 +298,7 @@
 
 # Check in a trivially-updated package.
 ci:
-       @$(SCRIPTSDIR)/gar-lint
-       @$(WITH_LOCK)darcs darcs record -a -m '$(GARNAME) $(GARVERSION).' .
+       @bzr commit . -m '$(GARNAME) $(GARVERSION)' 
 
 # Automatically find dependencies (after a configure).
 find-deps:
@@ -327,7 +332,7 @@
        @rm -rf $(DOWNLOADDIR) $(COOKIEDIR) $(LOGDIR) $(WORKSRC) $(WORKDIR) 
$(EXTRACTDIR) $(SCRATCHDIR) $(SCRATCHDIR)-$(COOKIEDIR) *~
 
 # these targets do not have actual corresponding files
-.PHONY: all fetch-list fetch checksum makesum garchive extract patch makepatch 
configure build test install clean beaujolais update help test-build
+.PHONY: all info fetch-list fetch checksum makesum garchive extract patch 
makepatch configure build test install clean beaujolais update help test-build
 
 # A logging version of the rules, e.g. make build-log, respawns and sends 
output to $(LOGDIR)
 %-log: $(LOGDIR)
@@ -335,9 +340,9 @@
 
 test-logs:
        @for f in `find . -name 'test*.log'` ; do \
-               echo -e "===> test log start: $$f <===" ; \
+               echo -e "$(MSG)===> test log start: $$f <===$(OFF)" ; \
                cat $$f ; \
-               echo -e "===> test log end: $$f <===\n" ;  \
+               echo -e "$(MSG)===> test log end: $$f <===\n$(OFF)" ;  \
        done
 
 .PHONY: $(addsuffix fetch checksum extract patch configure build test 
install,-log)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]