I have a pretty "complex" .quiltrc that looks at the current working
directory, and other things, to try to determine a number of different
environment variables that quilt then uses just fine.

I have other scripts that end up calling quilt in order to get patches
applied, and sometimes, if there are problems, it would be nice to be
able to figure out what those environment variables are set to so that
patches can be edited by hand, or other things can happen.

So I came up with 'quilt env', a simple dump of the environment
variables that quilt runs with, that any other script can then take and
use as needed.

Am I just missing something built in that quilt already provides to get
this type of information?  Or is a command like this useful for anyone
else?  If so, I'll be glad to turn it into a "real" patch, otherwise, I
can just keep it in my local tree.

thanks,

greg k-h
#! /bin/bash

#  This script is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License version 2 as
#  published by the Free Software Foundation.
#
#  See the COPYING and AUTHORS files for more details.

# Read in library functions
if [ "$(type -t patch_file_name)" != function ]
then
        if ! [ -r $QUILT_DIR/scripts/patchfns ]
        then
                echo "Cannot read library $QUILT_DIR/scripts/patchfns" >&2
                exit 1
        fi
        . $QUILT_DIR/scripts/patchfns
fi

usage()
{
        printf $"Usage: quilt env\n"
        if [ x$1 = x-h ]
        then
                printf $"
Print the quilt environment variables.
"
                exit 0
        else
                exit 1
        fi
}

if [ $# -ne 0 ]
then
        usage
fi

# print out all variables that we care about
echo "QUILTRC=${QUILTRC}"
echo "QUILT_DIFF_OPTS=${QUILT_DIFF_OPTS}"
echo "QUILT_PATCH_OPTS=${QUILT_PATCH_OPTS}"
echo "QUILT_DIFFSTAT_OPTS=${QUILT_DIFFSTAT_OPTS}"
echo "QUILT_PATCHES=${QUILT_PATCHES}"
echo "QUILT_SERIES=${QUILT_SERIES}"
echo "QUILT_PATCHES_PREFIX=${QUILT_PATCHES_PREFIX}"
echo "QUILT_NO_DIFF_INDEX=${QUILT_NO_DIFF_INDEX}"
echo "QUILT_NO_DIFF_TIMESTAMPS=${QUILT_NO_DIFF_TIMESTAMPS}"
echo "QUILT_PAGER=${QUILT_PAGER}"
echo "EDITOR=${EDITOR}"

### Local Variables:
### mode: shell-script
### End:
# vim:filetype=sh
_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to