summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rw-r--r--hosts2
-rw-r--r--profile1
-rwxr-xr-xrunscript-alpine.sh23
-rwxr-xr-xsend-pr581
-rw-r--r--send-pr.conf5
-rw-r--r--send-pr.template41
7 files changed, 663 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index fc62cb8..65cc3a8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3_beta2
+VERSION=1.3
PV =alpine-baselayout-$(VERSION)
TARBALL =$(PV).tar.gz
@@ -14,9 +14,11 @@ SBIN_FILES =runscript-alpine.sh functions.sh rc_add rc_delete rc_status\
RC_SH_FILES =rc-services.sh
UDHCPC_FILES =default.script
LIB_MDEV_FILES =ide_links sd_links subdir_dev usbdev
+USR_BIN_FILES =send-pr
+GNATS_FILES =send-pr.template send-pr.conf
CRONTABS =crontab
DISTFILES =$(ETC_FILES) $(SBIN_FILES) $(UDHCPC_FILES) $(RC_SH_FILES)\
- $(LIB_MDEV_FILES) Makefile
+ $(LIB_MDEV_FILES) $(GNATS_FILES) $(USR_BIN_FILES) Makefile
all: $(GENERATED_FILES)
for i in $(SUBDIRS) ; do \
@@ -39,8 +41,9 @@ hosts:
echo -e "127.0.0.1\tlocalhost" > hosts
profile:
- echo "export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" > profile
- echo "umask 022" >> profile
+ echo "export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" > $@
+ echo "export PAGER=less" >> $@
+ echo "umask 022" >> $@
shadow: passwd
@lastchange=$$(( `date +%s` / ( 24 * 3600 ) ));\
@@ -57,6 +60,8 @@ install:
$(DESTDIR)/etc/crontabs \
$(DESTDIR)/lib/rcscripts/sh \
$(DESTDIR)/usr/share/udhcpc \
+ $(DESTDIR)/etc/gnats \
+ $(DESTDIR)/usr/bin \
$(DESTDIR)/lib/mdev \
$(DESTDIR)/var/spool/cron \
$(DESTDIR)/etc/periodic/15min \
@@ -68,12 +73,14 @@ install:
cd $$i && make install && cd .. ;\
done
install -m 0644 $(ETC_FILES) $(DESTDIR)/etc
+ install -m 0644 $(GNATS_FILES) $(DESTDIR)/etc/gnats
chmod 600 $(DESTDIR)/etc/shadow
install -m 0644 $(CONFD_FILES) $(DESTDIR)/etc/conf.d
install -m 0755 $(SBIN_FILES) $(DESTDIR)/sbin
install -m 0755 $(UDHCPC_FILES) $(DESTDIR)/usr/share/udhcpc
install -m 0755 $(RC_SH_FILES) $(DESTDIR)/lib/rcscripts/sh
install -m 0755 $(LIB_MDEV_FILES) $(DESTDIR)/lib/mdev
+ install -m 0755 $(USR_BIN_FILES) $(DESTDIR)/usr/bin
mv $(DESTDIR)/etc/crontab $(DESTDIR)/etc/crontabs/root
ln -s /etc/crontabs $(DESTDIR)/var/spool/cron/crontabs
diff --git a/hosts b/hosts
index ba712fe..08450f4 100644
--- a/hosts
+++ b/hosts
@@ -1 +1 @@
-127.0.0.1 localhost
+-e 127.0.0.1 localhost
diff --git a/profile b/profile
index 006c561..09701bc 100644
--- a/profile
+++ b/profile
@@ -1,2 +1,3 @@
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
+export PAGER=less
umask 022
diff --git a/runscript-alpine.sh b/runscript-alpine.sh
index e756c81..77f4efc 100755
--- a/runscript-alpine.sh
+++ b/runscript-alpine.sh
@@ -53,6 +53,29 @@ usage() {
exit $1
}
+# imported from gentoo
+get_bootparam() {
+ local match="$1"
+ [ -z "${match}" -o ! -r /proc/cmdline ] && return 1
+
+ set -- $(cat /proc/cmdline)
+ while [ -n "$1" ] ; do
+ case "$1" in
+ gentoo=*)
+ local params="${1##*=}"
+ local IFS=, x=
+ for x in ${params} ; do
+ [ "${x}" = "${match}" ] && return 0
+ done
+ ;;
+ esac
+ shift
+ done
+
+ return 1
+}
+
+
[ -f "/etc/conf.d/$myservice" ] && . "/etc/conf.d/$myservice"
. "$myscript"
diff --git a/send-pr b/send-pr
new file mode 100755
index 0000000..9f479bf
--- /dev/null
+++ b/send-pr
@@ -0,0 +1,581 @@
+#!/bin/sh
+# send-pr. Generated from send-pr.sh by configure.
+#
+# Submit a problem report to a GNATS site.
+# Copyright (C) 2001, 2002 Milan Zamazal
+# Copyright (C) 1993, 2001 Free Software Foundation, Inc.
+# Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
+# version written by Heinz G. Seidl (hgs@cygnus.com).
+# Further edited by Milan Zamazal (pdm@zamazal.org).
+# mktemp support by Yngve Svendsen (yngve.svendsen@clustra.com).
+#
+# This file is part of GNU GNATS.
+#
+# GNU GNATS is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU GNATS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU GNATS; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+################################################################################
+# Default values -- You may override these in your configuration file
+################################################################################
+# The version of this send-pr.
+VERSION="4.1.0-alpine"
+
+# The submitter-id for your site.
+SUBMITTER="unknown"
+
+# The place where our usual binaries live.
+prefix="/usr"
+exec_prefix="${prefix}"
+bindir="${exec_prefix}/bin"
+sbindir="${exec_prefix}/bin"
+sysconfdir="/etc"
+libexecdir="${exec_prefix}/libexec/gnats"
+
+# The default release for this host.
+DEFAULT_RELEASE="gnats-4.1.0"
+
+# The default organization.
+DEFAULT_ORGANIZATION="unknown"
+
+# How to read the passwd database.
+PASSWD="cat /etc/passwd"
+
+# Is the mktemp command available?
+MKTEMP="yes"
+
+ECHON=bsd
+
+# By default send-pr connects directly to the database. However, it
+# can be configured to use an existing template file by setting the
+# TEMPLATE variable below to point to a PR template generated from
+# "send-pr -P".
+TEMPLATE=""
+
+# send-pr can use mail to submit PRs, instead of connecting to the
+# database directly. MAILPROG needs to point to a compatible mailer
+# (sendmail will work). If MAILPROG needs to have the address that
+# the mail is being sent to specified on the command line, it should
+# be specified here as well (for example, the command
+# MAILPROG="mail bugs@foo.bar.com"
+# should work). If sendmail is used, this should be set to
+# MAILPROG="/usr/sbin/sendmail -oi -t"
+MAILPROG=""
+
+# The address that PRs are sent to. Normally this can be left as "bugs";
+# however, if using mail to submit PRs, this should be set to the address
+# where PRs should be sent.
+MAILADDR="bugs"
+
+# Configuration file to be read. It must be a shell script that can redefine
+# the variables above to fit a local configuration. It reads the system config
+# file first, then the personal config file.
+CONFIGFILES="/etc/gnats/send-pr.conf ${HOME}/.send-pr.conf"
+for CONFIGFILE in ${CONFIGFILES}; do
+ if [ -r ${CONFIGFILE} ]; then
+ . ${CONFIGFILE}
+ fi
+done
+
+#
+# check hf sendmail exist
+if ! which sendmail > /dev/null ; then
+ echo "sendmail not found. Please run 'setup-mta'"
+ exit 1;
+fi
+
+if [ -z "$TMPDIR" ]; then
+ TMPDIR=/tmp
+else
+ if [ "`echo $TMPDIR | grep '/$'`" != "" ]; then
+ TMPDIR="`echo $TMPDIR | sed -e 's,/$,,'`"
+ fi
+fi
+
+# TEMP: Temporary copy of the PR, to be edited by the user.
+# BAD: The PR will end up here if the user aborts.
+# REF: The 'reference' copy of the PR template, used to verify that the user
+# actually did edit the template.
+# FIXFIL: A sed script used to remove comments from the template before
+# processing.
+if [ $MKTEMP = yes ]; then
+ TEMP=`mktemp $TMPDIR/pXXXXXX` || exit 1
+ BAD=`mktemp $TMPDIR/pbadXXXXXX` || exit 1
+ REF=`mktemp $TMPDIR/pfXXXXXX` || exit 1
+ FIXFIL=`mktemp $TMPDIR/fixXXXXXX` || exit 1
+else
+ TEMP=$TMPDIR/p$$
+ BAD=$TMPDIR/pbad$$
+ REF=$TMPDIR/pf$$
+ FIXFIL=$TMPDIR/fix$$
+ bad_temp=0
+ : > $TEMP || bad_temp=1
+ : > $BAD || bad_temp=1
+ : > $REF || bad_temp=1
+ : > $FIXFIL || bad_temp=1
+ if [ $bad_temp = 1 ]; then
+ rm -f $TEMP $BAD $REF $FIXFIL
+ exit 1;
+ fi
+fi
+REMOVE_TEMP="rm -f $TEMP $BAD $REF"
+
+# find a user name
+if [ "$LOGNAME" = "" ]; then
+ if [ "$USER" != "" ]; then
+ LOGNAME="$USER"
+ else
+ LOGNAME="UNKNOWN"
+ fi
+fi
+
+[ -z "$FROM" ] && FROM="$LOGNAME"
+REPLYTO="${REPLY_TO:-${REPLYTO:-$FROM}}"
+if [ "x$MAILPROG" != "x" ]
+then
+ RESP_ALIAS="`query-pr --adm-field responsible --adm-key $LOGNAME --adm-subfield alias 2>/dev/null`"
+else
+ RESP_ALIAS=""
+fi
+
+# Find out the name of the originator of this PR.
+if [ -n "$NAME" ]; then
+ DEFAULT_ORIGINATOR="$NAME"
+elif [ -f $HOME/.fullname ]; then
+ DEFAULT_ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
+else
+ # Must use temp file due to incompatibilities in quoting behavior
+ # and to protect shell metacharacters in the expansion of $LOGNAME
+ $PASSWD | grep "^$LOGNAME:" | awk -F: '{print $5}' | sed -e 's/,.*//' > $TEMP
+ if [ "x$RESP_ALIAS" != "x" ]
+ then
+ DEFAULT_ORIGINATOR="$RESP_ALIAS (`cat $TEMP`)"
+ else
+ DEFAULT_ORIGINATOR="$FROM (`cat $TEMP`)"
+ fi
+ rm -f $TEMP
+fi
+
+if [ -z "$ORGANIZATION" ]
+then
+ ORGANIZATION="$DEFAULT_ORGANIZATION";
+fi
+
+if [ -n "$ORGANIZATION" -a "x$ORGANIZATION" != "unknown" ]; then
+ if [ `echo $ORGANIZATION | fgrep -c /` -gt 0 -a -f "$ORGANIZATION" ]; then
+ ORGANIZATION="`cat $ORGANIZATION`"
+ fi
+elif [ -f $HOME/.organization ]; then
+ ORGANIZATION="`cat $HOME/.organization`"
+fi
+
+if [ "x$ORGANIZATION" = "unknown" ]; then
+ cat <<__EOF__
+It seems that send-pr is not installed with your organization set to a useful
+value. To fix this, you need to edit the configuration file
+$CONFIGFILE
+and fill in the organization with the correct value.
+
+__EOF__
+ ORGANIZATION="";
+else
+ DEFAULT_ORGANIZATION="$ORGANIZATION"
+fi 1>&2
+
+# If they don't have a preferred editor set, then use
+if [ -z "$VISUAL" ]; then
+ if [ -z "$EDITOR" ]; then
+ EDIT=vi
+ else
+ EDIT="$EDITOR"
+ fi
+else
+ EDIT="$VISUAL"
+fi
+
+# Find out some information.
+SYSTEM=`( [ -f /bin/uname ] && /bin/uname -a ) || \
+ ( [ -f /usr/bin/uname ] && /usr/bin/uname -a ) || echo ""`
+
+# alpine specific addition
+ALPINE_RELEASE=`cat /etc/alpine-release || echo ""`
+
+# Our base command name.
+COMMAND=`echo $0 | sed -e 's,.*/,,'`
+USAGE="Usage: $COMMAND [OPTION]...
+
+ -b --batch run without printing most messages
+ -d --database DATABASE submit PR to DATABASE
+ -f --file FILE read the PR template from FILE (\`-' for stdin)
+ -p --print just print the template and exit
+ --request-id send a request for a user id
+ -s --severity SEVERITY PR severity
+
+ -h --help display this help and exit
+ -V --version output version information and exit
+"
+REMOVE=
+BATCH=
+DEFAULT_SEVERITY=
+
+if [ "$SYSTEM" != "" ]
+then
+ DEFAULT_ENVIRONMENT="System: $SYSTEM
+"
+fi
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -r) ;; # Ignore for backward compat.
+ -f | --file) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+ shift ; IN_FILE="$1"
+ if [ "$IN_FILE" != "-" -a ! -r "$IN_FILE" ]; then
+ echo "$COMMAND: cannot read $IN_FILE"
+ exit 1
+ fi
+ ;;
+ -b | --batch) BATCH=true ;;
+ -d | --database) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+ shift; GNATSDB="$1"; export GNATSDB
+ ;;
+ -s | --severity) if [ $# -eq 1 ]; then echo "$USAGE"; exit 1; fi
+ shift ; DEFAULT_SEVERITY="$1"
+ ;;
+ -p | -P | --print) PRINT=true ;;
+ --request-id) REQUEST_ID=true ;;
+ -h | --help) echo "$USAGE"; exit 0 ;;
+ -V | --version) echo "$VERSION"; exit 0 ;;
+ -*) echo "$USAGE" ; exit 1 ;;
+ *) echo "$USAGE" ; exit 1 ;;
+ esac
+ shift
+done
+
+if [ "x$SUBMITTER" = "x" ]
+then
+ SUBMITTER="unknown"
+fi
+
+if [ "x$SUBMITTER" = "xunknown" -a -z "$REQUEST_ID" -a -z "$IN_FILE" ]; then
+ cat << '__EOF__'
+It seems that send-pr is not installed with your unique submitter-id, or that
+"unknown" has been specified. You need to run:
+
+ install-sid YOUR-SID
+
+where YOUR-SID is the identification code you received with `send-pr'.
+`send-pr' will automatically insert this value into the template field
+`>Submitter-Id'. If you've downloaded `send-pr' from the Net, use `net'
+for this value. If you do not know your id, run `send-pr --request-id' to
+get one from your support site.
+__EOF__
+ exit 1
+fi
+
+# So the template generation code finds it.
+DEFAULT_SUBMITTERID=${SUBMITTER}
+
+# Catch some signals. ($xs kludge needed by Sun /bin/sh)
+xs=0
+trap 'rm -f $REF $TEMP $FIXFIL; exit $xs' 0
+trap 'echo "$COMMAND: Aborting ..."; rm -f $REF $TEMP $FIXFIL; xs=1; exit' 1 3 13 15
+
+if [ "x$PRINT" = "xtrue" ]; then
+ FROM="<FROM>"
+ REPLYTO="<REPLYTO>"
+ DEFAULT_ORIGINATOR="<DEFAULT_ORIGINATOR>"
+ DEFAULT_SUBMITTERID="<SUBMITTER>"
+fi
+
+# If they told us to use a specific file, then do so.
+if [ -n "$IN_FILE" ]; then
+ if [ "$IN_FILE" = "-" ]; then
+ # The PR is coming from the standard input.
+ cat > $TEMP
+ else
+ # Use the file they named.
+ cat $IN_FILE > $TEMP
+ fi
+else
+ if [ -n "$TEMPLATE" -a -z "$PRINT_INTERN" ]; then
+ # If their TEMPLATE points to a bogus entry, then bail.
+ if [ ! -f "$TEMPLATE" -o ! -r "$TEMPLATE" -o ! -s "$TEMPLATE" ]; then
+ echo "$COMMAND: can't seem to read your template file (\`$TEMPLATE'), ignoring TEMPLATE"
+ sleep 1
+ PRINT_INTERN=bad_prform
+ fi
+ fi
+
+ if [ -n "$TEMPLATE" -a -z "$PRINT_INTERN" ]; then
+ sed "s/<FROM>/$FROM/;s/<REPLYTO>/$REPLYTO/;s/<DEFAULT_ORIGINATOR>/$DEFAULT_ORIGINATOR/;s/<SUBMITTER>/$DEFAULT_SUBMITTERID/;s/<SYSTEM>/$SYSTEM/;s/<ALPINE_RELEASE>/$ALPINE_RELEASE/" < $TEMPLATE > $TEMP ||
+ ( echo "$COMMAND: could not copy $TEMPLATE" ; xs=1; exit )
+ else
+ # Which genius thought of iterating through this loop twice, when the
+ # cp command would suffice?
+ for file in $TEMP ; do
+ cat > $file << '__EOF__'
+SEND-PR: -*- send-pr -*-
+SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
+SEND-PR: will all comments (text enclosed in `<' and `>').
+SEND-PR:
+SEND-PR: Please consult the send-pr man page `send-pr(1)' or the Texinfo
+SEND-PR: manual if you are not sure how to fill out a problem report.
+SEND-PR: Note that the Synopsis field is mandatory. The Subject (for
+SEND-PR: the mail) will be made the same as Synopsis unless explicitly
+SEND-PR: changed.
+SEND-PR:
+SEND-PR: Choose from the following categories:
+SEND-PR:
+__EOF__
+
+ # Format the categories so they fit onto lines.
+ CATEGORIES=`${bindir}/query-pr --valid-values Category`;
+ l=`echo "$CATEGORIES" | \
+ awk 'BEGIN {max = 0; } { if (length($0) > max) { max = length($0); } }
+ END {print max + 1;}'`
+ c=`expr 61 / $l`
+ if [ $c -eq 0 ]; then c=1; fi
+ echo "$CATEGORIES" | \
+ awk 'BEGIN {printf "SEND-PR: "; i = 0 }
+ { printf ("%-'$l'.'$l's", $0);
+ if ((++i % '$c') == 0) { printf "\nSEND-PR: " } }
+ END { printf "\nSEND-PR:\n"; }' >> $file
+
+ cat >> $file << __EOF__
+To: $MAILADDR
+Subject:
+From: $FROM
+Reply-To: $REPLYTO
+X-send-pr-version: $VERSION
+
+
+__EOF__
+
+ #
+ # Iterate through the list of input fields. fieldname is the
+ # name of the field. fmtname is the formatted name of the field,
+ # with >, : and extra spaces to cause the field contents to be
+ # aligned.
+ #
+ ${bindir}/query-pr --list-input-fields | awk '{a[NR]=$1""; mnr = NR+1; len = length($1) + 2; if (mlen < len) mlen = len; } END { for (x = 1; x < mnr; x++) { b = ">"a[x]":"; printf ("%s %-"mlen"s&\n", a[x], b); } }' | while read fieldname fmtname
+ do
+ fmtname="`echo "$fmtname" | sed 's/[&]$//;'`"
+ upname="`echo $fieldname | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;s/-//g;'`"
+ # Grab the default value for this field.
+ eval 'default_val="$DEFAULT_'${upname}'"'
+ # What's stored in the field?
+ type=`${bindir}/query-pr --field-type $fieldname | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ case $type in
+ enum)
+ if [ "$default_val" != "" ]
+ then
+ desc=$default_val;
+ else
+ if [ "$fieldname" != "Category" ]
+ then
+ values=`${bindir}/query-pr --valid-values $fieldname | tr '\n' ' ' | sed 's/ *$//g; s/ / | /g;s/^/[ /;s/$/ ]/;'`
+ valslen=`echo "$values" | wc -c`
+ else
+ values="choose from a category listed above"
+ valslen=1;
+ fi
+ if [ "$valslen" -gt 160 ]
+ then
+ desc="<`${bindir}/query-pr --field-description $fieldname` (one line)>";
+ else
+ desc="<${values} (one line)>";
+ fi
+ dpat=`echo "$desc" | tr '\]\[*+^$|\()&/' '............'`
+ echo "/^>${fieldname}:/ s/${dpat}//" >> $FIXFIL
+ fi
+ echo "${fmtname}${desc}" >> $file
+ ;;
+ multitext)
+ if [ "$default_val" != "" ]
+ then
+ desc=" $default_val";
+ else
+ desc=" <`${bindir}/query-pr --field-description $fieldname` (multiple lines)>";
+ dpat=`echo "$desc" | tr '\]\[*+^$|\()&/' '............'`
+ echo "s/^${dpat}//" >> $FIXFIL
+ fi
+ echo "${fmtname}" >> $file;
+ echo "$desc" >> $file;
+ ;;
+ *)
+ if [ "$default_val" != "" ]
+ then
+ desc="${default_val}"
+ else
+ desc="<`${bindir}/query-pr --field-description $fieldname` (one line)>"
+ dpat=`echo "$desc" | tr '\]\[*+^$|\()&/' '............'`
+ echo "/^>${fieldname}:/ s/${dpat}//" >> $FIXFIL
+ fi
+ echo "${fmtname}${desc}" >> $file
+ ;;
+ esac
+ done
+ done
+ fi
+
+ if [ "$PRINT" = true -o "$PRINT_INTERN" = true ]; then
+ cat $TEMP
+ xs=0; exit
+ fi
+
+ cp $TEMP $REF
+
+ chmod u+w $TEMP
+ if [ -z "$REQUEST_ID" ]; then
+ eval $EDIT $TEMP
+ else
+ ed -s $TEMP << '__EOF__'
+/^Subject/s/^Subject:.*/Subject: request for a customer id/
+/^>Category/s/^>Category:.*/>Category: send-pr/
+w
+q
+__EOF__
+ fi
+
+ if cmp -s $REF $TEMP ; then
+ echo "$COMMAND: problem report not filled out, therefore not sent"
+ xs=1; exit
+ fi
+fi
+
+# TEMP is the PR that we are editing. When we're done, REF will contain
+# the final PR to be sent.
+
+while [ -z "$REQUEST_ID" ]; do
+ CNT=0
+
+ #
+ # Remove comments.
+ #
+ echo '/^SEND-PR:/d' >> $FIXFIL
+ echo 's/<.*>//' >> $FIXFIL
+ sed -f $FIXFIL $TEMP > $REF
+
+ # REF now has the actual PR that we want to send.
+
+ #
+ # Check that synopsis is not empty.
+ #
+ if grep "^>Synopsis:[ ]*$" $REF > /dev/null
+ then
+ echo "$COMMAND: Synopsis must not be empty."
+ CNT=`expr $CNT + 1`
+ fi
+
+ if [ "x$MAILPROG" = "x" ]
+ then
+ # Since we're not using mail, use pr-edit to check the PR. We can't
+ # do much checking otherwise, sorry.
+ $libexecdir/pr-edit --check-initial < $REF || CNT=`expr $CNT + 1`
+ fi
+
+ [ $CNT -gt 0 -a -z "$BATCH" ] &&
+ echo "Errors were found with the problem report."
+
+ while true; do
+ if [ -z "$BATCH" ]; then
+ echo -n "a)bort, e)dit or s)end? "
+ read input
+ else
+ if [ $CNT -eq 0 ]; then
+ input=s
+ else
+ input=a
+ fi
+ fi
+ case "$input" in
+ a*)
+ if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ mv $TEMP $BAD
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ xs=1; exit
+ ;;
+ e*)
+ eval $EDIT $TEMP
+ continue 2
+ ;;
+ s*)
+ break 2
+ ;;
+ esac
+ done
+done
+
+#
+# Make sure the mail has got a Subject. If not, use the same as
+# in Synopsis.
+#
+
+if grep '^Subject:[ ]*$' $REF > /dev/null
+then
+ SYNOPSIS=`grep '^>Synopsis:' $REF | sed -e 's/^>Synopsis:[ ]*//'`
+ ed -s $REF << __EOF__
+/^Subject:/s/:.*\$/: $SYNOPSIS/
+w
+q
+__EOF__
+fi
+
+while :
+do
+ if [ "x$MAILPROG" != "x" ]
+ then
+ # Use mail to send the PR.
+ if $MAILPROG < $REF; then
+ echo "$COMMAND: problem report mailed"
+ echo "Thank you!"
+ xs=0; exit
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ else
+ if pr_num=`$libexecdir/pr-edit --submit --show-prnum < $REF` ; then
+ echo "$COMMAND: problem report $pr_num filed"
+ xs=0; exit
+ else
+ echo "$COMMAND: the problem report is not sent."
+ fi
+ fi
+ while true
+ do
+ if [ -z "$BATCH" ]; then
+ echo -n "a)bort or s)end? "
+ read input
+ case "$input" in
+ a*)
+ break 2 ;;
+ s*)
+ break ;;
+ esac
+ else
+ break 2;
+ fi
+ done
+done
+
+if [ -z "$BATCH" ]; then
+ echo "$COMMAND: the problem report remains in $BAD and is not sent."
+ mv $TEMP $BAD
+else
+ echo "$COMMAND: the problem report is not sent."
+fi
+
+xs=1; exit;
diff --git a/send-pr.conf b/send-pr.conf
new file mode 100644
index 0000000..c8dba1f
--- /dev/null
+++ b/send-pr.conf
@@ -0,0 +1,5 @@
+SUBMITTER=current-users
+TEMPLATE="/etc/gnats/send-pr.template"
+MAILPROG="/usr/lib/sendmail -oi -t"
+MAILADDR="bugs@alpinelinux.org"
+
diff --git a/send-pr.template b/send-pr.template
new file mode 100644
index 0000000..8c246d4
--- /dev/null
+++ b/send-pr.template
@@ -0,0 +1,41 @@
+SEND-PR: -*- send-pr -*-
+SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
+SEND-PR: will all comments (text enclosed in `<' and `>').
+SEND-PR:
+SEND-PR: Please consult the following URL if you are not sure how to
+SEND-PR: fill out a problem report:
+SEND-PR: http://www.alpinelinux.org/mediawiki/index.php/Problem_Report
+SEND-PR:
+SEND-PR: Note that the Synopis field is mandatory..
+SEND-PR:
+SEND-PR: Choose from the following categories:
+SEND-PR:
+SEND-PR: acf base alpine-conf apk-tools aports
+SEND-PR: doc misc test website
+SEND-PR:
+To: bugs@dev.alpinelinux.org
+From: <FROM>
+Reply-To: <REPLYTO>
+X-send-pr-version: 4.1.0
+
+
+>Submitter-Id: <SUBMITTER>
+>Notify-List: <Addresses to notify of significant PR changes (one line)>
+>Originator: <DEFAULT_ORIGINATOR>
+>Organization: <Organisation if any>
+>Synopsis: <One-line summary of the PR (one line)>
+>Confidential: no <Alpine Linux PRs are public data>
+>Severity: <[ critical | serious | non-critical ] (one line)>
+>Priority: <[ high | medium | low ] (one line)>
+>Category: <choose from a category listed above (one line)>
+>Class: <[ sw-bug | doc-bug | change-request ] (one line)>
+>Release: <ALPINE_RELEASE>
+>Environment:
+ System: <SYSTEM>
+
+>Description:
+ <Precise description of the problem (multiple lines)>
+>How-To-Repeat:
+ <Code/input/activities to reproduce the problem (multiple lines)>
+>Fix:
+ <How to correct or work around the problem, if known (multiple lines)>