- removed old Gentoo-specific scripts
- merged sbin into bin - new locale en_AG
This commit is contained in:
parent
9a43b35125
commit
38026cdc1a
14 changed files with 34 additions and 156 deletions
|
@ -1,71 +0,0 @@
|
|||
#! /usr/bin/env python3
|
||||
# encoding: utf-8
|
||||
|
||||
import glob
|
||||
import re
|
||||
import sys
|
||||
|
||||
def is_a_version(token):
|
||||
"""
|
||||
Returns True iff token is a portage version spec (i.e. contains only numbers or ".").
|
||||
"""
|
||||
|
||||
for A in token:
|
||||
a = ord(A)
|
||||
if not (0x30 <= a <= 0x39 or a == 0x2e):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def strip_version(atom):
|
||||
"""
|
||||
Removes the =version-123 spec from a portage atom.
|
||||
|
||||
Works like 99% of the time. Good enough for the girls I go out with.
|
||||
"""
|
||||
|
||||
parts = atom[1:].split("-")
|
||||
wanted = []
|
||||
|
||||
for part in parts:
|
||||
if is_a_version(part):
|
||||
break
|
||||
|
||||
wanted.append(part)
|
||||
|
||||
return "-".join(wanted)
|
||||
|
||||
def grep(exp, filename):
|
||||
with open(filename) as f:
|
||||
matches = re.findall(exp, f.read())
|
||||
|
||||
return matches
|
||||
|
||||
def find_reverse_deps(deps, version=True):
|
||||
all_dep_files = glob.glob("/var/db/pkg/*/*/*DEPEND")
|
||||
|
||||
regexp = "(%s)[^:]*:[^/]+/[^=]+=" %("|".join(deps))
|
||||
matching_files = set(f for f in all_dep_files if grep(regexp, f))
|
||||
atoms = {"=" + f[12:].rsplit("/", 1)[0] for f in matching_files}
|
||||
|
||||
if not version:
|
||||
atoms = {strip_version(a) for a in atoms}
|
||||
|
||||
return atoms
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1:
|
||||
if sys.argv[1] == "-v":
|
||||
version = False
|
||||
targets = sys.argv[2:]
|
||||
else:
|
||||
version = True
|
||||
targets = sys.argv[1:]
|
||||
|
||||
atoms = find_reverse_deps(targets, version)
|
||||
print(" ".join(sorted(atoms)))
|
||||
else:
|
||||
print("Usage: %s DEPENDENCY [more DEPENDENCIES...]" %(sys.argv[0]))
|
||||
print("Finds all reverse deps of DEPENDENCY")
|
||||
|
||||
sys.exit(1)
|
|
@ -1,18 +0,0 @@
|
|||
#! /bin/bash
|
||||
|
||||
KERNEL_UPDATE_CMD="cave resolve --preserve-world --lazy kernel-modules"
|
||||
|
||||
buildkernel --ask --verbose && \
|
||||
$KERNEL_UPDATE_CMD
|
||||
|
||||
echo -n '>>> Type "yes" to do the above. '
|
||||
read Q
|
||||
|
||||
if [[ $Q == "yes" ]]; then
|
||||
echo ">>> Executing."
|
||||
$KERNEL_UPDATE_CMD -x
|
||||
|
||||
if [[ -d /usr/lib64/opengl/nvidia ]]; then
|
||||
rm -f /opt/bin/nvidia-* /usr/bin/nvidia-*
|
||||
fi
|
||||
fi
|
|
@ -1,19 +0,0 @@
|
|||
#! /bin/zsh
|
||||
# encoding: utf-8
|
||||
|
||||
for arg in $@
|
||||
do
|
||||
if [[ "$arg" =~ "::" ]]; then
|
||||
suffix=""
|
||||
else
|
||||
suffix="::gentoo"
|
||||
fi
|
||||
|
||||
cave perform fetch "${arg}${suffix}" && \
|
||||
cave perform install --destination installed "${arg}${suffix}"
|
||||
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo "!!! failed during $arg"
|
||||
exit 1
|
||||
fi
|
||||
done
|
3
bin/sc-0-sync
Executable file
3
bin/sc-0-sync
Executable file
|
@ -0,0 +1,3 @@
|
|||
#! /bin/zsh
|
||||
|
||||
cave sync
|
3
bin/sc-01-sync-resolve
Executable file
3
bin/sc-01-sync-resolve
Executable file
|
@ -0,0 +1,3 @@
|
|||
#! /bin/zsh
|
||||
|
||||
sc-0-sync && sc-1-resolve
|
3
bin/sc-1-resolve
Executable file
3
bin/sc-1-resolve
Executable file
|
@ -0,0 +1,3 @@
|
|||
#! /bin/zsh
|
||||
|
||||
cave resolve --complete --slots installed-or-best --recommendations display world $@
|
15
bin/sc-2-cleanup
Executable file
15
bin/sc-2-cleanup
Executable file
|
@ -0,0 +1,15 @@
|
|||
#! /bin/zsh
|
||||
|
||||
setopt EXTENDED_GLOB
|
||||
|
||||
cave purge --complete
|
||||
|
||||
echo -n '>>> Type "yes" to do the above. '
|
||||
read Q
|
||||
|
||||
if [[ $Q == "yes" ]]; then
|
||||
echo ">>> Aight."
|
||||
cave purge --complete -x
|
||||
fi
|
||||
|
||||
cave fix-linkage ${1}
|
5
bin/sc-3-regen
Executable file
5
bin/sc-3-regen
Executable file
|
@ -0,0 +1,5 @@
|
|||
#! /bin/zsh
|
||||
|
||||
cave fix-cache
|
||||
#prelink -amR # this makes Paludis leave old binaries and libraries around because it thinks they've been modified
|
||||
updatedb
|
Loading…
Add table
Add a link
Reference in a new issue