Skip to content

Conversation

@QiWang19
Copy link
Member

@QiWang19 QiWang19 commented Apr 3, 2019

close #2836
podman cp used to copy the contents under the source directory to the destination. But according to the specification in podman-cp.md. it should copy the whole directory to the destination if the destination directory already exists.

  • src dir ends with /., copy the contents to dest dir
  • src dir does not end with /.
    • dest dir /home does not exist, copy the contents
    • dest dir /home exists, copy the directory
$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
$

$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
empty

Signed-off-by: Qi Wang qiwan@redhat.com

@mheon
Copy link
Member

mheon commented Apr 3, 2019

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon, QiWang19

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 3, 2019
cmd/podman/cp.go Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you set this to err == nil?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I should...

cmd/podman/cp.go Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though this save lines in code, but make less readable.

@TomSweeneyRedHat
Copy link
Member

LGTM

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #2706) made this pull request unmergeable. Please resolve the merge conflicts.

`podman cp` used to copy the contents under the source directory to the destination. But according to the specification in podman-cp.md. it should copy the whole directory to the destination if the destination directory already exists.
- src dir ends with /., copy the contents to dest dir
- src dir does not end with /.
 - dest dir /home does not exist, copy the contents
 - dest dir /home exists, copy the directory

```
$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
$

$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
empty

```

Signed-off-by: Qi Wang <qiwan@redhat.com>
@mheon
Copy link
Member

mheon commented Apr 8, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2019
@openshift-merge-robot openshift-merge-robot merged commit 7f8e9bd into containers:master Apr 8, 2019
@QiWang19 QiWang19 deleted the cpdir branch June 26, 2020 15:10
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

podman cp does not copy folders

7 participants