Unverified Commit 0cf2ac49 authored by Luke Shumaker's avatar Luke Shumaker Committed by Eli Schwartz
Browse files

Consistently use "$(dirname "$(readlink -e "$0")")"

This does correct handling of
 - executing a program by symlink
 - any weird characters in the full path
 - I'm sure there's another case I thought about when I originally did
   this.
parent 5b4b19cd
#!/bin/bash
. "$(dirname "$0")/../config"
. "$(dirname "$0")/../db-functions"
. "$(dirname "$(readlink -e "$0")")/../config"
. "$(dirname "$(readlink -e "$0")")/../db-functions"
clean_pkg() {
local pkg
......
#!/bin/bash
dirname="$(dirname "$0")"
dirname="$(dirname "$(readlink -e "$0")")"
. "${dirname}/../config"
. "${dirname}/../db-functions"
......
#!/bin/bash
. "$(dirname "$0")/../config"
. "$(dirname "$0")/../db-functions"
. "$(dirname "$(readlink -e "$0")")/../config"
. "$(dirname "$(readlink -e "$0")")/../db-functions"
# setup paths
SPATH="/srv/http/archweb"
......
#!/bin/bash
. "$(dirname "$0")/config"
. "$(dirname "$0")/db-functions"
. "$(dirname "$(readlink -e "$0")")/config"
. "$(dirname "$(readlink -e "$0")")/db-functions"
if (( $# < 3 )); then
msg "usage: %s <repo-from> <repo-to> <pkgname|pkgbase> ..." "${0##*/}"
......
#!/bin/bash
. "$(dirname "$0")/config"
. "$(dirname "$0")/db-functions"
. "$(dirname "$(readlink -e "$0")")/config"
. "$(dirname "$(readlink -e "$0")")/db-functions"
if (( $# < 3 )); then
msg "usage: %s <repo> <arch> <pkgname|pkgbase> ..." "${0##*/}"
......
#!/bin/bash
. "$(dirname "$0")/config"
. "$(dirname "$0")/db-functions"
. "$(dirname "$(readlink -e "$0")")/config"
. "$(dirname "$(readlink -e "$0")")/db-functions"
if (( $# < 3 )); then
msg "usage: %s <repo> <arch> <pkgfile> ..." "${0##*/}"
......
#!/bin/bash
. "$(dirname "$0")/config"
. "$(dirname "$0")/db-functions"
. "$(dirname "$(readlink -e "$0")")/config"
. "$(dirname "$(readlink -e "$0")")/db-functions"
if (( $# < 3 )); then
msg "usage: %s <repo> <arch> <pkgname> ..." "${0##*/}"
......
#!/bin/bash
. "$(dirname "$0")/config"
. "$(dirname "$0")/db-functions"
. "$(dirname "$(readlink -e "$0")")/config"
. "$(dirname "$(readlink -e "$0")")/db-functions"
if (( $# >= 1 )); then
warning "Calling %s with a specific repository is no longer supported" "${0##*/}"
......
#!/bin/bash
. "$(dirname "$0")/config"
. "$(dirname "$0")/db-functions"
. "$(dirname "$(readlink -e "$0")")/config"
. "$(dirname "$(readlink -e "$0")")/db-functions"
if (( $# < 1 )); then
msg "usage: %s <pkgname|pkgbase> ..." "${0##*/}"
......@@ -54,7 +54,7 @@ for repo in "${STABLE_REPOS[@]}"; do
repo_unlock "${repo}" "${pkgarch}"
done
if [[ -n ${pkgs[${repo}]} ]]; then
"$(dirname "$0")/db-move" "${TESTING_REPO}" "${repo}" ${pkgs[${repo}]}
"$(dirname "$(readlink -e "$0")")/db-move" "${TESTING_REPO}" "${repo}" ${pkgs[${repo}]}
fi
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment