2 # Copyright (C) 2007 Steve Youngs <steve@sxemacs.org>
4 # What lies here is a collection of handy bash shell functions that
5 # make life a little easier for pkgusr.
10 ls -l ${HOME}/*.{err,log}
27 if [ -z "$arg" ]; then
32 conf) less ${HOME}/configure.err ;;
33 install) less ${HOME}/install.err ;;
34 check) less ${HOME}/check.err ;;
35 make) less ${HOME}/make.err ;;
36 upd) less ${HOME}/upd.err ;;
37 ver) less ${HOME}/verupd.err ;;
38 all) less ${HOME}/*.err ;;
46 if [ -z "$arg" ]; then
51 conf) less ${HOME}/configure.log ;;
52 install) less ${HOME}/install.log ;;
53 check) less ${HOME}/check.log ;;
54 make) less ${HOME}/make.log ;;
55 upd) less ${HOME}/upd.log ;;
56 ver) less ${HOME}/verupd.log ;;
57 all) less ${HOME}/*.log ;;
65 if [ -z "$arg" ]; then
70 conf) less ${HOME}/configure.{err,log} ;;
71 install) less ${HOME}/install.{err,log} ;;
72 check) less ${HOME}/check.{err,log} ;;
73 make) less ${HOME}/make.{err,log} ;;
74 upd) less ${HOME}/upd.{err,log} ;;
75 ver) less ${HOME}/verupd.{err,log} ;;
76 all) less ${HOME}/*.{err,log} ;;
82 for log in configure make check install upd verupd; do
83 [[ -f ${HOME}/${log}.err ]] && rm -v ${HOME}/${log}.err
84 [[ -f ${HOME}/${log}.log ]] && rm -v ${HOME}/${log}.log
91 sed -i "s|\(Version: \).*$|\1${arg}|" ${HOME}/.project
92 echo -n "Version updated... "
93 grep --colour Version:.*$ ${HOME}/.project
98 local top=$(pinky -l $(whoami)|grep -n "^Install Notes:$"|cut -d: -f1)
99 local bot=$(pinky -l $(whoami)|grep -n "^General Notes:$"|cut -d: -f1)
101 pinky -l $(whoami)|sed -n ${top},${bot}p
106 local top=$(pinky -l $(whoami)|grep -n "^General Notes:$"|cut -d: -f1)
107 local bot=$(pinky -l $(whoami)|grep -n "^CONTENTS:$"|cut -d: -f1)
109 pinky -l $(whoami)|sed -n ${top},${bot}p
114 pinky -l $(whoami)|less
119 pinky -l $(whoami)|grep --colour Repo_Location:.*$
124 srepo|awk '{print $2;}'|tr -d '<>'
129 pinky -l $(whoami)|grep --colour Repo_Type:.*$
134 pinky -l $(whoami)|grep --colour Web_Site:.*$
139 web|awk '{print $2;}'|tr -d '<>'
148 if [ -z "${fname}" ]; then
149 echo No filename specified >&2
153 type=$(file ${fname}|cut -d' ' -f2)
162 if lzmainfo ${fname} &>/dev/null; then
165 printf "Unknown file type: %s\n" $type >&2
180 if [ -z "${fname}" ]; then
181 echo No filename specified >&2
185 type=$(file ${fname}|cut -d' ' -f2)
190 bzip2) opts=jtvvvf ;;
191 xz|XZ) opts=Jtvvvf ;;
193 # lzma. Here because lzmainfo is too stupid
194 if lzmainfo ${fname} &>/dev/null; then
197 printf "Unknown file type: %s\n" $type >&2
203 tar ${opts} ${fname}|less
208 nano -w ${HOME}/build
213 nano -w ${HOME}/.project
218 nano -w ${HOME}/{build,.project}
225 alogs List of build logs (showing size)
226 lerr List just the error logs
227 llog List just the .log logs
228 verr [LOG] Display LOG, which can be:
229 \`conf' -- configure.err
230 \`check' -- check.err
231 \`install' -- install.err
235 \`all' -- all error logs (default)
236 vlog [LOG] Same as for \`verr', but for the .log files.
237 verrlog [LOG] Same as for \`verr', but displays both the .err,
239 dlog Removes all build logs
241 Updates the version in the .project. It MUST be
242 quoted to protect it from shell expansion.
243 showinst Displays the \`Install Notes'.
244 showgen Displays the \`General Notes'.
245 listp Displays the entire package info (piped through less(1))
246 srepo Display the package's source repo location.
247 rawrepo Output just the repo URL (to use with lynx, curl, etc)
248 trepo Display the type of repo (tla, git, svn, mercurial etc)
249 web Display the package's homepage URL.
250 rawweb Output just the web URL (to use with lynx etc)
251 xtar [TARBALL] Extract TARBALL, automatically choosing the appropriate
253 vtar [TARBALL] List the contents of TARBALL, automatically choosing
254 appropriate options and piping through less(1).
255 ebld Edit the build script.
256 epro Edit the .project file.
257 ebp Edit the build script and the .project file.