Compare commits

10 Commits

Author SHA1 Message Date
1e91579e95 src/check-duplicates: to make debian shellcheck happy
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-02-14 23:35:43 +01:00
82bef38993 src/check-redundant: update copyright
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-02-14 23:33:03 +01:00
99295b0746 src/check-duplicates: new script
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-02-14 23:32:09 +01:00
c518cd0023 src: use su instead of sudo
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-01-29 20:05:50 +01:00
ba34796215 src/new-ebuild: use tabs in tamplates
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-01-20 19:08:28 +01:00
dceb6a239d src/new-ebuild: upgrade metadata template
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-01-18 14:31:54 +01:00
71068e4e40 src/new-ebuild: 2021 update - bump copyright date
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2021-01-02 02:54:29 +01:00
b6e5d305d9 README.md: update badges
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2020-12-29 22:46:33 +01:00
ebc3ade4c6 README.md: update
Signed-off-by: Maciej Barć <xgqt@protonmail.com>
2020-12-29 21:26:14 +01:00
80202c3151 Changing name and license
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2020-12-29 20:22:11 +00:00
7 changed files with 144 additions and 31 deletions

View File

@ -2,19 +2,24 @@
<a href="https://gitlab.com/src_prepare/scripts/pipelines">
<img src="https://gitlab.com/src_prepare/scripts/badges/master/pipeline.svg">
</a>
<a href="https://gitlab.com/src_prepare/scripts/">
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/hosted_on-gitlab-orange.svg">
</a>
<a href="https://gentoo.org/">
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/powered-by-gentoo-linux-tyrian.svg">
</a>
<a href="./LICENSE">
<img src="https://img.shields.io/badge/license-ISC-blue.svg">
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/license-gplv3-blue.svg">
</a>
<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 href="https://gitlab.com/src_prepare/scripts/commits/master.atom">
<img src="https://gitlab.com/src_prepare/badge/-/raw/master/feed-atom-orange.svg">
</a>
</p>
# Scripts
Miscellaneous maintenance scripts by src_prepare group

77
src/check-duplicates Executable file
View File

@ -0,0 +1,77 @@
#!/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, either version 3 of the License, or
# (at your option) any later version.
# 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@protonmail.com>
# 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

View File

@ -1,18 +1,31 @@
#!/bin/sh
# Original author: XGQT
# Licensed under the ISC License
# Copyright (c) 2020, src_prepare group
# 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, either version 3 of the License, or
# (at your option) any later version.
# 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@protonmail.com>
# 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
# be redundant - are in overlays other than the tested one
# Arguments:
# 1 - overlay
# depends (heavily) on eix (1)
# Some eix options used here:
# --exact
# --force-color

View File

@ -34,7 +34,7 @@ if [ -d "${cache}" ]
then
if ! rm -fr "${cache}"
then
sudo rm -fr "${cache}" || exit 1
su root -c "rm -fr ${cache}" || exit 1
fi
else
echo "No pre-generated md5-cache found in ${cache}"

View File

@ -56,7 +56,7 @@ do
if [ "$(whoami)" != root ] && [ -z "${EPREFIX}" ]
then
echo "Switching to the root account"
sudo ebuild "${ebuild}" clean test merge
su root -c "ebuild ${ebuild} clean test merge"
else
ebuild "${ebuild}" clean test merge
fi

View File

@ -1,15 +1,23 @@
#!/usr/bin/env bash
####################################################
#
# SRC_PREPARE
#
# Marcin Woźniak
# y0rune@aol.com
#
# Last edit: 16-09-2020
#
###################################################
# 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, either version 3 of the License, or
# (at your option) any later version.
# 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: Marcin Woźniak (y0rune@aol.com)
# Copyright (c) 2020, src_prepare group
# Licensed under the GNU GPL v3 License
function scanning(){
EUSCAN=$(euscan --nocolor --quiet "$1")
@ -73,8 +81,8 @@ function help(){
echo "* -f or --folder <FOLDER-NAME>"
echo
echo "Example of usage"
echo "./logeuscan -r src_prepare-overlay"
echo "./logeuscan -f ~/git/src_prepare-overlay"
echo "./euscan-parallel -r src_prepare-overlay"
echo "./euscan-parallel -f ~/git/src_prepare-overlay"
}
function main(){

View File

@ -27,7 +27,7 @@ trap 'exit 128' INT
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
EAPI=7
@ -55,10 +55,20 @@ BDEPEND=""
DEPEND=""
RDEPEND=""'
metadata_template='<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
metadata_template="<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE pkgmetadata SYSTEM \"http://www.gentoo.org/dtd/metadata.dtd\">
<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() {