[SM-Commit] GIT changes to master quill by Bor Kraljič (65e205d92597c7252586edffe6e58f1cad850469)

Bor Kraljič scm at sourcemage.org
Sun Sep 25 14:35:53 EDT 2011


GIT changes to master quill by Bor Kraljič <pyrobor at ver.si>:

 var/lib/quill/ChangeLog      |    2 ++
 var/lib/quill/modules/libgpg |   23 +++++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 65e205d92597c7252586edffe6e58f1cad850469
Author: Bor Kraljič <pyrobor at ver.si>
Commit: Bor Kraljič <pyrobor at ver.si>

    libgpg: use arrays to have only one number in s_ln su_ln sgpg_ln
    
    (in function convert_to_upstream_gpg)

commit 1acadd3a6d7632739b8dc3f31bc4134b76cb9aad
Author: Bor Kraljič <pyrobor at ver.si>
Commit: Bor Kraljič <pyrobor at ver.si>

    libgpg: override current_check for lines that have gurus.gpg

diff --git a/var/lib/quill/ChangeLog b/var/lib/quill/ChangeLog
index 22beedd..6fd8f20 100644
--- a/var/lib/quill/ChangeLog
+++ b/var/lib/quill/ChangeLog
@@ -1,5 +1,7 @@
 2011-09-25 Bor Kraljič <pyrobor at ver.si>
 	* libgpg: fixed behaviour if there is more than one keyid found in signature
+	  override current_check for lines that have gurus.gpg
+	  use arrays to have only one number in s_ln su_ln sgpg_ln (convert_to_upstream_gpg)
 
 2011-02-13 Bor Kraljič <pyrobor at ver.si>
 	* libdeprecation: use UP_TRGGERS instead of TRIGGERS when deprecating a spell
diff --git a/var/lib/quill/modules/libgpg b/var/lib/quill/modules/libgpg
index 2a0accf..06b51db 100644
--- a/var/lib/quill/modules/libgpg
+++ b/var/lib/quill/modules/libgpg
@@ -82,6 +82,15 @@ function convert_to_upstream_gpg() {
       # for single-versioned spells we can have the prettier one
       # for multiversioned ones we use the safe(r), but uglier aggregate one
       if [[ -z $version_switch ]]; then
+
+        # Use current_check=gurus.gpg to avoid problems with not finding the
+        # correct line due to variables. Example:
+        # current_check=gurus.gpg:MPlayer-1.0rc4.tar.bz2.sig:WORKS_FOR_ME
+        # line in DETAILS: SOURCE_GPG="gurus.gpg:$SOURCE.sig:WORKS_FOR_ME"
+        if grep -q "gurus.gpg" <<< "$current_check"; then
+          current_check=gurus.gpg
+        fi
+
         # sed in the new source[j] right after source[i]
         new_value=$(count_spaces SOURCE${j})
         sed -i "/^\s*SOURCE$i=/ s%^.*$%&\n${new_value}SOURCE${j}=$new_source%" DETAILS
@@ -101,9 +110,14 @@ function convert_to_upstream_gpg() {
 
         # SOURCE must be first since others reference it
         # compare line numbers and move the vars if necessary
-        local s_ln su_ln sgpg_ln
-        s_ln=$(sed -n "/^\s*SOURCE$j=$new_source/=" DETAILS)
-        sgpg_ln=$(sed -n "/^\s*SOURCE${i}_GPG=$SPELL_KEYRING:\$SOURCE$j:UPSTREAM_KEY/=" DETAILS)
+        local s_ln su_ln sgpg_ln s_ln_pre sgpg_ln_pre su_ln_pre
+        # If there are more SOURCES we get more numbers. We only need one!
+        # So we take the last one. (SOURCE for SCM is usualy first)
+        # But this could still have problems with multiversioned DETAILS.
+        s_ln_pre=( $(sed -n "/^\s*SOURCE$j=$new_source/=" DETAILS) )
+        s_ln=${s_ln_pre[-1]}
+        sgpg_ln_pre=( $(sed -n "/^\s*SOURCE${i}_GPG=$SPELL_KEYRING:\$SOURCE$j:UPSTREAM_KEY/=" DETAILS) )
+        sgpg_ln=${sgpg_ln_pre[-1]}
         if (( $s_ln > $sgpg_ln )); then
           sed -i "$sgpg_ln{ x;d }; $s_ln G" DETAILS
           si_ln=$(sed -n "/^\s*SOURCE${j}_IGNORE=signature/=" DETAILS)
@@ -112,7 +126,8 @@ function convert_to_upstream_gpg() {
           s_ln=$(sed -n "/^\s*SOURCE$j=$new_source/=" DETAILS)
         fi
         SPELL_SIGNATURE=$(sed 's,[][],\\&,g' <<< "$SPELL_SIGNATURE")
-        su_ln=$(sed -n "/^\s*SOURCE${j}_URL\[.*\]=$SPELL_SIGNATURE/=" DETAILS)
+        su_ln_pre=( $(sed -n "/^\s*SOURCE${j}_URL\[.*\]=$SPELL_SIGNATURE/=" DETAILS) )
+        su_ln=${su_ln_pre[-1]}
         if (( $s_ln > $su_ln )); then
           sed -i "$su_ln{ x;d }; $s_ln G" DETAILS
         fi


More information about the SM-Commit mailing list