mirror of
https://github.com/proski/madwifi
synced 2024-11-22 06:21:47 +03:00
Improve checks for directories used during release process.
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3829 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
569637796f
commit
86ba0d3980
@ -3,6 +3,27 @@
|
|||||||
# Purpose: automate the process of tagging a release and packing a tarball
|
# Purpose: automate the process of tagging a release and packing a tarball
|
||||||
# for it.
|
# for it.
|
||||||
|
|
||||||
|
# check_dir_prereq:
|
||||||
|
# ensures that a given directory name exist and is writeable
|
||||||
|
# note: $1 is expected to be set to the name of the variable that contains
|
||||||
|
# the name of the directory that is to be tested (indirect reference)
|
||||||
|
function check_dir_prereq {
|
||||||
|
eval d="\$$1"
|
||||||
|
n="$1"
|
||||||
|
|
||||||
|
if [[ ! -d "$d" || ! -w "$d" ]]; then
|
||||||
|
echo
|
||||||
|
echo "ERROR:"
|
||||||
|
echo -n "$n, currently set to $d, "
|
||||||
|
[[ ! -d "$d" ]] && echo "does not exist" || echo "is not writable"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# check if the script has been called directly
|
# check if the script has been called directly
|
||||||
if [[ "$(basename $(pwd))" == "scripts" ]]; then
|
if [[ "$(basename $(pwd))" == "scripts" ]]; then
|
||||||
echo
|
echo
|
||||||
@ -23,6 +44,11 @@ if [[ "$RELEASE_TMP" == "" || "$RELEASE_STORE" == "" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# make sure that the directories passed in RELEASE_TMP and RELEASE_STORE
|
||||||
|
# actually exist and are writable for the caller
|
||||||
|
check_dir_prereq "RELEASE_TMP"
|
||||||
|
check_dir_prereq "RELEASE_STORE"
|
||||||
|
|
||||||
# caller must have write access to the madwifi.org repository
|
# caller must have write access to the madwifi.org repository
|
||||||
valid=0
|
valid=0
|
||||||
repos=$(svn info | grep "Repository Root" | cut -d" " -f3)
|
repos=$(svn info | grep "Repository Root" | cut -d" " -f3)
|
||||||
@ -48,14 +74,6 @@ if [[ "$valid" != "1" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ ! -d "$RELEASE_TMP" ]]; then
|
|
||||||
echo
|
|
||||||
echo "ERROR:"
|
|
||||||
echo "RELEASE_TMP seems to be wrong. $RELEASE_TMP: no such directory"
|
|
||||||
echo
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if we're in the top-level directory of the snapshot
|
# check if we're in the top-level directory of the snapshot
|
||||||
if [[ ! -f ./release.h ]]; then
|
if [[ ! -f ./release.h ]]; then
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user