instg()
{
local arg=$1
- if [ -z "$arg"]; then
+ if [ -z "$arg" ]; then
arg=err
fi
grep --color '^\*\*\*' ${HOME}/install.${arg}
tar ${opts} ${fname}|less
}
-# Used primarily in the build script to update deps.
-find_pkg_deps()
-{
- local arg=$1
-
- [ -z "$arg" ] && arg=$(whoami)
-
- for file in $(forall_direntries_from $arg -type f -executable -readable); do
- (readelf -d $file ; ldd $file ) |
- awk '/NEEDED/ { lib=substr($5,2,length($5)-2); LIBS[lib]=$5 } \
- /.*=>/ {if ( $1 in LIBS ) LIBS[$1]=$3 } END \
- { for (lib in LIBS) print LIBS[lib] }' |
- xargs stat --printf "%U:%G\n"
- done|sort -u|tr -s '\n' ' '
-}
-
## Check if there is a newer build script, maybe update.
# NOTE: Updating needs SXEmacs. It'll work in XEmacs and Emacs too,
# but you'll need to change build-update() accordingly.
{
if [ -x $(type -p sxemacs) ]; then
sxemacs -l /etc/pkgusr/bld-update.el
+ else
+ echo *** Sorry, you do not have SXEmacs installed.
+ echo *** Copying the new build script to ~/build-$(date +%Y%m%d)
+ cp -v /etc/pkgusr/skel-package/build \
+ ${HOME}/build-$(date +%Y%m%d)
fi
}
## Version info.
ourname=${0##*/}
-VERSION=1.4
+VERSION=1.5
COPYRIGHT="Copyright (C) 2007 - 2014 Steve Youngs <steve@steveyoungs.com>"
version_str="${ourname}: ${VERSION}\n${COPYRIGHT}"
update_commands()
{ :
- sed -i s/"\(Last_Updated: \).*$"/"\1$(date +%c)"/g ${HOME}/.project
- sed -i s/"\(Deps: \).*$"/"\1$(find_pkg_deps)"/ ${HOME}/.project
- awk '/^CONTENTS:/ { print; exit; } {print}' ${HOME}/.project > ${HOME}/.projtmp
- echo "--------" >> ${HOME}/.projtmp
- list_package $(whoami) >> ${HOME}/.projtmp
- mv ${HOME}/.projtmp ${HOME}/.project
+ update-pkg-project $(whoami)
}
run_configure()
;; Author: Steve Youngs <steve@sxemacs.org>
;; Maintainer: Steve Youngs <steve@sxemacs.org>
;; Created: <2007-07-13>
-;; Time-stamp: <Sunday Feb 3, 2013 12:17:39 steve>
+;; Time-stamp: <Wednesday Mar 12, 2014 17:01:00 steve>
;; Homepage: N/A
;; Keywords: utils package-management
(defconst pkgusr-url-regexp
(concat
- #r"\(\(https?\|ftp\|gopher\|telnet\|wais\)://\|file:/\|s?news:\|mailto:\)"
+ #r"\(\(https?\|ftp\|rsync\|s\(cp\|sh\)\|git\)://\|file:/\|s?news:\|mailto:\)"
"[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+")
"A regular expression matching URLs.")
done
y[${#y[@]}]=')'
+# The uninstall_package script sets this to `-ignore_readdir_race' so
+# that find doesn't print errors when things it is searching for
+# disappear.
+# IGNORE_READDIR_RACE='-ignore_readdir_race'
+IGNORE_READDIR_RACE=
+
# In the following find command, the part
# -not ( ( "${y[@]}" -prune ) -or "${y[@]}" )
# is responsible for preventing the files that match prune_prefixes from
# -prune has no effect and is always false when -depth is used.
# The -true before "$@" ensures that -depth can be passed as only parameter.
-find "${fs_to_scan[@]}" -xdev $NOLEAF \
+find "${fs_to_scan[@]}" -xdev $NOLEAF $IGNORE_READDIR_RACE \
-not \( \( "${y[@]}" -prune \) -or "${y[@]}" \) \
-and \( "${ugmatcher[@]}" \) -and \( -true "$@" \)
run()
{
# Delete anything that isn't a directory
- forall_direntries_from ${pkg} -ignore_readdir_race \
+ forall_direntries_from ${pkg} \
-not -type d -exec rm -vf {} 2>>/tmp/${pkg}.err \;
# Remove any empty directories, but ONLY empty directories
- forall_direntries_from ${pkg} -ignore_readdir_race \
+ forall_direntries_from ${pkg} \
-type d -empty -exec rmdir -v {} 2>>/tmp/${pkg}.err \;
leftovers=$(forall_direntries_from ${pkg})
}
case $1 in
- now) run ;;
+ now) IGNORE_READDIR_RACE='-ignore_readdir_race'; run ;;
-h|--help|--usage|help|usage) usage ;;
*) dry_run|less ;;
esac