-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecompile_pkgdir.sh
executable file
·65 lines (51 loc) · 1.81 KB
/
recompile_pkgdir.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# Author & Copyright holder: Rogentos Team, 2018-2019
# LICENSE: GPL v2
# This script recompiles simple packages which
# are not installed on the system, and are present in $PKGDIR
set -x
if [[ -e "/etc/portage/make.conf" ]] ; then
. /etc/portage/make.conf
if [[ -z ${PKGDIR} ]] ; then
export PKGDIR="${PKGDIR:-/usr/portage/packages}"
else
export PKGDIR="${PKGDIR:-}"
fi
else
export PKGDIR="${PKGDIR:-/usr/portage/packages}"
fi
cd ${PKGDIR}
# Section that gives the user the power to input PKG_INPUT_ARGUMENT
# the argument is passed to the finder, within the $PKGDIR folder
# any folder that gets found with that pattern, the script will compile everything
# within it
export PKG_INPUT_ARGUMENT="${PKG_INPUT_ARGUMENT:-}"
if [[ -z "${PKG_INPUT_ARGUMENT}" ]] ; then
echo -e ""
echo -e "Compiling folders:"
export local PKG_FIND_LS_CMD="${PKG_FIND_LS_CMD:-$(ls | sed -e '/Packages/d')}"
echo -e ""
else
echo -e "You are recompiling everything with pattern: $PKG_INPUT_ARGUMENT"
export local PKG_FIND_LS_CMD="$(ls | sed -e '/Packages/d' | grep "${PKG_INPUT_ARGUMENT}" )"
fi
# updating portage structures before any action taken
epkg update
# nothing else than category packages should be here
# if there is something else, please make sure you exclude it
for d in $( echo $PKG_FIND_LS_CMD ) ; do
if [[ -d "$d" ]] ; then
cd $d
for i in $( ls | grep tbz2 | sed -e 's/.tbz2//g' ) ; do
export local_pwd=$d
export local PKGDIR_COUNT_LSTDIR="${local_pwd%"${local_pwd##*[!/]}"}"
export local PKGDIR_COUNT_LSTDIR="${PKGDIR_COUNT_LSTDIR##*/}"
if [[ -z $(qlist -Iv | grep $( echo $PKGDIR_COUNT_LSTDIR)/$i ) ]] ; then
epkg autobuildpkgonly --skip-update =$( echo $PKGDIR_COUNT_LSTDIR)/$i --keep-going y
fi
done
cd ../
else
echo -e "$d is not a folder. Skipping.."
fi
done