Compare commits
15 Commits
ebc3ade4c6
...
1.1.0
Author | SHA1 | Date | |
---|---|---|---|
850ca56ff7 | |||
c6b6f6062d | |||
ba55fe2f2d | |||
e2cd817f72 | |||
8945817ba4 | |||
c0570e273b | |||
9987663dc4 | |||
1e91579e95 | |||
82bef38993 | |||
99295b0746 | |||
c518cd0023 | |||
ba34796215 | |||
dceb6a239d | |||
71068e4e40 | |||
b6e5d305d9 |
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -13,7 +12,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
32
README.md
32
README.md
@ -1,3 +1,5 @@
|
|||||||
|
# Scripts
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://gitlab.com/src_prepare/scripts/pipelines">
|
<a href="https://gitlab.com/src_prepare/scripts/pipelines">
|
||||||
<img src="https://gitlab.com/src_prepare/scripts/badges/master/pipeline.svg">
|
<img src="https://gitlab.com/src_prepare/scripts/badges/master/pipeline.svg">
|
||||||
@ -9,10 +11,10 @@
|
|||||||
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/powered-by-gentoo-linux-tyrian.svg">
|
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/powered-by-gentoo-linux-tyrian.svg">
|
||||||
</a>
|
</a>
|
||||||
<a href="./LICENSE">
|
<a href="./LICENSE">
|
||||||
<img src="https://img.shields.io/badge/license-GPLv3-blue.svg">
|
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/license-gplv3-blue.svg">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://app.element.io/#/room/#src_prepare:matrix.org">
|
<a href="https://app.element.io/#/room/#src_prepare:matrix.org">
|
||||||
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/chat-matrix-blue.svg">
|
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/chat-matrix-green.svg">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://gitlab.com/src_prepare/scripts/commits/master.atom">
|
<a href="https://gitlab.com/src_prepare/scripts/commits/master.atom">
|
||||||
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/feed-atom-orange.svg">
|
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/feed-atom-orange.svg">
|
||||||
@ -20,6 +22,30 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
# Scripts
|
# About
|
||||||
|
|
||||||
Miscellaneous maintenance scripts by src_prepare group
|
Miscellaneous maintenance scripts by src_prepare group
|
||||||
|
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
|
## Unless otherwise stated contents here are under the GNU GPL v3 license
|
||||||
|
|
||||||
|
This file is part of scripts.
|
||||||
|
|
||||||
|
scripts is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, version 3.
|
||||||
|
|
||||||
|
scripts is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Copyright (c) 2020-2021, src_prepare group
|
||||||
|
Licensed under the GNU GPL v3 License
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
76
src/check-duplicates
Executable file
76
src/check-duplicates
Executable file
@ -0,0 +1,76 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
# This file is part of scripts.
|
||||||
|
|
||||||
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 3.
|
||||||
|
|
||||||
|
# scripts is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
|
# Copyright (c) 2021, src_prepare group
|
||||||
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
# Fork of 'portdupe' from Gentoo science reporitory, original by omp:
|
||||||
|
# Copyright 2006 David Shakaryan <omp@gentoo.org>
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
# This one upgrades the license to GNU General Public License v3
|
||||||
|
|
||||||
|
# shellcheck disable=1117
|
||||||
|
|
||||||
|
|
||||||
|
trap 'exit 128' INT
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
|
||||||
|
PORTDIR="$(portageq get_repo_path / gentoo)"
|
||||||
|
|
||||||
|
|
||||||
|
# If an argument is present, use it as the overlay directory.
|
||||||
|
if [ "${1}" ]
|
||||||
|
then
|
||||||
|
cd "${1}" || exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Checking, displaying, etc.
|
||||||
|
for PACKAGE in */*
|
||||||
|
do
|
||||||
|
if [ -d "${PORTDIR}/${PACKAGE}" ] \
|
||||||
|
&& [[ $(basename "${PACKAGE}") != "CVS" ]] \
|
||||||
|
&& grep -q "$(dirname "${PACKAGE}")" "${PORTDIR}/profiles/categories"
|
||||||
|
then
|
||||||
|
# Reset versions from last package checked.
|
||||||
|
PORTPACK_VERS=""
|
||||||
|
OVERPACK_VERS=""
|
||||||
|
|
||||||
|
# Find just package name excluding category.
|
||||||
|
PACKAGE_BASE="$(basename "${PACKAGE}")"
|
||||||
|
|
||||||
|
# Find versions of package in portage.
|
||||||
|
for PORTPACK in $(find "${PORTDIR}/${PACKAGE}" -name "*.ebuild" | sed -e 's/.ebuild//')
|
||||||
|
do
|
||||||
|
PORTPACK_VER="$(basename "${PORTPACK}" | sed "s/${PACKAGE_BASE}-//")"
|
||||||
|
PORTPACK_VERS="${PORTPACK_VERS} ${PORTPACK_VER}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Find versions of package in overlay.
|
||||||
|
for OVERPACK in $(find "${PACKAGE}" -name "*.ebuild" | sed -e 's/.ebuild//')
|
||||||
|
do
|
||||||
|
OVERPACK_VER="$(basename "${OVERPACK}" | sed "s/${PACKAGE_BASE}-//")"
|
||||||
|
OVERPACK_VERS="${OVERPACK_VERS} ${OVERPACK_VER}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Output info with colors.
|
||||||
|
echo -e "\e[1;33m${PACKAGE}\e[0m"
|
||||||
|
echo -e " \e[1;35mPortage:\e[0m${PORTPACK_VERS}"
|
||||||
|
echo -e " \e[1;35mOverlay:\e[0m${OVERPACK_VERS}"
|
||||||
|
fi
|
||||||
|
done
|
@ -1,18 +1,30 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
# Original author: XGQT
|
# This file is part of scripts.
|
||||||
# Licensed under the ISC License
|
|
||||||
# Copyright (c) 2020, src_prepare group
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, version 3.
|
||||||
|
|
||||||
|
# scripts is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
|
# Copyright (c) 2020-2021, src_prepare group
|
||||||
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
# Use this script to check which pkgs in a overlay might
|
# Use this script to check which pkgs in a overlay might
|
||||||
# be redundant - are in overlays other than the tested one
|
# be redundant - are in overlays other than the tested one
|
||||||
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# 1 - overlay
|
# 1 - overlay
|
||||||
|
|
||||||
# depends (heavily) on eix (1)
|
# depends (heavily) on eix (1)
|
||||||
|
|
||||||
# Some eix options used here:
|
# Some eix options used here:
|
||||||
# --exact
|
# --exact
|
||||||
# --force-color
|
# --force-color
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ if [ -d "${cache}" ]
|
|||||||
then
|
then
|
||||||
if ! rm -fr "${cache}"
|
if ! rm -fr "${cache}"
|
||||||
then
|
then
|
||||||
sudo rm -fr "${cache}" || exit 1
|
su root -c "rm -fr ${cache}" || exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "No pre-generated md5-cache found in ${cache}"
|
echo "No pre-generated md5-cache found in ${cache}"
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
@ -26,21 +25,53 @@ set -e
|
|||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
|
|
||||||
pdir="$(git rev-parse --show-prefix)"
|
|
||||||
|
|
||||||
|
|
||||||
FEATURES="sign"
|
FEATURES="sign"
|
||||||
export FEATURES
|
export FEATURES
|
||||||
|
|
||||||
|
|
||||||
|
package_directory="$(git rev-parse --show-prefix)"
|
||||||
|
package="${package_directory%/}"
|
||||||
|
|
||||||
|
|
||||||
|
error_no_version() {
|
||||||
|
echo "[ERROR]: No version given"
|
||||||
|
echo " Ran with option: ${1}"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
if [ -z "${1}" ]
|
case "${1}"
|
||||||
then
|
in
|
||||||
|
"" )
|
||||||
|
echo "[DEBUG]: no additional arguments/options given"
|
||||||
repoman commit
|
repoman commit
|
||||||
else
|
;;
|
||||||
repoman commit -m "${pdir%/}: ${*}"
|
-b | --bump )
|
||||||
fi
|
echo "[DEBUG]: to be: ${package}: bump to ${2}"
|
||||||
|
if [ -n "${2}" ]
|
||||||
git pull --verbose
|
then
|
||||||
git push --verbose
|
repoman commit -m "${package}: bump to ${2}"
|
||||||
|
else
|
||||||
|
error_no_version "${1}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
-d | --drop )
|
||||||
|
echo "[DEBUG]: to be: ${package}: drop old ${2}"
|
||||||
|
if [ -n "${2}" ]
|
||||||
|
then
|
||||||
|
repoman commit -m "${package}: drop old ${2}"
|
||||||
|
else
|
||||||
|
error_no_version "${1}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
-* )
|
||||||
|
echo "[ERROR]: Unknown option ${1}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
echo "[DEBUG]: to be: ${package}: ${*}"
|
||||||
|
repoman commit -m "${package}: ${*}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
13
src/eball
13
src/eball
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
@ -30,9 +29,9 @@ usage() {
|
|||||||
Usage: eball FILES
|
Usage: eball FILES
|
||||||
eball - test new ebuilds
|
eball - test new ebuilds
|
||||||
|
|
||||||
Original author: XGQT
|
Original author: Maciej Barć
|
||||||
Copyright (c) 2020, src_prepare group
|
Copyright (c) 2020-2021, src_prepare group
|
||||||
Licensed under the ISC License
|
Licensed under the GPLv3
|
||||||
HELP
|
HELP
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ do
|
|||||||
if [ "$(whoami)" != root ] && [ -z "${EPREFIX}" ]
|
if [ "$(whoami)" != root ] && [ -z "${EPREFIX}" ]
|
||||||
then
|
then
|
||||||
echo "Switching to the root account"
|
echo "Switching to the root account"
|
||||||
sudo ebuild "${ebuild}" clean test merge
|
su root -c "ebuild ${ebuild} clean test merge"
|
||||||
else
|
else
|
||||||
ebuild "${ebuild}" clean test merge
|
ebuild "${ebuild}" clean test merge
|
||||||
fi
|
fi
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -6,8 +6,7 @@ This file is part of scripts.
|
|||||||
|
|
||||||
scripts is free software: you can redistribute it and/or modify
|
scripts is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, version 3.
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
scripts is distributed in the hope that it will be useful,
|
scripts is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -17,8 +16,8 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Original author: Maciej Barć (xgqt@protonmail.com)
|
Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
Copyright (c) 2020, src_prepare group
|
Copyright (c) 2020-2021, src_prepare group
|
||||||
Licensed under the GNU GPL v3 License
|
Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
Install Ebuild Dependencies
|
Install Ebuild Dependencies
|
||||||
@ -30,12 +29,13 @@ to emerge dependencies we would just do "emerge --oneshot --onlydeps PKG".
|
|||||||
|
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import sys
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Install Ebuild Dependencies",
|
description="Install Ebuild Dependencies",
|
||||||
epilog="Copyright (c) 2020, src_prepare group (License: ISC)"
|
epilog="Copyright (c) 2020-2021, src_prepare group (License: GPLv3)"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"ebuild",
|
"ebuild",
|
||||||
@ -46,16 +46,14 @@ args = parser.parse_args()
|
|||||||
|
|
||||||
|
|
||||||
def pkg_name(pkg_str):
|
def pkg_name(pkg_str):
|
||||||
"""Parse string and return a pkg name"""
|
"""
|
||||||
|
Parse string and return a pkg name.
|
||||||
|
"""
|
||||||
|
|
||||||
# TODO: don't strip but force
|
# TODO: don't strip but force
|
||||||
|
|
||||||
proper = ""
|
|
||||||
|
|
||||||
# Strip required use
|
# Strip required use
|
||||||
for i in ["["]:
|
proper = pkg_str.split("[")[0]
|
||||||
if i in pkg_str:
|
|
||||||
proper = pkg_str.split(i)[0]
|
|
||||||
|
|
||||||
# Strip conditional use
|
# Strip conditional use
|
||||||
for i in ["$", "DEPEND", "||", "!", "?", "(", ")"]:
|
for i in ["$", "DEPEND", "||", "!", "?", "(", ")"]:
|
||||||
@ -66,12 +64,21 @@ def pkg_name(pkg_str):
|
|||||||
|
|
||||||
|
|
||||||
def ebuild_deps(ebuild_file):
|
def ebuild_deps(ebuild_file):
|
||||||
"""Returns dependencies from a ebuild file"""
|
"""
|
||||||
|
Returns dependencies from a ebuild file.
|
||||||
|
"""
|
||||||
|
|
||||||
deps = []
|
deps = []
|
||||||
adddeps = False
|
adddeps = False
|
||||||
|
|
||||||
with open(ebuild_file) as ebuild:
|
with open(ebuild_file) as ebuild:
|
||||||
for line in ebuild.read().splitlines():
|
for line in ebuild.read().splitlines():
|
||||||
if adddeps:
|
|
||||||
|
# TODO: Find a better way to find the depend "block"
|
||||||
|
if "DEPEND" in line:
|
||||||
|
adddeps = True
|
||||||
|
|
||||||
|
elif adddeps:
|
||||||
# TODO: Find a better pkg match method
|
# TODO: Find a better pkg match method
|
||||||
if "/" in line:
|
if "/" in line:
|
||||||
deps.append(
|
deps.append(
|
||||||
@ -79,16 +86,20 @@ def ebuild_deps(ebuild_file):
|
|||||||
)
|
)
|
||||||
elif "\"" in line:
|
elif "\"" in line:
|
||||||
adddeps = False
|
adddeps = False
|
||||||
# TODO: Find a better way to find the depend "block"
|
|
||||||
elif "DEPEND" in line:
|
|
||||||
adddeps = True
|
|
||||||
return deps
|
return deps
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""The main function"""
|
"""
|
||||||
|
The main function.
|
||||||
|
"""
|
||||||
print("Ebuilds:", args.ebuild)
|
print("Ebuilds:", args.ebuild)
|
||||||
|
|
||||||
|
if args.ebuild == []:
|
||||||
|
print("[ERROR]: No ebuilds given")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
all_deps = []
|
all_deps = []
|
||||||
|
|
||||||
for ebuild in args.ebuild:
|
for ebuild in args.ebuild:
|
||||||
|
@ -6,8 +6,7 @@ This file is part of scripts.
|
|||||||
|
|
||||||
scripts is free software: you can redistribute it and/or modify
|
scripts is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, version 3.
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
scripts is distributed in the hope that it will be useful,
|
scripts is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -17,7 +16,7 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Original author: Maciej Barć (xgqt@protonmail.com)
|
Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
Copyright (c) 2020, src_prepare group
|
Copyright (c) 2020, src_prepare group
|
||||||
Licensed under the GNU GPL v3 License
|
Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
@ -27,7 +26,7 @@ trap 'exit 128' INT
|
|||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
|
|
||||||
ebuild_template='# Copyright 1999-2020 Gentoo Authors
|
ebuild_template='# Copyright 1999-2021 Gentoo Authors
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI=7
|
EAPI=7
|
||||||
@ -55,10 +54,20 @@ BDEPEND=""
|
|||||||
DEPEND=""
|
DEPEND=""
|
||||||
RDEPEND=""'
|
RDEPEND=""'
|
||||||
|
|
||||||
metadata_template='<?xml version="1.0" encoding="UTF-8"?>
|
metadata_template="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
<!DOCTYPE pkgmetadata SYSTEM \"http://www.gentoo.org/dtd/metadata.dtd\">
|
||||||
<pkgmetadata>
|
<pkgmetadata>
|
||||||
</pkgmetadata>'
|
<maintainer type=\"person\">
|
||||||
|
<email>$(git config --get user.email)</email>
|
||||||
|
<name>$(git config --get user.name)</name>
|
||||||
|
</maintainer>
|
||||||
|
<longdescription lang=\"en\">
|
||||||
|
CHANGEME
|
||||||
|
</longdescription>
|
||||||
|
<upstream>
|
||||||
|
<remote-id type=\"CHANGEME\">CHANGEME</remote-id>
|
||||||
|
</upstream>
|
||||||
|
</pkgmetadata>"
|
||||||
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
5
src/pn
5
src/pn
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
5
test.sh
5
test.sh
@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
# scripts is free software: you can redistribute it and/or modify
|
# scripts is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
# the Free Software Foundation, version 3.
|
||||||
# (at your option) any later version.
|
|
||||||
|
|
||||||
# scripts is distributed in the hope that it will be useful,
|
# scripts is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
@ -16,7 +15,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
# along with scripts. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Original author: Maciej Barć (xgqt@protonmail.com)
|
# Original author: Maciej Barć <xgqt@riseup.net>
|
||||||
# Copyright (c) 2020, src_prepare group
|
# Copyright (c) 2020, src_prepare group
|
||||||
# Licensed under the GNU GPL v3 License
|
# Licensed under the GNU GPL v3 License
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user