update buildah and c/common to latest

also includes bumps for c/storage and c/image

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-09-08 15:32:44 +02:00
parent 7e2f002b07
commit eb28a1c084
374 changed files with 4741 additions and 42362 deletions

View File

@ -6,9 +6,11 @@ import (
"container/list"
"fmt"
"os"
"os/signal"
"strconv"
"strings"
"sync"
"syscall"
"time"
"unicode"
)
@ -41,6 +43,7 @@ const (
CharCtrlY = 25
CharCtrlZ = 26
CharEsc = 27
CharO = 79
CharEscapeEx = 91
CharBackspace = 127
)
@ -121,6 +124,27 @@ func escapeExKey(key *escapeKeyPair) rune {
return r
}
// translate EscOX SS3 codes for up/down/etc.
func escapeSS3Key(key *escapeKeyPair) rune {
var r rune
switch key.typ {
case 'D':
r = CharBackward
case 'C':
r = CharForward
case 'A':
r = CharPrev
case 'B':
r = CharNext
case 'H':
r = CharLineStart
case 'F':
r = CharLineEnd
default:
}
return r
}
type escapeKeyPair struct {
attr string
typ rune
@ -275,3 +299,13 @@ func Debug(o ...interface{}) {
fmt.Fprintln(f, o...)
f.Close()
}
func CaptureExitSignal(f func()) {
cSignal := make(chan os.Signal, 1)
signal.Notify(cSignal, os.Interrupt, syscall.SIGTERM)
go func() {
for range cSignal {
f()
}
}()
}