Skip to content

Commit

Permalink
feat: update golang-pty to 1.1.6-2
Browse files Browse the repository at this point in the history
  • Loading branch information
deepin-community-bot[bot] committed Nov 11, 2024
1 parent f80e7fb commit de05d19
Show file tree
Hide file tree
Showing 56 changed files with 1,547 additions and 34 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[568].out
_go*
_test*
_obj
14 changes: 14 additions & 0 deletions Dockerfile.riscv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.12

# Clone and complie a riscv compatible version of the go compiler.
RUN git clone https://review.gerrithub.io/riscv/riscv-go /riscv-go
# riscvdev branch HEAD as of 2019-06-29.
RUN cd /riscv-go && git checkout 04885fddd096d09d4450726064d06dd107e374bf
ENV PATH=/riscv-go/misc/riscv:/riscv-go/bin:$PATH
RUN cd /riscv-go/src && GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash
ENV GOROOT=/riscv-go

# Make sure we compile.
WORKDIR pty
ADD . .
RUN GOOS=linux GOARCH=riscv go build
23 changes: 23 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) 2011 Keith Rarick

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
101 changes: 100 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,100 @@
# template-repository
# pty

Pty is a Go package for using unix pseudo-terminals.

## Install

go get github.com/creack/pty

## Example

### Command

```go
package main

import (
"github.com/creack/pty"
"io"
"os"
"os/exec"
)

func main() {
c := exec.Command("grep", "--color=auto", "bar")
f, err := pty.Start(c)
if err != nil {
panic(err)
}

go func() {
f.Write([]byte("foo\n"))
f.Write([]byte("bar\n"))
f.Write([]byte("baz\n"))
f.Write([]byte{4}) // EOT
}()
io.Copy(os.Stdout, f)
}
```

### Shell

```go
package main

import (
"io"
"log"
"os"
"os/exec"
"os/signal"
"syscall"

"github.com/creack/pty"
"golang.org/x/crypto/ssh/terminal"
)

func test() error {
// Create arbitrary command.
c := exec.Command("bash")

// Start the command with a pty.
ptmx, err := pty.Start(c)
if err != nil {
return err
}
// Make sure to close the pty at the end.
defer func() { _ = ptmx.Close() }() // Best effort.

// Handle pty size.
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGWINCH)
go func() {
for range ch {
if err := pty.InheritSize(os.Stdin, ptmx); err != nil {
log.Printf("error resizing pty: %s", err)
}
}
}()
ch <- syscall.SIGWINCH // Initial resize.

// Set stdin in raw mode.
oldState, err := terminal.MakeRaw(int(os.Stdin.Fd()))
if err != nil {
panic(err)
}
defer func() { _ = terminal.Restore(int(os.Stdin.Fd()), oldState) }() // Best effort.

// Copy stdin to the pty and the pty to stdout.
go func() { _, _ = io.Copy(ptmx, os.Stdin) }()
_, _ = io.Copy(os.Stdout, ptmx)

return nil
}

func main() {
if err := test(); err != nil {
log.Fatal(err)
}
}
```
22 changes: 22 additions & 0 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM tianon/debian-devel

# TODO find a cleaner way to get ".git" in the image without this hack
RUN git clone --no-checkout git://anonscm.debian.org/pkg-go/packages/golang-pty.git /usr/src/golang-pty

# start by adding just "debian/control" so we can get mk-build-deps with maximum caching
ADD control /usr/src/golang-pty/debian/
WORKDIR /usr/src/golang-pty

# get all the build deps of _this_ package in a nice repeatable way
RUN apt-get update && mk-build-deps -irt'apt-get --no-install-recommends -yq' debian/control

# need our debian/ directory to compile _this_ package
ADD . /usr/src/golang-pty/debian

# go download and unpack our upstream source
#RUN uscan --force-download --verbose --download-current-version
RUN git fetch --tags && ./debian/helpers/generate-tarball.sh ../
RUN origtargz --unpack

# tianon is _really_ lazy, and likes a preseeded bash history
RUN echo 'origtargz --unpack && dpkg-buildpackage -us -uc && lintian -EvIL+pedantic' >> /root/.bash_history
17 changes: 17 additions & 0 deletions debian/README.Source
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This package was debianized as part of the Docker in Debian work. It's been
packaged in line with the policy that paultag set, so any questions or concerns
about this (or other packages like it) can be sent to him. If there's an issue,
of course, please feel free to fix the packaging.

# generate orig tarball
./debian/helpers/generate-tarball.sh ..
# see ../golang-pty_0.0~gitXXXXXXXX.orig.tar.gz

# update "upstream" branch
./debian/helpers/update-upstream-branch.sh

# create new "upstream/..." tag
./debian/helpers/create-upstream-tag.sh upstream # to package latest
# or ./debian/helpers/create-upstream-tag.sh <upstream-commit>
./debian/helpers/create-upstream-tag.sh 8e4cdcb
# version number for debian/changelog will be printed
131 changes: 128 additions & 3 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,130 @@
template-repository (1.0-1) unstable; urgency=medium
golang-pty (1.1.6-2) unstable; urgency=medium

* Initial release
[ Debian Janitor ]
* Apply multi-arch hints. + golang-github-kr-pty-dev: Add Multi-Arch: foreign.
* Bump debhelper from old 12 to 13.
* Set upstream metadata fields: Repository-Browse.
* Update standards version to 4.6.1, no changes needed.

-- Tsic404 <[email protected]> Sat, 28 Jan 2023 13:46:49 +0800
-- Jelmer Vernooij <[email protected]> Thu, 24 Nov 2022 02:08:07 +0000

golang-pty (1.1.6-1) unstable; urgency=medium

New upstream version 1.1.6
* Bump debhelper dependency to "Build-Depends: debhelper-compat (= 12)"
* Bump Standards-Version to 4.4.0 (no change)

-- Anthony Fok <[email protected]> Wed, 07 Aug 2019 06:20:47 -0600

golang-pty (1.1.3-1) unstable; urgency=medium

* New upstream release 1.1.3:
- Add StartWithSize to allow resizing pty before starting a command
to avoid races (#62)
* Update Maintainer email address to [email protected]
* Bump Standards-Version to 4.3.0 (no change)
* Set debian/gbp.conf to the current default of dh-make-golang.
Removing the peculiar ../build-area/ and ../tarballs/ directories
that are not used in most other Debian Go packages.

-- Anthony Fok <[email protected]> Wed, 02 Jan 2019 02:05:32 -0700

golang-pty (1.1.2-1) unstable; urgency=medium

* New upstream release 1.1.2

-- Anthony Fok <[email protected]> Tue, 26 Jun 2018 03:36:06 -0600

golang-pty (1.1.1-1) unstable; urgency=medium

[ Alexandre Viau ]
* Point Vcs-* urls to salsa.debian.org.

[ Anthony Fok ]
* New upstream release 1.1.1
* [66121ac] Apply "cme fix dpkg" fixes to debian/control,
bumping Standards-Version to 4.1.4,
setting Priority from extra to optional, etc.
* [e828c27] Use debhelper (>= 11)
* [9496a75] Remove old golang-pty-dev transitional package

-- Anthony Fok <[email protected]> Wed, 25 Apr 2018 22:24:28 -0600

golang-pty (1.0.0-2) unstable; urgency=medium

* Update Maintainer to be the pkg-go team proper

-- Tianon Gravi <[email protected]> Tue, 08 Aug 2017 20:25:51 -0700

golang-pty (1.0.0-1) unstable; urgency=medium

* New upstream release v1.0.0 [2c10821]
* [5c4f86a] Add debian/watch: upstream has made a v1.0.0 release
* [553418a] Build-Depends on golang-any instead of golang-go
* [998c70e] Use debhelper (>= 10)
* [47852f7] Bump Standards-Version to 4.0.0: Use https form
of the copyright-format URL in debian/copyright
* [dcf4d2e] debian/gbp.conf: Rename old style [git-dch] to [dch]

-- Anthony Fok <[email protected]> Mon, 10 Jul 2017 16:12:33 -0600

golang-pty (0.0~git20151007.0.f7ee69f-2) unstable; urgency=medium

[ Tim Potter ]
* [7ddfdbc] Add me to uploaders

[ Michael Stapelberg ]
* [db77a97] debian/control: drop bogus built-using, add myself to uploaders
built-using should be set on binary packages, not library packages

-- Michael Stapelberg <[email protected]> Sat, 06 May 2017 13:48:48 +0200

golang-pty (0.0~git20151007.0.f7ee69f-1) unstable; urgency=medium

* Upstream bump to f7ee69f (2015-10-07)
* Rename golang-pty-dev package to golang-github-kr-pty-dev
* Update debian/control:
- Add myself to the list of Uploaders
- Bump Standards-Version to 3.9.8 (no change)
- Use secure https URL for Vcs-Git
- Add XS-Go-Import-Path field

-- Anthony Fok <[email protected]> Thu, 28 Apr 2016 09:58:28 +0800

golang-pty (0.0~git20150511.1.5cf931e-1) unstable; urgency=medium

* Upstream bump to 5cf931e (2015-05-11).

-- Tianon Gravi <[email protected]> Thu, 04 Jun 2015 10:36:48 -0600

golang-pty (0.0~git20141217.1.05017fc-1) unstable; urgency=medium

* Upload to unstable (and update the version number to be appropriately less
overenthusiastic)

-- Tianon Gravi <[email protected]> Sun, 03 May 2015 00:15:21 -0600

golang-pty (0.0~git20141217.141937.1.05017fc-1~exp1) experimental; urgency=low

* Upstream bump to 05017fc (2014-12-17)
* Update packaging to utilize dh-golang appropriately
* Remove Daniel Mizyrycki from Uploaders. Thanks for all your work!

-- Tianon Gravi <[email protected]> Wed, 28 Jan 2015 23:00:36 -0700

golang-pty (0.0~git20140315.1.67e2db2-1) unstable; urgency=medium

[ Paul Tagliamonte ]
* We're hijacking the golang-pty-dev bianry because we want a source
rename to bring it in-line with go policy.

[ Tianon Gravi ]
* Upstream bump to 67e2db2 (2014-03-15)

-- Tianon Gravi <[email protected]> Thu, 08 May 2014 11:04:49 -0400

golang-pty-dev (0.0~git20130701-1) unstable; urgency=low

* Initial release (Closes: #715523)

-- Daniel Mizyrycki <[email protected]> Wed, 17 Jul 2013 09:41:19 -0700
1 change: 0 additions & 1 deletion debian/compat

This file was deleted.

40 changes: 27 additions & 13 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
Source: template-repository
Section: unknown
Source: golang-pty
Maintainer: Debian Go Packaging Team <[email protected]>
Uploaders: Tianon Gravi <[email protected]>,
Anthony Fok <[email protected]>,
Tim Potter <[email protected]>,
Michael Stapelberg <[email protected]>
Section: devel
Testsuite: autopkgtest-pkg-go
Priority: optional
Maintainer: Tsic404 <[email protected]>
Build-Depends: debhelper (>= 11)
Standards-Version: 4.1.3
Homepage: https://github.com/deepin-community/template-repository
#Vcs-Browser: https://salsa.debian.org/debian/deepin-community-template-repository
#Vcs-Git: https://salsa.debian.org/debian/deepin-community-template-repository.git
Build-Depends: debhelper-compat (= 13),
dh-golang,
golang-any
Standards-Version: 4.6.1
Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-pty
Vcs-Git: https://salsa.debian.org/go-team/packages/golang-pty.git
Homepage: https://github.com/kr/pty
XS-Go-Import-Path: github.com/kr/pty

Package: template-repository
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Package: golang-github-kr-pty-dev
Architecture: all
Depends: ${misc:Depends}
Breaks: golang-pty-dev (<< 0.0~git20151007.0.f7ee69f-1~)
Provides: golang-pty-dev
Replaces: golang-pty-dev (<< 0.0~git20151007.0.f7ee69f-1~)
Multi-Arch: foreign
Description: Go package for using unix pseudo-terminals
Pty is a Go package for using unix pseudo-terminals.
.
This package contains the source.
Loading

0 comments on commit de05d19

Please sign in to comment.