sing-geoip, sing-geosite: stop packaging .db files (#495720)

This commit is contained in:
Nick Cao
2026-03-03 23:57:21 +00:00
committed by GitHub
3 changed files with 4 additions and 29 deletions
+4 -26
View File
@@ -1,36 +1,14 @@
func main() {
var err error
input := os.Args[1]
ruleSetOutput := "rule-set"
input := os.Args[1]
ruleSetOutput := "rule-set"
binary, err := os.ReadFile(input)
binary, err := os.ReadFile(input)
if err != nil {
panic(err)
}
metadata, countryMap, err := parse(binary)
if err != nil {
panic(err)
}
allCodes := make([]string, 0, len(countryMap))
for code := range countryMap {
allCodes = append(allCodes, code)
}
writer, err := newWriter(metadata, allCodes)
if err != nil {
panic(err)
}
err = write(writer, countryMap, "geoip.db", nil)
if err != nil {
panic(err)
}
writer, err = newWriter(metadata, []string{"cn"})
if err != nil {
panic(err)
}
err = write(writer, countryMap, "geoip-cn.db", []string{"cn"})
_, countryMap, err := parse(binary)
if err != nil {
panic(err)
}
-2
View File
@@ -53,8 +53,6 @@ stdenvNoCC.mkDerivation {
installPhase = ''
runHook preInstall
install -Dm644 geoip.db $out/share/sing-box/geoip.db
install -Dm644 geoip-cn.db $out/share/sing-box/geoip-cn.db
install -Dm644 rule-set/* -t $out/share/sing-box/rule-set
runHook postInstall
-1
View File
@@ -41,7 +41,6 @@ buildGoModule (finalAttrs: {
installPhase = ''
runHook preInstall
install -Dm644 geosite.db $out/share/sing-box/geosite.db
install -Dm644 rule-set/* -t $out/share/sing-box/rule-set
runHook postInstall
'';