Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replaced apt with apt-get #804

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

prakrit55
Copy link
Contributor

Describe the changes in this pull request using active verbs such as Add, Remove, Replace ...

  • Replaced apt with apt-get

Closes #787

@prakrit55
Copy link
Contributor Author

@ashnamehrotra, can you check it once, if it is okay

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 47.43%. Comparing base (aec1c59) to head (274e014).

Files with missing lines Patch % Lines
pkg/pkgmgr/dpkg.go 60.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #804   +/-   ##
=======================================
  Coverage   47.43%   47.43%           
=======================================
  Files          18       18           
  Lines        1714     1714           
=======================================
  Hits          813      813           
  Misses        843      843           
  Partials       58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@prakrit55 prakrit55 changed the title replaced apt with apt-get chore: Replaced apt with apt-get Oct 9, 2024
} else {
// if updates is not specified, update all packages
installCmd = `sh -c "output=$(apt upgrade -y && apt clean -y && apt autoremove 2>&1); if [ $? -ne 0 ]; then echo "$output" >>error_log.txt; fi"`
installCmd = `sh -c "output=$(apt-get upgrade -y && apt-get clean -y && apt-get autoremove 2>&1); if [ $? -ne 0 ]; then echo "$output" >>error_log.txt; fi"`
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like this command is not downloading the packages, resulting in the error for the test cases with no report

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ashnamehrotra, could you check it once, and this too

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like results manifest file is not found, so the packages are not found/downloaded correctly. There is also a log output line 2: packages.txt: No such file or directory. Would you be able to run the apt-get commands manually in a container to see if they are working as expected?

@@ -411,7 +411,7 @@ func (dm *dpkgManager) unpackAndMergeUpdates(ctx context.Context, updates unvers
while IFS=':' read -r package version; do
pkg_name=$(echo "$package" | sed 's/^"\(.*\)"$/\1/')
pkg_version=$(echo "$version" | sed 's/^"\(.*\)"$/\1/')
latest_version=$(apt show $pkg_name 2>/dev/null | awk -F ': ' '/Version:/{print $2}')
latest_version=$(apt-get show $pkg_name 2>/dev/null | awk -F ': ' '/Version:/{print $2}')
Copy link
Member

Choose a reason for hiding this comment

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

apt-get show is not a valid command

@@ -43,7 +43,7 @@ Experimental: This feature might change without preserving backwards compatibili

:::

Copa does not support replacing the repositories in the package managers with alternatives. Images must already use the intended package repositories. For example, for debian, updating `/etc/apt/sources.list` from `http://archive.ubuntu.com/ubuntu/` to a mirror, such as `https://mirrors.wikimedia.org/ubuntu/`.
Copa does not support replacing the repositories in the package managers with alternatives. Images must already use the intended package repositories. For example, for debian, updating `/etc/apt-get/sources.list` from `http://archive.ubuntu.com/ubuntu/` to a mirror, such as `https://mirrors.wikimedia.org/ubuntu/`.
Copy link
Member

@sozercan sozercan Oct 10, 2024

Choose a reason for hiding this comment

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

there's no /etc/apt-get dir

@@ -24,7 +24,7 @@ const (
dpkgLibPath = "/var/lib/dpkg"
dpkgStatusPath = dpkgLibPath + "/status"
dpkgStatusFolder = dpkgLibPath + "/status.d"
dpkgDownloadPath = "/var/cache/apt/archives"
dpkgDownloadPath = "/var/cache/apt-get/archives"
Copy link
Member

@sozercan sozercan Oct 10, 2024

Choose a reason for hiding this comment

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

/var/cache/apt-get is not a valid dir

please make sure these exist before find and replace

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

see comments

@sozercan
Copy link
Member

@prakrit55 looks like there's a lint issue

@prakrit55
Copy link
Contributor Author

prakrit55 commented Oct 12, 2024

@prakrit55 looks like there's a lint issue

there are some other instances of apt in the docs, let me cover those too

Signed-off-by: Griffin <[email protected]>
Signed-off-by: Griffin <[email protected]>
Signed-off-by: Griffin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

[REQ] Use apt-get instead of apt
3 participants