-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Here is the script that I currently use to detect broken links.
#!/bin/bash
dbdir=/var/lib/pacman/sync
repo=$1
tmp=$(mktemp -d --tmpdir check-links.XXXXXXXXXX)
for i in core extra community arch4edu
do
tar zxf $dbdir/$i.files --wildcards '*/files' -O 2>/dev/null
done | grep -a '\.so' | sed 's|.*/||g' | sort | uniq > $tmp/files
mkdir -p $tmp/links
tar -C $tmp/links -zxf $repo --wildcards '*/links'
sed 's|.*/||g' -i $(find $tmp/links -type f -name 'links')
sort $(find $tmp/links -name links -type f) | uniq > $tmp/sodepends
diff $tmp/files $tmp/sodepends | grep -P '^\>' | cut -c 3- > $tmp/broken-links
sed '/^%LINKS%$/d' -i $tmp/broken-links
sed '/^libc\.musl-x86_64\.so.*$/d' -i $tmp/broken-links
sed '/^ld-linux\.so.*$/d' -i $tmp/broken-links
sed '/^ld\.so.*$/d' -i $tmp/broken-links
cd $tmp/links
for link in $(cat $tmp/broken-links)
do
grep -Fx "$link" -r .
done | sort | cut -c 3-To use it, first update your local pacman database
pacman -Sy
pacman -Fy
Then
./check-links.sh /path/to/arch4edu.links.tar.gz
It will still has false alarmed packages. We need add a new setting in cactus.yaml like check-links:
- when
check-links: true, we find out their pkgbase path in arch4edu and trigger the rebuild. - when
check-links: false, we ignore their outputs incheck-links.sh. - when unset, we add a warning somehow to let everybody know it.
carlosal1015
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request