commit:     0a142e904dfad15121b64c90aafc67e7e9ee375a
Author:     Christoph Mende <angelos <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 22 11:07:48 2015 +0000
Commit:     Christoph Mende <angelos <AT> gentoo <DOT> org>
CommitDate: Thu Oct 22 11:07:48 2015 +0000
URL:        https://gitweb.gentoo.org/dev/angelos.git/commit/?id=0a142e90

Update sync-xfce-overlay.sh

 scripts/sync-xfce-overlay.sh | 11 ++++++-----
 1 file 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

Reply via email to