Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/asp.in
diff options
context:
space:
mode:
Diffstat (limited to 'asp.in')
-rw-r--r--asp.in28
1 files changed, 12 insertions, 16 deletions
diff --git a/asp.in b/asp.in
index 62eea9e..99f69fe 100644
--- a/asp.in
+++ b/asp.in
@@ -126,27 +126,23 @@ initialize() {
local remote
umask 0022
- startdir=$PWD
- if [[ ! -d $ASPROOT ]]; then
- log_info 'Initializing ASPROOT in %s' "$ASPROOT"
- mkdir -p "$ASPROOT"
- fi
+ export GIT_DIR=$ASPROOT/.git
- cd "$ASPROOT" || log_fatal "ASPROOT (%s) does not exist!" "$ASPROOT"
+ if [[ ! -f $ASPROOT/.asp ]]; then
+ git init -q "$ASPROOT" || return 1
+ for remote in "${ARCH_GIT_REPOS[@]}"; do
+ git remote add "$remote" "https://git.archlinux.org/svntogit/$remote.git" || return 1
+ done
- if [[ ! -d $ASPCACHE ]] && ! mkdir -p "$ASPCACHE"; then
- log_fatal 'failed to create ASPCACHE (%s)' "$ASPCACHE"
+ touch "$ASPROOT/.asp" || return 1
fi
- [[ -f .asp ]] && return 0
-
- git init -q || return 1
- for remote in "${ARCH_GIT_REPOS[@]}"; do
- git remote add "$remote" "https://git.archlinux.org/svntogit/$remote.git"
- done
+ if [[ ! -d $ASPCACHE ]]; then
+ mkdir -p "$ASPCACHE" || return 1
+ fi
- touch .asp
+ return 0
}
dump_packages() {
@@ -340,7 +336,7 @@ dispatch_action() {
esac
}
-initialize
+initialize || log_fatal 'failed to initialize asp repository in %s' "$ASPROOT"
while getopts ':a:fhV' flag; do
case $flag in