summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-portage/drizzt-scripts/files/fix_overlay')
-rw-r--r--app-portage/drizzt-scripts/files/fix_overlay24
1 files changed, 24 insertions, 0 deletions
diff --git a/app-portage/drizzt-scripts/files/fix_overlay b/app-portage/drizzt-scripts/files/fix_overlay
new file mode 100644
index 0000000..b2faa3e
--- /dev/null
+++ b/app-portage/drizzt-scripts/files/fix_overlay
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+source /sbin/functions.sh
+
+if [[ ! -f "${1:-.}"/profiles/repo_name ]]; then
+ eerror "You need to create profiles/repo_name"
+ exit 1
+fi
+
+ebegin "Generating thirdpartymirrors"
+if type -p paludis &>/dev/null; then
+ fgrep -lr --include '*.ebuild' mirror:// "${1:-.}" | sed 's|^\./\([^/]*\)/[^/]*\(/[^/]*\).ebuild$|=\1\2::'"$(<"${1:-.}"/profiles/repo_name)"'|' | xargs paludis -qM | grep '^[[:space:]]*SRC_URI: ' | sed -e 's|mirror://[^ ]*|\n&\n|g' | sed -ne '/mirror/s|mirror://\([^/]*\)[^ ]*|\1|gp' | sort -u | xargs -i% grep '^%[[:space:]]' "$(paludis --configuration-variable gentoo location)"/profiles/thirdpartymirrors > "${1:-.}"/profiles/thirdpartymirrors
+else
+ fgrep -r --include '*.ebuild' mirror:// "${1:-.}" | sed 's|^.*mirror://\([^/]*\).*|\1|' | sort -u | xargs -i% grep '^%[[:space:]]' "$(portageq portdir)"/profiles/thirdpartymirrors > "${1:-.}"/profiles/thirdpartymirrors
+fi
+eend
+
+ebegin "Generating categories"
+find "${1:-.}" -maxdepth 1 -mindepth 1 -type d -not -name profiles -not -name '.*' | sed 's:^.*/::' | sort > "${1:-.}"/profiles/categories
+eend
+
+ebegin "Generating arch.list"
+find "${1:-.}" -name '*.ebuild' | sed 's|^\./\([^/]*\)/[^/]*\(/[^/]*\).ebuild$|=\1\2::'"$(<"${1:-.}"/profiles/repo_name)"'|' | xargs paludis -qM | grep '^[[:space:]]*KEYWORDS: ' | cut -d : -f 2- | sed -e 's/-\*//g' -e 's/\([[:space:]]\)[~-]/\1/g' -e 's/^[[:space:]]*//' -e 's/ /\n/g' | sort -u > "${1:-.}"/profiles/arch.list
+eend