package Variables
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
const (
|
|
ConfigDir string = "/etc/tjpkg"
|
|
DatabaseName string = "package_manager.db"
|
|
FsHashDatabaseName string = "fs_hash.db"
|
|
)
|
|
|
|
var (
|
|
Editor string = "vi"
|
|
|
|
VerboseOutput bool = false
|
|
IgnoreDepsCheck bool = false
|
|
|
|
RootDir string = "/"
|
|
FsHashPicksBucket []byte = []byte("FilesystemPicks")
|
|
FsHashIndexBucket []byte = []byte("FilesystemIndex")
|
|
|
|
PruneRegexPaths []string = []string{
|
|
ConfigDir,
|
|
"^/\\.git$",
|
|
"^/dist$",
|
|
"^/sources$",
|
|
"^/boot/grub$",
|
|
"^/proc$",
|
|
"^/dev$",
|
|
"^/mnt$",
|
|
"^/sys$",
|
|
"^/src$",
|
|
"^/root$",
|
|
"^/home$",
|
|
"^/build$",
|
|
"^/tools$",
|
|
"^/opt$",
|
|
"^/run/user$",
|
|
"^/usr/share/zsh$",
|
|
"^/usr/share/texmf-dist$",
|
|
"^/usr/share/zoneinfo$",
|
|
"^/usr/share/zoneinfo-leaps$",
|
|
"^/tmp$",
|
|
"^/var/db$",
|
|
"^/var/cache$",
|
|
"^/var/log$",
|
|
"^/var/spool$",
|
|
"^/var/lib/texmf$",
|
|
"^/var/lib/postgres$",
|
|
"^/var/lib/pacman$",
|
|
"^/var/lib/NetworkManager$",
|
|
"^/var/lib/systemd$",
|
|
"^/var/lib/xkb/README.compiled$",
|
|
"/lost\\+found$",
|
|
}
|
|
|
|
IgnoreRegexPaths []string = []string{
|
|
os.Args[0],
|
|
"^/usr/share/info/dir$",
|
|
"^/swapfile$",
|
|
"^/etc/passwd$",
|
|
"^/etc/passwd-$",
|
|
"^/etc/group$",
|
|
"^/etc/group-$",
|
|
"^/var/.updated$",
|
|
"^/var/lib/mlocate/mlocate.db$",
|
|
"^/var/lib/krb5kdc/kdc.conf$",
|
|
"^/var/lib/alsa/asound.state$",
|
|
"^/run/systemd/journal/kernel-seqnum$",
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
var (
|
|
rootDir string
|
|
editor string
|
|
)
|
|
rootDir = os.Getenv("ROOTDIR")
|
|
if rootDir != "" {
|
|
RootDir = rootDir
|
|
}
|
|
editor = os.Getenv("EDITOR")
|
|
if editor != "" {
|
|
Editor = editor
|
|
}
|
|
|
|
}
|