misc/183117: New port: misc/flag - Produce a colourful flag from the machine hostname
CyberLeo
cyberleo at cyberleo.net
Sun Oct 20 08:10:00 UTC 2013
>Number: 183117
>Category: misc
>Synopsis: New port: misc/flag - Produce a colourful flag from the machine hostname
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Oct 20 08:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: CyberLeo
>Release:
>Organization:
CyberLeo.Net
>Environment:
>Description:
>How-To-Repeat:
>Fix:
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.13.5).
# To extract the files from this archive, save it to some FILE, remove
# everything before the '#!/bin/sh' line above, then type 'sh FILE'.
#
lock_dir=_sh02250
# Made on 2013-10-20 03:03 CDT by <cyberleo at arba>.
# Source directory was '/home/cyberleo/scm/git/cdn-ports-overlay/cdn/ports/misc-cdn'.
#
# Existing files will *not* be overwritten, unless '-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 848 -rw-r--r-- flag/Makefile
# 120 -rw-r--r-- flag/distinfo
# 351 -rw-r--r-- flag/pkg-descr
#
MD5SUM=${MD5SUM-md5sum}
f=`${MD5SUM} --version | egrep '^md5sum .*(core|text)utils'`
test -n "${f}" && md5check=true || md5check=false
${md5check} || \
echo 'Note: not verifying md5sums. Consider installing GNU coreutils.'
if test "X$1" = "X-c"
then keep_file=''
else keep_file=true
fi
echo=echo
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=
locale_dir=
set_echo=false
for dir in $PATH
do
if test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
case `$dir/gettext --version 2>&1 | sed 1q` in
*GNU*) gettext_dir=$dir
set_echo=true
break ;;
esac
fi
done
if ${set_echo}
then
set_echo=false
for dir in $PATH
do
if test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
set_echo=true
break
fi
done
if ${set_echo}
then
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
fi
IFS="$save_IFS"
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null
then if (echo -n test; echo 1,2,3) | grep n >/dev/null
then shar_n= shar_c='
'
else shar_n=-n shar_c= ; fi
else shar_n= shar_c='\c' ; fi
f=shar-touch.$$
st1=200112312359.59
st2=123123592001.59
st2tr=123123592001.5 # old SysV 14-char limit
st3=1231235901
if touch -am -t ${st1} ${f} >/dev/null 2>&1 && \
test ! -f ${st1} && test -f ${f}; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am ${st2} ${f} >/dev/null 2>&1 && \
test ! -f ${st2} && test ! -f ${st2tr} && test -f ${f}; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am ${st3} ${f} >/dev/null 2>&1 && \
test ! -f ${st3} && test -f ${f}; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
${echo} 'WARNING: not restoring timestamps. Consider getting and
installing GNU '\''touch'\'', distributed in GNU coreutils...'
echo
fi
rm -f ${st1} ${st2} ${st2tr} ${st3} ${f}
#
if test ! -d ${lock_dir} ; then :
else ${echo} "lock directory ${lock_dir} exists"
exit 1
fi
if mkdir ${lock_dir}
then ${echo} "x - created lock directory ${lock_dir}."
else ${echo} "x - failed to create lock directory ${lock_dir}."
exit 1
fi
# ============= flag/Makefile ==============
if test ! -d 'flag'; then
mkdir 'flag'
if test $? -eq 0
then ${echo} "x - created directory flag."
else ${echo} "x - failed to create directory flag."
exit 1
fi
fi
if test -n "${keep_file}" && test -f 'flag/Makefile'
then
${echo} "x - SKIPPING flag/Makefile (file already exists)"
else
${echo} "x - extracting flag/Makefile (text)"
sed 's/^X//' << 'SHAR_EOF' > 'flag/Makefile' &&
# $FreeBSD$
X
PORTNAME= flag
PORTVERSION= 1.0.4
CATEGORIES= misc
MASTER_SITES= http://git.cyberleo.net/releases/${PORTNAME}/
EXTRACT_SUFX= .tgz
X
MAINTAINER= cyberleo at cyberleo.net
COMMENT= Turn the hostname into a colourful and visually distinctive ansi flag
X
NO_BUILD= yes
X
OPTIONS_DEFINE= BASH
BASH_DESC= Install include for Bash prompt
OPTIONS_DEFAULT=BASH
X
PLIST_FILES= bin/flag etc/rc.d/update-issue
X
X.include <bsd.port.options.mk>
X
X.if ${PORT_OPTIONS:MBASH}
PLIST_FILES+= share/flag/bash_prompt.sh
PLIST_DIRS+= share/flag
X.endif
X
do-install:
X ${INSTALL_SCRIPT} ${WRKSRC}/flag ${STAGEDIR}${PREFIX}/bin/flag
X ${INSTALL_SCRIPT} ${WRKSRC}/update-issue ${STAGEDIR}${PREFIX}/etc/rc.d/update-issue
X.if ${PORT_OPTIONS:MBASH}
X ${MKDIR} ${STAGEDIR}${DATADIR}
X ${INSTALL_DATA} ${WRKSRC}/bash_prompt.sh ${STAGEDIR}${DATADIR}
X.endif
X
X.include <bsd.port.mk>
SHAR_EOF
(set 20 13 10 20 03 01 19 'flag/Makefile'
eval "${shar_touch}") && \
chmod 0644 'flag/Makefile'
if test $? -ne 0
then ${echo} "restore of flag/Makefile failed"
fi
if ${md5check}
then (
${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'flag/Makefile': 'MD5 check failed'
) << \SHAR_EOF
08b94579a975bb078f21d65f93f618be flag/Makefile
SHAR_EOF
else
test `LC_ALL=C wc -c < 'flag/Makefile'` -ne 848 && \
${echo} "restoration warning: size of 'flag/Makefile' is not 848"
fi
fi
# ============= flag/distinfo ==============
if test ! -d 'flag'; then
mkdir 'flag'
if test $? -eq 0
then ${echo} "x - created directory flag."
else ${echo} "x - failed to create directory flag."
exit 1
fi
fi
if test -n "${keep_file}" && test -f 'flag/distinfo'
then
${echo} "x - SKIPPING flag/distinfo (file already exists)"
else
${echo} "x - extracting flag/distinfo (text)"
sed 's/^X//' << 'SHAR_EOF' > 'flag/distinfo' &&
SHA256 (flag-1.0.4.tgz) = a37665575ebceefd04279d1b6b9cf917b8f912961362adb5e6e9c0b5a78dcec5
SIZE (flag-1.0.4.tgz) = 5713
SHAR_EOF
(set 20 13 10 20 03 02 07 'flag/distinfo'
eval "${shar_touch}") && \
chmod 0644 'flag/distinfo'
if test $? -ne 0
then ${echo} "restore of flag/distinfo failed"
fi
if ${md5check}
then (
${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'flag/distinfo': 'MD5 check failed'
) << \SHAR_EOF
78124a2eaccd0d3d9c328fb4b44bca20 flag/distinfo
SHAR_EOF
else
test `LC_ALL=C wc -c < 'flag/distinfo'` -ne 120 && \
${echo} "restoration warning: size of 'flag/distinfo' is not 120"
fi
fi
# ============= flag/pkg-descr ==============
if test -n "${keep_file}" && test -f 'flag/pkg-descr'
then
${echo} "x - SKIPPING flag/pkg-descr (file already exists)"
else
${echo} "x - extracting flag/pkg-descr (text)"
sed 's/^X//' << 'SHAR_EOF' > 'flag/pkg-descr' &&
flag
X
Produces a neat little ansi colour 'flag' based off a hash of the machine's
hostname (or settable via ~/.flag or /etc/flag) which can uniquely visually
identify a machine, at a glance. Useful for placing into /etc/issue or your
bash prompt, so that you don't send stupid commands to the wrong machine.
X
WWW: http://git.cyberleo.net/CDN/flag.git
SHAR_EOF
(set 20 13 10 20 02 49 30 'flag/pkg-descr'
eval "${shar_touch}") && \
chmod 0644 'flag/pkg-descr'
if test $? -ne 0
then ${echo} "restore of flag/pkg-descr failed"
fi
if ${md5check}
then (
${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'flag/pkg-descr': 'MD5 check failed'
) << \SHAR_EOF
04dd5feeffa4b9f7423203f880acb74f flag/pkg-descr
SHAR_EOF
else
test `LC_ALL=C wc -c < 'flag/pkg-descr'` -ne 351 && \
${echo} "restoration warning: size of 'flag/pkg-descr' is not 351"
fi
fi
if rm -fr ${lock_dir}
then ${echo} "x - removed lock directory ${lock_dir}."
else ${echo} "x - failed to remove lock directory ${lock_dir}."
exit 1
fi
exit 0
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list