summaryrefslogtreecommitdiff
path: root/src/chroot-tools
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-08-14 23:05:30 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-11-20 22:53:31 -0500
commite287e95fb62f8aad77b809e478026659cc974282 (patch)
treef701a7806fef40f141b3fee952f67eeda529c220 /src/chroot-tools
parent1b77376ca488957cacdc8a0eccf9bd833339fd66 (diff)
allow building replacements for existing blacklist entries
libremakepkg will refuse to build a blacklisted package, if no libre replacement had been published before the next repo sync this change warns instead, and prompts for confirmation see note in src/chroot-tools/hooks-check.sh::check_pkgbuild_nonfree()
Diffstat (limited to 'src/chroot-tools')
-rw-r--r--src/chroot-tools/hooks-check.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/chroot-tools/hooks-check.sh b/src/chroot-tools/hooks-check.sh
index 13f8916..8d6a01b 100644
--- a/src/chroot-tools/hooks-check.sh
+++ b/src/chroot-tools/hooks-check.sh
@@ -16,11 +16,30 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+source "$(librelib blacklist)"
+
hook_check_pkgbuild+=("check_pkgbuild_nonfree")
check_pkgbuild_nonfree() {
- local s=0
- sudo -EH -u "$LIBREUSER" pkgbuild-check-nonfree -f || s=$?
- pkgbuild-summarize-nonfree $s
+ local retval=0
+
+ sudo -EH -u "$LIBREUSER" pkgbuild-check-nonfree -f || retval=$?
+ pkgbuild-summarize-nonfree -w $retval
+
+ if (( $retval & ($_E_DEP_NONFREE | $_E_PKG_NONFREE) ))
+ then
+ # this may fail when a blacklist entry exists for this package,
+ # but no libre replacement was published before the next repo sync
+ # in such cases, blacklist.sh::blacklist-get-rep() will not find
+ # it in the repos, and will treat it as a non-free package, aborting the build
+ # perhaps that logic could be adapted to silently allow this case to pass,
+ # but it's probably bestjto ask the user, instead
+ warning "Are you making a libre replacement for this package? [y/N]"
+ read -N 1 -s < /dev/tty ; echo ;
+ [[ $REPLY =~ ^[Yy]$ ]] && retval=0
+ fi
+
+ return $retval
}
#hook_check_pkgbuild+=("check_pkgbuild_namcap")