# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../qscanq/head_-1.patch
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---

--- ./src/print-cc.sh.orig	2005-11-28 18:30:33.000000000 -0300
+++ ./src/print-cc.sh	2005-11-28 18:32:13.000000000 -0300
@@ -1,4 +1,4 @@
-cc="`head -1 conf-cc`"
+cc="`head -n 1 conf-cc`"
 systype="`cat systype`"
 
 
--- ./src/Makefile.orig	2005-11-28 18:26:22.000000000 -0300
+++ ./src/Makefile	2005-11-28 18:28:46.000000000 -0300
@@ -34,34 +34,34 @@
 	wait_pid.o
 
 auto_ageout.h: conf-ageout
-	echo "#define MAX_AGE" "`head -1 < conf-ageout`" > auto_ageout.h.tmp && \
+	echo "#define MAX_AGE" "`head -n 1 < conf-ageout`" > auto_ageout.h.tmp && \
 	mv auto_ageout.h.tmp auto_ageout.h
 
 auto_antivir_cmd.c: auto-strarr conf-antivir-cmd
-	./auto-strarr auto_antivir_cmd `head -1 conf-antivir-cmd` > \
+	./auto-strarr auto_antivir_cmd `head -n 1 conf-antivir-cmd` > \
 	auto_antivir_cmd.c.tmp && mv auto_antivir_cmd.c.tmp auto_antivir_cmd.c
 
 auto_antivir_cmd.o: compile auto_antivir_cmd.c
 	./compile auto_antivir_cmd.c
 
 auto_cleaner.c: auto-str conf-pkg
-	./auto-str auto_cleaner "`head -1 conf-pkg`"/command/cleanq > \
+	./auto-str auto_cleaner "`head -n 1 conf-pkg`"/command/cleanq > \
 	auto_cleaner.c.tmp
-	./auto-str auto_runcleaner "`head -1 conf-pkg`"/command/run-cleanq >> \
+	./auto-str auto_runcleaner "`head -n 1 conf-pkg`"/command/run-cleanq >> \
 	auto_cleaner.c.tmp && mv auto_cleaner.c.tmp auto_cleaner.c
 
 auto_cleaner.o: compile auto_cleaner.c
 	./compile auto_cleaner.c
 
 auto_cqlog.c: auto-str conf-cqlog
-	./auto-str auto_cqlog "`head -1 conf-cqlog`" > auto_cqlog.c.tmp && mv \
+	./auto-str auto_cqlog "`head -n 1 conf-cqlog`" > auto_cqlog.c.tmp && mv \
 	auto_cqlog.c.tmp auto_cqlog.c
 
 auto_cqlog.o: compile auto_cqlog.c
 	./compile auto_cqlog.c
 
 auto_cqpause.c: auto-str conf-cqpause
-	./auto-str auto_cqpause "`head -1 conf-cqpause`" > auto_cqpause.c.tmp && \
+	./auto-str auto_cqpause "`head -n 1 conf-cqpause`" > auto_cqpause.c.tmp && \
 	mv auto_cqpause.c.tmp auto_cqpause.c
 
 auto_cqpause.o: compile auto_cqpause.c
@@ -84,8 +84,8 @@
 	./compile auto-gid.c
 
 auto_gids.c: auto-gid auto-str conf-groups
-	./auto-gid auto_ctlgid "`head -1 conf-groups`" >> auto_gids.c.tmp
-	./auto-str auto_ctlgroup "`head -1 conf-groups`" >> auto_gids.c.tmp && \
+	./auto-gid auto_ctlgid "`head -n 1 conf-groups`" >> auto_gids.c.tmp
+	./auto-str auto_ctlgroup "`head -n 1 conf-groups`" >> auto_gids.c.tmp && \
 	mv auto_gids.c.tmp auto_gids.c
 
 auto_gids.o: compile auto_gids.c
@@ -101,25 +101,25 @@
 	./compile auto-pidt.c
 
 auto_pkg.c: auto-str conf-pkg
-	./auto-str auto_pkg "`head -1 conf-pkg`" > auto_pkg.c.tmp && mv \
+	./auto-str auto_pkg "`head -n 1 conf-pkg`" > auto_pkg.c.tmp && mv \
 	auto_pkg.c.tmp auto_pkg.c
 
 auto_pkg.o: compile auto_pkg.c
 	./compile auto_pkg.c
 
 auto_qmailbin.c: auto-str conf-qmail
-	./auto-str auto_qmailbin "`head -1 conf-qmail`"/bin > \
+	./auto-str auto_qmailbin "`head -n 1 conf-qmail`"/bin > \
 	auto_qmailbin.c.tmp && mv auto_qmailbin.c.tmp auto_qmailbin.c
 
 auto_qmailbin.o: compile auto_qmailbin.c
 	./compile auto_qmailbin.c
 
 auto_qmailq.c: auto-strarr conf-qmailq
-	./auto-strarr auto_qmailq "`head -1 conf-qmailq`"/qmail-queue > \
+	./auto-strarr auto_qmailq "`head -n 1 conf-qmailq`"/qmail-queue > \
 	auto_qmailq.c.tmp && mv auto_qmailq.c.tmp auto_qmailq.c
 
 auto_qmailq_destdir.c: auto-str conf-qmailq
-	./auto-str auto_qmailq_destdir "`head -1 conf-qmailq`" > \
+	./auto-str auto_qmailq_destdir "`head -n 1 conf-qmailq`" > \
 	auto_qmailq_destdir.c.tmp && mv auto_qmailq_destdir.c.tmp \
 	auto_qmailq_destdir.c
 
@@ -130,7 +130,7 @@
 	./compile auto_qmailq.c
 
 auto_qmailq_oldpath.c: auto-str conf-qmail
-	./auto-str auto_qmailq_oldpath "`head -1 conf-qmail`"/bin/qmail-queue > \
+	./auto-str auto_qmailq_oldpath "`head -n 1 conf-qmail`"/bin/qmail-queue > \
 	auto_qmailq_oldpath.c.tmp && mv auto_qmailq_oldpath.c.tmp \
 	auto_qmailq_oldpath.c
 
@@ -138,57 +138,57 @@
 	./compile auto_qmailq_oldpath.c
 
 auto_qscanq.c: auto-str conf-pkg
-	./auto-str auto_qscanq "`head -1 conf-pkg`"/command/qscanq > \
+	./auto-str auto_qscanq "`head -n 1 conf-pkg`"/command/qscanq > \
 	auto_qscanq.c.tmp && mv auto_qscanq.c.tmp auto_qscanq.c
 
 auto_qscanq.o: compile auto_qscanq.c
 	./compile auto_qscanq.c
 
 auto_qstdin.c: auto-strarr conf-pkg
-	./auto-strarr auto_qstdin "`head -1 conf-pkg`"/command/qscanq-stdin > \
+	./auto-strarr auto_qstdin "`head -n 1 conf-pkg`"/command/qscanq-stdin > \
 	auto_qstdin.c.tmp && mv auto_qstdin.c.tmp auto_qstdin.c
 
 auto_qstdin.o: compile auto_qstdin.c
 	./compile auto_qstdin.c
 
 auto_retries.h: conf-retries
-	echo "#define MAX_RETRIES" "`head -1 < conf-retries`" > \
+	echo "#define MAX_RETRIES" "`head -n 1 < conf-retries`" > \
 	auto_retries.h.tmp && mv auto_retries.h.tmp auto_retries.h
 
 auto_ripmime_cmd.c: auto-strarr conf-ripmime-cmd
-	./auto-strarr auto_ripmime_cmd `head -1 conf-ripmime-cmd` > \
+	./auto-strarr auto_ripmime_cmd `head -n 1 conf-ripmime-cmd` > \
 	auto_ripmime_cmd.c.tmp && mv auto_ripmime_cmd.c.tmp auto_ripmime_cmd.c
 
 auto_ripmime_cmd.o: compile auto_ripmime_cmd.c
 	./compile auto_ripmime_cmd.c
 
 auto_rmcmd.c: auto-strarr conf-rm
-	./auto-strarr auto_rmcmd `head -1 conf-rm` > auto_rmcmd.c.tmp && mv \
+	./auto-strarr auto_rmcmd `head -n 1 conf-rm` > auto_rmcmd.c.tmp && mv \
 	auto_rmcmd.c.tmp auto_rmcmd.c
 
 auto_rmcmd.o: compile auto_rmcmd.c
 	./compile auto_rmcmd.c
 
 auto_scancmd.c: auto-strarr conf-scancmd
-	./auto-strarr auto_scancmd `head -1 conf-scancmd` > auto_scancmd.c.tmp \
+	./auto-strarr auto_scancmd `head -n 1 conf-scancmd` > auto_scancmd.c.tmp \
 	&& mv auto_scancmd.c.tmp auto_scancmd.c
 
 auto_scancmd.o: compile auto_scancmd.c
 	./compile auto_scancmd.c
 
 auto_scanq.c: auto-str conf-spool
-	./auto-str auto_scanq "`head -1 conf-spool`" > auto_scanq.c.tmp && mv \
+	./auto-str auto_scanq "`head -n 1 conf-spool`" > auto_scanq.c.tmp && mv \
 	auto_scanq.c.tmp auto_scanq.c
 
 auto_scanq.o: compile auto_scanq.c
 	./compile auto_scanq.c
 
 auto_scan_stdin.h: conf-scan-stdin
-	echo "#define SCAN_STDIN" "`head -1 < conf-scan-stdin`" > \
+	echo "#define SCAN_STDIN" "`head -n 1 < conf-scan-stdin`" > \
 	auto_scan_stdin.h.tmp && mv auto_scan_stdin.h.tmp auto_scan_stdin.h
 
 auto_spool.c: auto-str conf-spool
-	./auto-str auto_spool "`head -1 conf-spool`"/root/scanq > \
+	./auto-str auto_spool "`head -n 1 conf-spool`"/root/scanq > \
 	auto_spool.c.tmp && mv auto_spool.c.tmp auto_spool.c
 
 auto_spool.o: compile auto_spool.c
@@ -207,7 +207,7 @@
 	./compile auto-str.c
 
 auto_svc.c: auto-str conf-svc
-	./auto-str auto_svc "`head -1 conf-svc`" > auto_svc.c.tmp && mv \
+	./auto-str auto_svc "`head -n 1 conf-svc`" > auto_svc.c.tmp && mv \
 	auto_svc.c.tmp auto_svc.c
 
 auto_svc.o: compile auto_svc.c
@@ -220,11 +220,11 @@
 	./compile auto-uid.c
 
 auto_uids.c: auto-uid conf-users
-	./auto-str auto_user "`head -1 conf-users`" > auto_uids.c.tmp
-	./auto-str auto_loguser "`head -2 conf-users|tail -1`" >> \
+	./auto-str auto_user "`head -n 1 conf-users`" > auto_uids.c.tmp
+	./auto-str auto_loguser "`head -n 2 conf-users|tail -n 1`" >> \
 	auto_uids.c.tmp
-	./auto-uid auto_uid "`head -1 conf-users`" >> auto_uids.c.tmp
-	./auto-uid auto_loguid "`head -2 conf-users|tail -1`" >> auto_uids.c.tmp \
+	./auto-uid auto_uid "`head -n 1 conf-users`" >> auto_uids.c.tmp
+	./auto-uid auto_loguid "`head -n 2 conf-users|tail -n 1`" >> auto_uids.c.tmp \
 	&& mv auto_uids.c.tmp auto_uids.c
 
 auto_uids.o: compile auto_uids.c
@@ -272,7 +272,7 @@
 choose: home warn-auto.sh choose.sh
 	rm -f choose
 	cat warn-auto.sh choose.sh \
-	| sed s}HOME}"`head -1 home`"}g \
+	| sed s}HOME}"`head -n 1 home`"}g \
 	> choose
 	chmod 755 choose
 
--- ./src/rts.tests.orig	2005-11-28 18:30:54.000000000 -0300
+++ ./src/rts.tests	2005-11-28 18:32:31.000000000 -0300
@@ -8,7 +8,7 @@
 mkdir rts-tmp
 cd rts-tmp
 
-U="`head -1 ../conf-users`"
+U="`head -n 1 ../conf-users`"
 echo -n 'Running run-cleanq as' "$U"...
 setuidgid "$U" run-cleanq >2.err 2>&1
 if test $? -eq 0; then echo PASS; elif test $? -eq 1; then echo "FAIL: error";
--- ./src/print-ld.sh.orig	2005-11-28 18:30:41.000000000 -0300
+++ ./src/print-ld.sh	2005-11-28 18:32:19.000000000 -0300
@@ -1,4 +1,4 @@
-ld="`head -1 conf-ld`"
+ld="`head -n 1 conf-ld`"
 systype="`cat systype`"
 
 cat warn-auto.sh
--- ./package/compile.orig	2005-11-28 18:31:04.000000000 -0300
+++ ./package/compile	2005-11-28 18:32:47.000000000 -0300
@@ -7,7 +7,7 @@
 here=`env - PATH=$PATH pwd`
 
 # Verify that the scanner is selected
-if head -1 src/conf-scancmd|egrep "SCANNER HERE" >/dev/null
+if head -n 1 src/conf-scancmd|egrep "SCANNER HERE" >/dev/null
 then echo 'Edit src/conf-scancmd and try again.'; exit 1; fi
 
 # Create a place to do the build
--- ./package/run.orig	2005-11-28 18:30:59.000000000 -0300
+++ ./package/run	2005-11-28 18:32:41.000000000 -0300
@@ -17,8 +17,8 @@
 fi
 
 CT="`which crontab`"
-U="`head -1 ./src/conf-users`"
-S="`head -1 ./src/conf-spool`"
+U="`head -n 1 ./src/conf-users`"
+S="`head -n 1 ./src/conf-spool`"
 if setuidgid "$U" "$CT" "$S"/root/crontab
 then
   echo 'OK: Installed crontab for' "$U"