@@ -1,5 +1,8 @@
#!/bin/bash
+# uncomment this if you are running gnmoe but don't want osc to use the keyring
+#unset GNOME_DESKTOP_SESSION_ID
+
API_URL=https://api.merproject.org/
MAPPINGS=(
@@ -33,7 +36,12 @@
}
pkg_in () {
- osc -A ${API_URL} ls $1 $2 >/dev/null 2>&1 && echo YES
+ for p in $1; do
+ if [[ x"$p" = x"$2" ]] ; then
+ echo YES
+ exit
+ fi
+ done
}
main () {
@@ -48,19 +56,34 @@
osc -A ${API_URL} meta prjconf $src_prj | osc -A ${API_URL} meta prjconf $dst_prj -F -
echo
- for pkg in $(osc -A ${API_URL} ls $src_prj); do
+ dst_prj_list="$(osc -A ${API_URL} ls $dst_prj | xargs)"
+ src_prj_list="$(osc -A ${API_URL} ls $src_prj | xargs)"
+
+ for pkg in $src_prj_list; do
if [[ "x$pkg" = "x_pattern" ]]; then
continue
fi
echo -n "Looking at $src_prj $pkg "
- if [[ "x$(pkg_in $dst_prj $pkg)" = "xYES" ]]; then
+ if [[ "x$(pkg_in "$dst_prj_list" $pkg)" = "xYES" ]]; then
srcmd5="$(get_srcmd5 $src_prj $pkg)"
+
+ if [[ x"$srcmd5" = x"" ]]; then
+ echo "empty response. Skipping"
+ continue
+ fi
+
echo -n "($srcmd5) ... "
echo -n "exists in $dst_prj "
dstmd5="$(get_srcmd5 $dst_prj $pkg)"
+
+ if [[ x"$dstmd5" = x"" ]]; then
+ echo "empty response. Skipping"
+ continue
+ fi
+
echo -n "($dstmd5) ..."
if [[ "x$dstmd5" = "x$srcmd5" ]]; then
@@ -76,14 +99,14 @@
echo
done
- for pkg in $(osc -A ${API_URL} ls $dst_prj); do
+ for pkg in $dst_prj_list; do
if [[ "x$pkg" = "x_pattern" ]]; then
continue
fi
-
+ echo
echo -n "Looking at $dst_prj $pkg "
- if [[ "x$(pkg_in $src_prj $pkg)" = "xYES" ]]; then
+ if [[ "x$(pkg_in "$src_prj_list" $pkg)" = "xYES" ]]; then
echo -n "exists in both source and destination. Skipping."
continue
else
|