Skip to content

Commit

Permalink
add ability to force checking snapshot directory for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
neutralinsomniac committed Sep 2, 2020
1 parent 69ca483 commit 40f079e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ up to date
### Check for upgrades using index.txt:
`obsdpkgup -n`

### Force checking snapshot directory for upgrades (useful for when a release is imminent):
`obsdpkgup -s`

### Run and apply found package upgrades:
`obsdpkgup |doas sh`

Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func getSystemInfo() SysInfo {
output, err := cmd.Output()
check(err)

if strings.Contains(string(output), "-current") {
if strings.Contains(string(output), "-current") || forceSnapshot {
sysInfo.snapshot = true
}

Expand Down Expand Up @@ -247,6 +247,7 @@ func getMirror() string {

var cronMode bool
var disablePkgUp bool
var forceSnapshot bool

func main() {
_ = protect.Pledge("stdio unveil rpath wpath cpath flock dns inet tty proc exec")
Expand All @@ -260,6 +261,7 @@ func main() {

flag.BoolVar(&cronMode, "c", false, "Cron mode (only output when updates are available)")
flag.BoolVar(&disablePkgUp, "n", false, "Disable pkgup index (fallback to index.txt)")
flag.BoolVar(&forceSnapshot, "s", false, "Force snapshot (use when new release is happening Soon(R))")

flag.Parse()

Expand Down

0 comments on commit 40f079e

Please sign in to comment.