-/* $OpenBSD: repo.c,v 1.36 2022/08/30 12:45:13 claudio Exp $ */
+/* $OpenBSD: repo.c,v 1.37 2022/09/02 15:09:19 job Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
if ((rp->repouri = strdup(tal->descr)) == NULL)
err(1, NULL);
- /* try to create base directory */
- if (mkpath(rp->basedir) == -1)
- warn("mkpath %s", rp->basedir);
-
/* check if sync disabled ... */
if (noop) {
logx("ta/%s: using cache", rp->repouri);
return rp;
}
+ /* try to create base directory */
+ if (mkpath(rp->basedir) == -1)
+ warn("mkpath %s", rp->basedir);
+
rp->ta = ta_get(tal);
/* need to check if it was already loaded */
nofetch = 1;
}
- /* try to create base directory */
- if (mkpath(rp->basedir) == -1)
- warn("mkpath %s", rp->basedir);
-
/* check if sync disabled ... */
if (noop || nofetch) {
logx("%s: using cache", rp->basedir);
return rp;
}
+ /* try to create base directory */
+ if (mkpath(rp->basedir) == -1)
+ warn("mkpath %s", rp->basedir);
+
/* ... else try RRDP first if available then rsync */
if (notify != NULL)
rp->rrdp = rrdp_get(notify);