summaryrefslogblamecommitdiffstats
path: root/quilt/series.in
blob: f2fee9e0a096fd041841fbcef52a13bb44673971 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
         









                                                                      
                                               
            
                                                                          

                      
                                     



       
                                            

                        
                         
                                                  
 

                                           







                      

                                



                         
                                                                       


            
                                             







                      





                             












                                                  












                           

           
                                  
    

                                           
                        





                                                           
    
                                       
  



                      
#! @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 series [-v]\n"
	if [ x$1 = x-h ]
	then
		printf $"
Print the names of all patches in the series file.

-v	Verbose, more user friendly output.
"
		exit 0
	else
		exit 1
	fi
}

cat_patches()
{
	local color=$1 prefix=$2
	shift 2
	local patch

	for patch in "$@"
	do
		echo "$color$prefix$(print_patch "$patch")$color_clear"
	done
}

options=`getopt -o vh --long color:: -- "$@"`

if [ $? -ne 0 ]
then
	usage
fi

eval set -- "$options"

while true
do
	case "$1" in
	-v)
		opt_verbose=1
		shift ;;
	--color)
		case "$2" in
		"" | always)
			opt_color=1 ;;
		auto | tty)
			opt_color=
			[ -t 1 ] && opt_color=1 ;;
		never)
			opt_color= ;;
		*)
			usage ;;
		esac
		shift 2 ;;
	-h)
		usage -h ;;
	--)
		shift
		break ;;
	esac
done

if [ $# -ne 0 ]
then
	usage
fi

setup_pager

if [ -n "$opt_verbose$opt_color" ]
then
	[ -n "$opt_color" ] && setup_colors

	top=$(top_patch)
	cat_patches "$color_series_app" \
		"${opt_verbose:++ }" $(patches_before $top)
	[ -n "$top" ] && cat_patches "$color_series_top" \
		"${opt_verbose:+= }" $top
	cat_patches "$color_series_una" \
		"${opt_verbose:+  }" $(patches_after $top)
else
	cat_patches "" "" $(cat_series)
fi
### Local Variables:
### mode: shell-script
### End:
# vim:filetype=sh