Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check3
-rwxr-xr-xbin/setup2
-rwxr-xr-xbin/update34
3 files changed, 27 insertions, 12 deletions
diff --git a/bin/check b/bin/check
index 46e9212..c50ab19 100755
--- a/bin/check
+++ b/bin/check
@@ -115,6 +115,3 @@ for pkg in `find "${state_dir}"/{core,extra}-{any,x86_64} -type f | \
echo "${pkg}\tno git repo" >> "${data_dir}/missing_package_repo"
fi
done
-
-# TODO: update all single package directories
-# TODO: update all AUR package directories
diff --git a/bin/setup b/bin/setup
index fcb8c87..a74c088 100755
--- a/bin/setup
+++ b/bin/setup
@@ -47,5 +47,3 @@ if test ! -d "${aur_state_dir}"; then
else
echo "AUR state information directory exists."
fi
-
-# TODO: AUR directory
diff --git a/bin/update b/bin/update
index 1d317ed..f7b7c44 100755
--- a/bin/update
+++ b/bin/update
@@ -98,25 +98,45 @@ if test "${UPDATE_UPSTREAM}" = 1; then
IFS=" "
while read pkgname pkgver tag revision; do
if test "${VERBOSE}" = 1; then
- echo "${repo} ${pkgname}"
+ echo -n "${repo} ${pkgname}"
fi
if test ! -d "${packages_dir}/${repo}/${pkgname}"; then
+ if test "${VERBOSE}" = 1; then
+ echo ".. cloning .."
+ fi
cd "${packages_dir}/${repo}" || exit 1
pkgctl repo clone --protocol=https "${pkgname}"
sleep 10
else
- true
-# TODO: find a way to find out whether the reference revision is in out
-# current state repo and update only when we miss it. We can still
-# do a full update when we need it, but here it just creates a lot
-# of load..
-# git -C "${packages_dir}/${repo}/${pkgname}" pull
+ # get all revisions from the package repo, check if
+ # we find the state sha in there, if not, do an
+ # update of the repo. Doing a full git pull on
+ # every update is not acceptable as it creates too
+ # much load
+ cd "${packages_dir}/${repo}/${pkgname}" || exit 1
+ git show-ref --tags > /tmp/update_package_revisions.$$
+ grep -F "${revision}" "/tmp/update_package_revisions.$$" 2>&1 >/tmp/update_package_revision_found.$$
+ if test $? = 0; then
+ if test "${VERBOSE}"; then
+ tag=`cat /tmp/update_package_revision_found.$$ | cut -d ' ' -f 2`
+ echo ".. ${revision} (${tag}) exists in package history .."
+ fi
+ else
+ if test "${VERBOSE}"; then
+ echo ".. updating .."
+ fi
+ git -C "${packages_dir}/${repo}/${pkgname}" pull
+ sleep 10
+ fi
+ rm -f /tmp/update_package_revisions.$$ /tmp/update_package_revision_found.$$
fi
done < $pkgfile
IFS="$OLDIFS"
done
fi
+rm -f /tmp/update_packages.$$
+
if test "${UPDATE_AUR}" = 1; then
echo "Updating AUR state.."