Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
def0553167 | |||
b19af6d421 | |||
5014c7ea0a | |||
3cb97935eb | |||
ad1cac023c | |||
1f4b1ba97e | |||
3165165e73 | |||
4f801eff26 | |||
8251e8b461 | |||
c194f4956d | |||
d58228cd43 |
@ -1,70 +0,0 @@
|
||||
version: 2
|
||||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
builds:
|
||||
- id: distrohop
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
binary: distrohop
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- '386'
|
||||
- arm64
|
||||
- arm
|
||||
- riscv64
|
||||
archives:
|
||||
- files:
|
||||
- distrohop.service
|
||||
nfpms:
|
||||
- id: distrohop
|
||||
description: "A utility for correlating and identifying equivalent software packages across different Linux distributions"
|
||||
homepage: 'https://gitea.elara.ws/Elara6331/distrohop'
|
||||
maintainer: 'Elara Ivy <elara@elara.ws>'
|
||||
license: AGPLv3
|
||||
formats:
|
||||
- deb
|
||||
- rpm
|
||||
- archlinux
|
||||
provides:
|
||||
- distrohop
|
||||
conflicts:
|
||||
- distrohop
|
||||
contents:
|
||||
- src: distrohop.service
|
||||
dst: /etc/systemd/system/distrohop.service
|
||||
aurs:
|
||||
- name: distrohop-bin
|
||||
homepage: 'https://gitea.elara.ws/Elara6331/distrohop'
|
||||
description: "A utility for correlating and identifying equivalent software packages across different Linux distributions"
|
||||
maintainers:
|
||||
- 'Elara Ivy <elara@elara.ws>'
|
||||
license: AGPLv3
|
||||
private_key: '{{ .Env.AUR_KEY }}'
|
||||
git_url: 'ssh://aur@aur.archlinux.org/distrohop-bin.git'
|
||||
provides:
|
||||
- distrohop
|
||||
conflicts:
|
||||
- distrohop
|
||||
package: |-
|
||||
# binaries
|
||||
install -Dm755 ./distrohop "${pkgdir}/usr/bin/distrohop"
|
||||
|
||||
# services
|
||||
install -Dm644 ./distrohop.service "${pkgdir}/etc/systemd/system/distrohop.service"
|
||||
release:
|
||||
gitea:
|
||||
owner: Elara6331
|
||||
name: distrohop
|
||||
gitea_urls:
|
||||
api: 'https://gitea.elara.ws/api/v1/'
|
||||
download: 'https://gitea.elara.ws'
|
||||
skip_tls_verify: false
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
snapshot:
|
||||
name_template: "{{ incpatch .Version }}-next"
|
||||
changelog:
|
||||
sort: asc
|
20
.nfpm.yaml
Normal file
20
.nfpm.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
name: distrohop
|
||||
description: "A utility for correlating and identifying equivalent software packages across different Linux distributions"
|
||||
homepage: 'https://gitea.elara.ws/Elara6331/distrohop'
|
||||
maintainer: 'Elara Ivy <elara@elara.ws>'
|
||||
license: AGPLv3
|
||||
arch: ${ARCH}
|
||||
version: ${VERSION}
|
||||
provides:
|
||||
- distrohop
|
||||
conflicts:
|
||||
- distrohop
|
||||
contents:
|
||||
- src: distrohop
|
||||
dst: /usr/bin/distrohop
|
||||
file_info:
|
||||
mode: 0755
|
||||
- src: distrohop.service
|
||||
dst: /etc/systemd/system/distrohop.service
|
||||
file_info:
|
||||
mode: 0644
|
@ -1,30 +0,0 @@
|
||||
labels:
|
||||
platform: linux/amd64
|
||||
|
||||
steps:
|
||||
- name: docker
|
||||
image: gitea.elara.ws/elara6331/builder
|
||||
commands:
|
||||
- registry-login
|
||||
- ko build -B --platform=linux/amd64,linux/arm64,linux/riscv64 -t latest,${CI_COMMIT_TAG} --sbom=none
|
||||
environment:
|
||||
REGISTRY: gitea.elara.ws
|
||||
REGISTRY_USERNAME: Elara6331
|
||||
KO_DOCKER_REPO: gitea.elara.ws/elara6331
|
||||
KO_DEFAULTBASEIMAGE: gitea.elara.ws/elara6331/static-root
|
||||
REGISTRY_PASSWORD:
|
||||
from_secret: registry_password
|
||||
when:
|
||||
event: tag
|
||||
|
||||
- name: release
|
||||
image: goreleaser/goreleaser
|
||||
commands:
|
||||
- goreleaser release
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
AUR_KEY:
|
||||
from_secret: aur_key
|
||||
when:
|
||||
event: tag
|
55
.woodpecker/build.yml
Normal file
55
.woodpecker/build.yml
Normal file
@ -0,0 +1,55 @@
|
||||
matrix:
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
|
||||
labels:
|
||||
platform: ${platform}
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
image: golang:1.23.6
|
||||
commands:
|
||||
- go build
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
when:
|
||||
- event: tag
|
||||
|
||||
- name: docker
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
settings:
|
||||
registry: gitea.elara.ws
|
||||
repo: elara6331/distrohop
|
||||
tags: ${platform##linux/}
|
||||
cache: true
|
||||
username: elara6331
|
||||
password:
|
||||
from_secret: gitea_token
|
||||
when:
|
||||
event: tag
|
||||
|
||||
- name: nfpm
|
||||
image: goreleaser/nfpm
|
||||
environment:
|
||||
ARCH: ${platform##linux/}
|
||||
VERSION: ${CI_COMMIT_TAG##v}
|
||||
commands:
|
||||
- nfpm pkg -f .nfpm.yaml -p deb -t .
|
||||
- nfpm pkg -f .nfpm.yaml -p rpm -t .
|
||||
- nfpm pkg -f .nfpm.yaml -p archlinux -t .
|
||||
when:
|
||||
event: tag
|
||||
|
||||
- name: release
|
||||
image: gitea.elara.ws/elara6331/woodpecker-release
|
||||
settings:
|
||||
title: "Version ${CI_COMMIT_TAG##v}"
|
||||
files:
|
||||
- '*.deb'
|
||||
- '*.rpm'
|
||||
- '*.tar.zst'
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
when:
|
||||
event: tag
|
19
.woodpecker/manifest.yml
Normal file
19
.woodpecker/manifest.yml
Normal file
@ -0,0 +1,19 @@
|
||||
labels:
|
||||
platform: linux/amd64
|
||||
|
||||
steps:
|
||||
- name: manifest
|
||||
image: gcr.io/go-containerregistry/crane:debug
|
||||
entrypoint: ["/busybox/sh", "-c", "echo $CI_SCRIPT | base64 -d | /busybox/sh -e"]
|
||||
commands:
|
||||
- "crane auth login -u elara6331 -p $REGISTRY_TOKEN gitea.elara.ws"
|
||||
- "crane index append -m gitea.elara.ws/elara6331/distrohop:amd64 -m gitea.elara.ws/elara6331/distrohop:arm64 -t gitea.elara.ws/elara6331/distrohop:latest"
|
||||
- "crane index append -m gitea.elara.ws/elara6331/distrohop:amd64 -m gitea.elara.ws/elara6331/distrohop:arm64 -t gitea.elara.ws/elara6331/distrohop:${CI_COMMIT_TAG}"
|
||||
environment:
|
||||
REGISTRY_TOKEN:
|
||||
from_secret: gitea_token
|
||||
when:
|
||||
- event: tag
|
||||
|
||||
depends_on:
|
||||
- build
|
3
Dockerfile
Normal file
3
Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM gitea.elara.ws/elara6331/static-root:latest
|
||||
COPY distrohop /bin/distrohop
|
||||
ENTRYPOINT [ "/bin/distrohop" ]
|
@ -1,10 +1,14 @@
|
||||
<p align="center">
|
||||
<img width="250" src="assets/logo/distrohop-text-bottom.svg">
|
||||
</p>
|
||||
<p align="center">
|
||||
<img alt="GitHub go.mod Go version" src="https://img.shields.io/github/go-mod/go-version/Elara6331/distrohop?style=for-the-badge"> 
|
||||
<a href="https://goreportcard.com/report/go.elara.ws/distrohop"><img src="https://goreportcard.com/badge/go.elara.ws/distrohop?style=for-the-badge"></a>
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
**DistroHop** is a tool that helps you compare Linux packages across different distributions. It lets you search for a package from one distro in another's repositories or look for a specific item you need.
|
||||
**DistroHop** is a tool that helps you compare Linux packages across different distributions. It lets you search for a package from one distro in another's repositories or look for a specific item you need. You can try it out at [hop.lure.sh](https://hop.lure.sh/)
|
||||
|
||||
## How does it work?
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
iconset="${1%%:*}"
|
||||
icon="${1#*:}"
|
||||
|
||||
BASE_DIR="./cmd/distrohop/assets/icons"
|
||||
BASE_DIR="./assets/icons"
|
||||
|
||||
mkdir -p "$BASE_DIR/$iconset"
|
||||
wget -4 -O "$BASE_DIR/$iconset/$icon.svg" "https://api.iconify.design/$iconset/$icon.svg"
|
||||
|
1
assets/icons/material-symbols/info-outline.svg
Normal file
1
assets/icons/material-symbols/info-outline.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg id="icon" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24"><path fill="currentColor" d="M11 17h2v-6h-2zm1-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8"/></svg>
|
After Width: | Height: | Size: 474 B |
@ -6,6 +6,7 @@ After=network.target
|
||||
ExecStart=distrohop
|
||||
Restart=always
|
||||
StandardOutput=journal
|
||||
Environment=HOME=/root
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
2
main.go
2
main.go
@ -97,7 +97,7 @@ func main() {
|
||||
if err == nil {
|
||||
// Add the index store to the combined store for the repo
|
||||
cs.Add(s)
|
||||
} else if err != nil {
|
||||
} else {
|
||||
log.Error("Error opening database", slog.Any("error", err))
|
||||
os.Exit(1)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
@ -54,7 +54,15 @@
|
||||
|
||||
<div x-cloak x-transition:enter x-show="activeTab == 'pkg'" class="columns">
|
||||
<form x-data="{'suggestions': []}" class="column is-half is-offset-one-quarter has-text-centered" action="/search/pkg">
|
||||
<label class="label" for="from">Search For:</label>
|
||||
<label class="label mb-0" for="from">Search For:</label>
|
||||
<div class="icon-text has-text-grey">
|
||||
<span class="icon is-aligned">#icon("material-symbols/info-outline")</span>
|
||||
<p class="is-size-7 has-text-grey">
|
||||
Try searching for archlinux
|
||||
<a href="/search/pkg?from=archlinux&pkg=firefox&in=debian-bookworm"><code>firefox</code></a>
|
||||
in debian-bookworm.
|
||||
</p>
|
||||
</div>
|
||||
<div class="field has-addons is-align-self-stretch" id="from">
|
||||
<div class="control">
|
||||
<span class="select">
|
||||
@ -80,12 +88,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="label" for="in">In:</label>
|
||||
<div class="field is-align-self-stretch" id="in">
|
||||
<p class="control">
|
||||
<span class="select is-fullwidth">
|
||||
<select name="in" autocomplete="off" required>
|
||||
<option selected disabled value="">Select Repo...</option>
|
||||
<option selected disabled value="">Search In...</option>
|
||||
#for(repo in cfg.Repos):
|
||||
<option>#(repo.Name)</option>
|
||||
#!for
|
||||
@ -96,7 +103,7 @@
|
||||
|
||||
<div class="field mt-4 is-align-self-stretch">
|
||||
<p class="control">
|
||||
<button class="button is-dark is-rounded is-fullwidth" type="submit">
|
||||
<button class="button is-info is-inverted is-rounded is-fullwidth" type="submit">
|
||||
<div class="icon-text">
|
||||
<span class="icon is-aligned m-0">#icon("map/search")</span>
|
||||
<span>Search</span>
|
||||
@ -110,11 +117,17 @@
|
||||
<div x-cloak x-data="{tags: []}" x-transition:enter x-show="activeTab == 'tags'" class="columns">
|
||||
<div class="column is-half is-offset-one-quarter has-text-centered">
|
||||
<form action="/search/tags" x-ref="tagsForm">
|
||||
<template x-if="tags.length == 0">
|
||||
<div class="has-text-centered">
|
||||
<p class="is-size-5">Tags you add will appear here...</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="field is-grouped is-grouped-multiline">
|
||||
<template x-for="(tag, idx) in tags">
|
||||
<div>
|
||||
<div class="tags has-addons">
|
||||
<span class="tag is-dark has-background-info-dark has-text-info-light" x-text="tag[0]"></span><span class="tag is-dark" x-text="tag[1]"></span><a class="tag is-delete m-0" @click.prevent="tags.splice(idx, 1)"></a>
|
||||
<span class="tag is-dark has-background-info-dark has-text-info-light" x-text="tag[0]"></span><span class="tag is-dark" x-text="tag[1]"></span><a class="tag is-dark is-delete m-0" @click.prevent="tags.splice(idx, 1)"></a>
|
||||
</div>
|
||||
<input class="is-hidden" name="tag" :value="tag.join('=')">
|
||||
</div>
|
||||
@ -122,7 +135,17 @@
|
||||
<span></span>
|
||||
</div>
|
||||
|
||||
<div class="mt-5 field has-addons">
|
||||
<div class="icon-text mt-5 has-text-grey">
|
||||
<span class="icon is-aligned">#icon("material-symbols/info-outline")</span>
|
||||
<p class="is-size-7 has-text-grey">
|
||||
Try searching for
|
||||
<code class="is-clickable" @click="tags.push(['lib', 'pcre2-8'])">lib=pcre2-8</code>,
|
||||
<code class="is-clickable" @click="tags.push(['lib', 'libaudit.so.1'])">lib=libaudit.so.1</code>,
|
||||
<code class="is-clickable" @click="tags.push(['bin', 'firefox'])">bin=firefox</code>,
|
||||
etc.
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-0 field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<input @keydown.comma.prevent="pushTag(tags, $refs.newTagInput)" class="input" x-ref="newTagInput" placeholder="bin=nano">
|
||||
</div>
|
||||
@ -149,7 +172,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button class="button is-dark is-rounded is-fullwidth" type="submit">
|
||||
<button class="button is-info is-inverted is-rounded is-fullwidth" type="submit">
|
||||
<div class="icon-text">
|
||||
<span class="icon is-aligned m-0">#icon("map/search")</span>
|
||||
<span>Search</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user