Skip to content

Commit 6ff3732

Browse files
committed
♻️ Synced dbin 📦 <-- [WEEKLY] Update MoeCounter image and package counts ⌚
1 parent b163dd9 commit 6ff3732

File tree

5 files changed

+39
-17
lines changed

5 files changed

+39
-17
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,27 @@ A schema of the metadata format can be found here [/misc/cmd/dbinRepoIndexGenera
198198

199199
### Default repos ![pin](https://raw.githubusercontent.com/xplshn/dbin/master/misc/assets/pin.svg)
200200
- [PkgForge's repos](https://docs.pkgforge.dev/repositories): Portable programs that are truly static, or otherwise self-contained using a wrapper format
201-
- <!-- PKGFORGE_COUNT -->
201+
- Pkgcache: 203 <!-- PKGCACHE_COUNT -->
202+
- Bincache: 3921 <!-- BINCACHE_COUNT -->
202203
- Note however that pkgforge also has dynamic (unportable) programs/packages (that only run on Debian & derivatives), `dbin` filters these out, leaving behind only the static/portable programs.
203204
- [AppBundleHub](https://github.com/xplshn/AppBundleHUB): Portable programs in .AppBundle format
204-
- 0 0 0 0 27 27 27 27 <!-- APPBUNDLEHUB_COUNT -->
205+
- 27 <!-- APPBUNDLEHUB_COUNT -->
205206

206207
## Optional repos
207208
- [AM repo](https://github.com/ivan-hc/am): `https://github.com/xplshn/dbin-metadata/raw/refs/heads/master/misc/cmd/1.5/AM_amd64_linux.lite.cbor.zst`
208209
- Note that the binaries in this repository come from the AM package manager, they aren't guaranteed to work everywhere, unlike the binaries in the default repos. But a lot of these are useful and do work even on Musl systems. I recommend you check it out
209-
- 2302 2302 2302 2302 2302 2302 2302 2302 <!-- AM_COUNT -->
210+
- 2302 <!-- AM_COUNT -->
211+
- NOTE: Scrapped by pkgforge. Adapted to `dbin` format at `dbin-metadata`
210212
- URL: `https://d.xplshn.com.ar/misc/cmd/1.5/AM_amd64_linux.lite.cbor.zst`
211213

212214
- [PkgForge Go repo](https://github.com/ivan-hc/am): `https://github.com/xplshn/dbin-metadata/raw/refs/heads/master/misc/cmd/1.5/pkgforge-go_amd64_linux.lite.cbor.zst`
213215
- The binaries in this repo are Go projects that have been fetched, filtered and built automagically
214-
- 10521 10521 10521 10521 10521 10521 10521 10521 <!-- GO_COUNT -->
216+
- 10531 <!-- GO_COUNT -->
215217
- URL: `https://d.xplshn.com.ar/misc/cmd/1.5/pkgforge-go_amd64_linux.lite.cbor.zst`
216218

217219
- [PkgForge Cargo repo](https://github.com/ivan-hc/am): `https://github.com/xplshn/dbin-metadata/raw/refs/heads/master/misc/cmd/1.5/pkgforge-cargo_amd64_linux.lite.cbor.zst`
218220
- The binaries in this repo are Rust projects that have been fetched, filtered and built automagically
219-
- 4583 4583 4583 4583 4583 4583 4583 4583 <!-- CARGO_COUNT -->
221+
- 4583 <!-- CARGO_COUNT -->
220222
- URL: `https://d.xplshn.com.ar/misc/cmd/1.5/pkgforge-cargo_amd64_linux.lite.cbor.zst`
221223

222224
### Libraries

main.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import (
88
"context"
99
"fmt"
1010
"os"
11+
"path/filepath"
1112
"strconv"
13+
"strings"
1214

1315
"github.com/urfave/cli/v3"
1416
)
@@ -72,10 +74,28 @@ func main() {
7274
EnableShellCompletion: true,
7375
}
7476

77+
pathDirs := strings.Split(os.Getenv("PATH"), string(os.PathListSeparator))
78+
found := false
79+
for _, dir := range pathDirs {
80+
if !found || len(pathDirs) == 0 {
81+
if dir == "." || dir == ".." {
82+
continue
83+
}
84+
if _, err := os.Stat(filepath.Join(dir, filepath.Base(os.Args[0]))); err == nil {
85+
found = true
86+
break
87+
}
88+
}
89+
}
90+
7591
if err := app.Run(context.Background(), os.Args); err != nil {
7692
fmt.Fprintf(os.Stderr, "%v\n", err)
7793
os.Exit(1)
7894
}
95+
96+
if !found {
97+
fmt.Fprintf(os.Stderr, "\n%swarning%s: dbin not in $PATH\n", yellowColor, resetColor)
98+
}
7999
}
80100

81101
func fetchRepoIndex(config *config) ([]binaryEntry, error) {

misc/cmd/dbinRepoIndexGenerators/1.4/generator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,10 @@ func main() {
526526
}
527527

528528
realArchs := map[string]string{
529-
"x86_64-Linux": "amd64_linux",
530-
"aarch64-Linux": "arm64_linux",
531-
"riscv64-Linux": "riscv64_linux",
532-
"loongarch64-Linux": "loongarch64_linux",
529+
"x86_64-Linux": "amd64_linux",
530+
"aarch64-Linux": "arm64_linux",
531+
"riscv64-Linux": "riscv64_linux",
532+
"loong64-Linux": "loongarch64_linux",
533533
}
534534

535535
// At least the amd64 repo should have succeeded in order for the fetch failure

misc/cmd/dbinRepoIndexGenerators/1.5/generator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,10 @@ func main() {
526526
}
527527

528528
realArchs := map[string]string{
529-
"x86_64-Linux": "amd64_linux",
530-
"aarch64-Linux": "arm64_linux",
531-
"riscv64-Linux": "riscv64_linux",
532-
"loongarch64-Linux": "loongarch64_linux",
529+
"x86_64-Linux": "amd64_linux",
530+
"aarch64-Linux": "arm64_linux",
531+
"riscv64-Linux": "riscv64_linux",
532+
"loong64-Linux": "loongarch64_linux",
533533
}
534534

535535
// At least the amd64 repo should have succeeded in order for the fetch failure

misc/cmd/dbinRepoIndexGenerators/1.6/generator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,10 @@ func main() {
526526
}
527527

528528
realArchs := map[string]string{
529-
"x86_64-Linux": "amd64_linux",
530-
"aarch64-Linux": "arm64_linux",
531-
"riscv64-Linux": "riscv64_linux",
532-
"loongarch64-Linux": "loongarch64_linux",
529+
"x86_64-Linux": "amd64_linux",
530+
"aarch64-Linux": "arm64_linux",
531+
"riscv64-Linux": "riscv64_linux",
532+
"loong64-Linux": "loongarch64_linux",
533533
}
534534

535535
// At least the amd64 repo should have succeeded in order for the fetch failure

0 commit comments

Comments
 (0)