summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/sync-xfce-overlay.sh')
-rwxr-xr-xscripts/sync-xfce-overlay.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/sync-xfce-overlay.sh b/scripts/sync-xfce-overlay.sh
index 968e51e..f83fa7d 100755
--- a/scripts/sync-xfce-overlay.sh
+++ b/scripts/sync-xfce-overlay.sh
@@ -1,10 +1,10 @@
#!/bin/bash
repo_name="xfce-dev"
-[ $# -gt 0 ] && repo_name=$1
+[[ $# -gt 0 ]] && repo_name=$1
OVERLAY="$(portageq get_repo_path / ${repo_name})"
-[ $? -eq 0 ] || exit 1
-PORTDIR="$(portageq portdir)"
+[[ $? -eq 0 ]] || exit 1
+PORTDIR="$(portageq get_repo_path / gentoo)"
# collect ebuilds
pushd "${OVERLAY}" >/dev/null
@@ -27,9 +27,10 @@ for i in ${pkgs}; do
# get destination ebuild's header
dst=${OVERLAY}/${i}
+ [[ -e ${dst} ]] || continue
dstheader=$(grep "^# \$Header: " ${dst})
- if [ "${srcheader}" != "${dstheader}" ]; then
+ if [[ "${srcheader}" != "${dstheader}" ]]; then
# copy new ebuild
cp -f ${src} ${dst}
@@ -43,7 +44,7 @@ for i in ${pkgs}; do
fi
done
-if [ ${changes} -gt 0 ]; then
+if [[ ${changes} -gt 0 ]]; then
echo ${changes} ebuilds synced, please review the changes
else
echo Everything up to date