Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in64
-rw-r--r--scripts/repo-add.sh.in10
2 files changed, 50 insertions, 24 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d1cf175e..391e1752 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -518,7 +518,8 @@ download_sources() {
local file=$(get_filepath "$netfile" || true)
if [[ -n "$file" ]]; then
msg2 "$(gettext "Found %s")" "${file##*/}"
- ln -sf "$file" "$srcdir/"
+ rm -f "$srcdir/$file"
+ ln -s "$file" "$srcdir/"
continue
fi
@@ -878,8 +879,8 @@ tidy_install() {
# update symlinks to this manpage
find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null |
while read link ; do
- rm -f "$link"
- ln -sf "${file}.gz" "${link}.gz"
+ rm -f "$link" "${link}.gz"
+ ln -s "${file}.gz" "${link}.gz"
done
# check file still exists (potentially already compressed due to hardlink)
@@ -1187,9 +1188,13 @@ create_package() {
create_signature "$pkg_file"
if (( ! ret )) && [[ ! "$PKGDEST" -ef "${startdir}" ]]; then
- ln -sf "${pkg_file}" "${pkg_file/$PKGDEST/$startdir}"
+ rm -f "${pkg_file/$PKGDEST/$startdir}"
+ ln -s "${pkg_file}" "${pkg_file/$PKGDEST/$startdir}"
ret=$?
- [[ -f $pkg_file.sig ]] && ln -sf "$pkg_file.sig" "${pkg_file/$PKGDEST/$startdir}.sig"
+ if [[ -f $pkg_file.sig ]]; then
+ rm -f "${pkg_file/$PKGDEST/$startdir}.sig"
+ ln -s "$pkg_file.sig" "${pkg_file/$PKGDEST/$startdir}.sig"
+ fi
fi
if (( ret )); then
@@ -1276,7 +1281,8 @@ create_srcpackage() {
fi
if (( ! ret )) && [[ ! "$SRCPKGDEST" -ef "${startdir}" ]]; then
- ln -sf "${pkg_file}" "${pkg_file/$SRCPKGDEST/$startdir}"
+ rm -f "${pkg_file/$SRCPKGDEST/$startdir}"
+ ln -s "${pkg_file}" "${pkg_file/$SRCPKGDEST/$startdir}"
ret=$?
fi
@@ -1449,6 +1455,13 @@ check_software() {
# check for needed software
local ret=0
+ # check for sudo if we will need it during makepkg execution
+ if (( ! ( ASROOT || INFAKEROOT ) && ( DEP_BIN || RMDEPS || INSTALL ) )); then
+ if ! type -p sudo >/dev/null; then
+ warning "$(gettext "Sudo can not be found. Will use su to acquire root privileges.")"
+ fi
+ fi
+
# fakeroot - building as non-root user
if [[ $(check_buildenv fakeroot) = "y" ]] && (( EUID > 0 )); then
if ! type -p fakeroot >/dev/null; then
@@ -1531,30 +1544,48 @@ devel_check() {
# This will only be used on the first call to makepkg; subsequent
# calls to makepkg via fakeroot will explicitly pass the version
# number to avoid having to determine the version number twice.
- # Also do a brief check to make sure we have the VCS tool available.
+ # Also do a check to make sure we have the VCS tool available.
oldpkgver=$pkgver
if [[ -n ${_darcstrunk} && -n ${_darcsmod} ]] ; then
- type -p darcs >/dev/null || return 0
+ if ! type -p darcs >/dev/null; then
+ warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "darcs" "darcs"
+ return 0
+ fi
msg "$(gettext "Determining latest %s revision...")" 'darcs'
newpkgver=$(date +%Y%m%d)
elif [[ -n ${_cvsroot} && -n ${_cvsmod} ]] ; then
- type -p cvs >/dev/null || return 0
+ if ! type -p cvs >/dev/null; then
+ warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "cvs" "cvs"
+ return 0
+ fi
msg "$(gettext "Determining latest %s revision...")" 'cvs'
newpkgver=$(date +%Y%m%d)
elif [[ -n ${_gitroot} && -n ${_gitname} ]] ; then
- type -p git >/dev/null || return 0
+ if ! type -p git >/dev/null; then
+ warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "git "git"
+ return 0
+ fi
msg "$(gettext "Determining latest %s revision...")" 'git'
newpkgver=$(date +%Y%m%d)
elif [[ -n ${_svntrunk} && -n ${_svnmod} ]] ; then
- type -p svn >/dev/null || return 0
+ if ! type -p svn >/dev/null; then
+ warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "svn" "svn"
+ return 0
+ fi
msg "$(gettext "Determining latest %s revision...")" 'svn'
newpkgver=$(LC_ALL=C svn info $_svntrunk | sed -n 's/^Last Changed Rev: \([0-9]*\)$/\1/p')
elif [[ -n ${_bzrtrunk} && -n ${_bzrmod} ]] ; then
- type -p bzr >/dev/null || return 0
+ if ! type -p bzr >/dev/null; then
+ warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "bzr" bzr"
+ return 0
+ fi
msg "$(gettext "Determining latest %s revision...")" 'bzr'
newpkgver=$(bzr revno ${_bzrtrunk})
elif [[ -n ${_hgroot} && -n ${_hgrepo} ]] ; then
- type -p hg >/dev/null || return 0
+ if ! type -p hg >/dev/null; then
+ warning "$(gettext "Cannot find the %s binary required to determine latest %s revision.")" "hg" "hg"
+ return 0
+ fi
msg "$(gettext "Determining latest %s revision...")" 'hg'
if [[ -d ./src/$_hgrepo ]] ; then
cd ./src/$_hgrepo
@@ -1898,13 +1929,6 @@ else
fi
fi
-# check for sudo if we will need it during makepkg execution
-if (( ! ( ASROOT || INFAKEROOT ) && ( DEP_BIN || RMDEPS || INSTALL ) )); then
- if ! type -p sudo >/dev/null; then
- warning "$(gettext "Sudo can not be found. Will use su to acquire root privileges.")"
- fi
-fi
-
unset pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides
unset md5sums replaces depends conflicts backup source install changelog build
unset makedepends optdepends options noextract
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 1d78c472..81c54b81 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -641,12 +641,14 @@ if (( success )); then
[[ -f $tmpdir/$filename.sig ]] && mv "$tmpdir/$filename.sig" "$REPO_DB_FILE.sig"
dblink="${REPO_DB_FILE%.tar*}"
target=${REPO_DB_FILE##*/}
- ln -sf "$target" "$dblink" 2>/dev/null || \
- ln -f "$target" "$dblink" 2>/dev/null || \
+ rm -f "$dblink"
+ ln -s "$target" "$dblink" 2>/dev/null || \
+ ln "$target" "$dblink" 2>/dev/null || \
cp "$REPO_DB_FILE" "$dblink"
if [[ -f "$target.sig" ]]; then
- ln -sf "$target.sig" "$dblink.sig" 2>/dev/null || \
- ln -f "$target.sig" "$dblink.sig" 2>/dev/null || \
+ rm -f "$dblink.sig"
+ ln -s "$target.sig" "$dblink.sig" 2>/dev/null || \
+ ln "$target.sig" "$dblink.sig" 2>/dev/null || \
cp "$REPO_DB_FILE.sig" "$dblink.sig"
fi
else