Skip to content

Add Origin: and Label: fields to Debian package releases#39

Merged
algobolson merged 3 commits intoalgorand:masterfrom
jecassis:debian
Jun 18, 2019
Merged

Add Origin: and Label: fields to Debian package releases#39
algobolson merged 3 commits intoalgorand:masterfrom
jecassis:debian

Conversation

@jecassis
Copy link
Copy Markdown
Contributor

Origin and Label from the Debian repo are set to ". stable" and therefore unattended-upgrades does not work because 'Unattended-Upgrade::Allowed-Origins:: "Algorand:stable";' does not match the repository Origin.

As currently published:

$ less /var/lib/apt/lists/algorand-releases.s3-website-us-east-1.amazonaws.com_deb_dists_stable_InRelease
...
Origin: . stable
Label: . stable
Suite: stable
Codename: stable
...

Three changes are proposed here:

  1. Change the filename from 50algorand-upgrades to 51algorand-upgrades as lexicographical order means it is read before 50unattended-upgrades.
  2. Update aptly's snapshot commands to add 'Algorand' as Origin and Label.
  3. (not implemented) Decide how you want to handle configuration files. My suggestions to keep modified ones intact and replace unmodified (would add this to 51algorand-upgrades):
Dpkg::Options {
   "--force-confdef";
   "--force-confold";
};

At the moment unattended-upgrades still will not work on a live system even when /etc/apt/apt.conf.d/50algorand-upgrades is changed to ". stable:stable" from "Algorand:stable" because of conffiles (in this case genesis.json was changed to mainnet version). However it does identify algorand as a package to upgrade which did not happen previously:

$ sudo unattended-upgrades --dry-run --debug
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=. stable,a=stable, o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
Checking: algorand ([<Origin component:'main' archive:'stable' origin:'. stable' label:'. stable' site:'algorand-releases.s3-website-us-east-1.amazonaws.com' isTrusted:True>])
pkgs that look like they should be upgraded: algorand
fetch.run() result: 0
<apt_pkg.AcquireItem object:Status: 2 Complete: 1 Local: 0 IsTrusted: 1 FileSize: 87421586 DestFile:'/var/cache/apt/archives/algorand_1.0.25_amd64.deb' DescURI: 'http://algorand-releases.s3-website-us-east-1.amazonaws.com/deb/pool/main/a/algorand/algorand_stable_linux-amd64_1.0.25.deb' ID:1 ErrorText: ''>
check_conffile_prompt(/var/cache/apt/archives/algorand_1.0.25_amd64.deb)
found pkg: algorand
found conffile /var/lib/algorand/genesis.json in new pkg but on dpkg status
Package algorand has conffile prompt and needs to be upgraded manually
blacklist: ['algorand']
whitelist: []
Checking the black and whitelist: algorand
skipping blacklisted package algorand
pkg algorand package has been blacklisted
package algorand not upgraded
Option --dry-run given, *not* performing real actions
Packages that will be upgraded:
InstCount=0 DelCount=0 BrokenCount=0

Adding dpkg options (as suggested in 3 above) results in this:

$ sudo unattended-upgrades --dry-run --debug
Initial blacklisted packages:
Initial whitelisted packages:
Starting unattended upgrades script
Allowed origins are: o=. stable,a=stable, o=Ubuntu,a=bionic, o=Ubuntu,a=bionic-security, o=UbuntuESM,a=bionic
Checking: algorand ([<Origin component:'main' archive:'stable' origin:'. stable' label:'. stable' site:'algorand-releases.s3-website-us-east-1.amazonaws.com' isTrusted:True>])
pkgs that look like they should be upgraded: algorand
Fetched 0 B in 0s (0 B/s)
fetch.run() result: 0
dpkg is configured not to cause conffile prompts
Option --dry-run given, *not* performing real actions
Packages that will be upgraded: algorand
Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
applying set ['algorand']
/usr/bin/dpkg --force-confdef --force-confold --status-fd 11 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/algorand_1.0.25_amd64.deb
/usr/bin/dpkg --force-confdef --force-confold --status-fd 11 --configure --pending

@zeldovich
Copy link
Copy Markdown
Contributor

I think @algobolson is working on fixing this.

@algobolson
Copy link
Copy Markdown
Contributor

This is about what I'd had planned. Will try to test it Monday.

Copy link
Copy Markdown
Contributor

@algobolson algobolson left a comment

Choose a reason for hiding this comment

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

confirmed that I can get a local aptly repo to pass unattended-upgrades with this. One tweak then good to go.

Comment thread scripts/release_deb.sh Outdated
Comment thread scripts/release_deb.sh Outdated
@algobolson algobolson merged commit 7da2e2a into algorand:master Jun 18, 2019
algobolson pushed a commit that referenced this pull request Jun 18, 2019
* Add Origin: and Label: fields to Debian package releases

* Add configuration file-handling directives for the Debian package
pzbitskiy pushed a commit to pzbitskiy/go-algorand that referenced this pull request Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants