0

i do not know if this question was already made somewhere, please be patient with me. I'm compiling asterisk in a CI Job (Gitlab) and i want to sign all rpm packages with my own GPG key. For that i have this expect script:


foreach files [glob *] {
  set password [lindex $argv 0]
  set files [lrange $argv 1 1]
  spawn rpm --define "_gpg_name <email@whatsoever.com>" --addsign $files
  expect "Enter pass phrase:"
  send -- "$password\r"
  expect eof
  exp_continue
}

I want to execute this as a loop in the CI Job:

 - |+
      for item in $(ls -l | tr -s " " | cut -d " " -f 9)
      do
        expect -d ${CI_PROJECT_DIR}/sign.exp ${GPG_PASSWD} $item
      done

Both variables are difined in Gitlab. Everytime i run the job i get the following error:

spawn rpm --define _gpg_name <email@whatsoever.com> --addsign asterisk-voicemail-plain-debuginfo-18.12.1-1.el8.x86_64.rpm
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {122292}

expect: does "" (spawn_id exp4) match glob pattern "Enter pass phrase:"? no
asterisk-voicemail-plain-debuginfo-18.12.1-1.el8.x86_64.rpm:

expect: does "asterisk-voicemail-plain-debuginfo-18.12.1-1.el8.x86_64.rpm:\r\n" (spawn_id exp4) match glob pattern "Enter pass phrase:"? no
expect: read eof
expect: set expect_out(spawn_id) "exp4"
expect: set expect_out(buffer) "asterisk-voicemail-plain-debuginfo-18.12.1-1.el8.x86_64.rpm:\r\n"
send: sending "xxxxxxxxxxxxx\r" to { exp4 send: spawn id exp4 not open
    while executing
"send -- "$password\r""
    ("foreach" body line 6)
    invoked from within
"foreach files [glob *] {
  set password [lindex $argv 0]
  set files [lrange $argv 1 1]
  spawn rpm --define "_gpg_name <email@whatsoever.com>" --add..."
    (file "../sign.exp" line 3)

I'd appreciate any suggestion here. Ok, i got errors but when i check the rpm package, i can see that the package is signed. Thank you in advance for your help.

0 Answers0