forked from artix/artools
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
ede2ac11e2 | |||
e8913b07c3 | |||
f5f9a2acb8 | |||
c6f7df51d2 | |||
b105207138 | |||
55e98abdc1 |
@@ -28,6 +28,53 @@ load_user_info
|
|||||||
load_vars "${USERCONFDIR}/pacman/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
load_vars "${USERCONFDIR}/pacman/makepkg.conf" || load_vars "$USER_HOME/.makepkg.conf"
|
||||||
load_vars /etc/makepkg.conf
|
load_vars /etc/makepkg.conf
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<- _EOF_
|
||||||
|
Usage: ${BASH_SOURCE[0]##*/} [OPTIONS]
|
||||||
|
|
||||||
|
Searches for a locally built package corresponding to the PKGBUILD, and
|
||||||
|
downloads the last version of that package from the Pacman repositories.
|
||||||
|
It then compares the list of .so files provided by each version of the
|
||||||
|
package and outputs if there are soname differences for the new package.
|
||||||
|
A directory is also created using mktemp with files containing a file
|
||||||
|
list for both packages and a library list for both packages.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
-r, --rmdir Remove the temporary directory
|
||||||
|
-w, --warn Print a warning in case of differences
|
||||||
|
-h, --help Show this help text
|
||||||
|
_EOF_
|
||||||
|
}
|
||||||
|
|
||||||
|
RMDIR=0
|
||||||
|
WARN=0
|
||||||
|
|
||||||
|
OPT_SHORT='rwh'
|
||||||
|
OPT_LONG=('rmdir' 'warn' 'help')
|
||||||
|
if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
set -- "${OPTRET[@]}"
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
case $1 in
|
||||||
|
-r|--rmdir)
|
||||||
|
RMDIR=1
|
||||||
|
;;
|
||||||
|
-w|--warn)
|
||||||
|
WARN=1
|
||||||
|
;;
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
--)
|
||||||
|
shift; break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
if [[ ! -f PKGBUILD ]]; then
|
if [[ ! -f PKGBUILD ]]; then
|
||||||
die 'This must be run in the directory of a built package.'
|
die 'This must be run in the directory of a built package.'
|
||||||
fi
|
fi
|
||||||
@@ -38,6 +85,7 @@ if [[ $arch == 'any' ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
STARTDIR=$(pwd)
|
STARTDIR=$(pwd)
|
||||||
|
(( RMDIR )) && trap 'rm -rf $TEMPDIR' EXIT INT TERM QUIT
|
||||||
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
|
TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
|
||||||
|
|
||||||
for _pkgname in "${pkgname[@]}"; do
|
for _pkgname in "${pkgname[@]}"; do
|
||||||
@@ -90,9 +138,12 @@ for _pkgname in "${pkgname[@]}"; do
|
|||||||
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
|
find-libprovides "$TEMPDIR/$oldpkg" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname-old"
|
||||||
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
|
find-libprovides "$pkgfile" 2>/dev/null | sort > "$TEMPDIR/libraries-$_pkgname"
|
||||||
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
|
if ! diff_output="$(sdiff -s "$TEMPDIR/libraries-$_pkgname-old" "$TEMPDIR/libraries-$_pkgname")"; then
|
||||||
msg "Sonames differ in %s!" "$_pkgname"
|
message="Sonames differ in $_pkgname!"
|
||||||
|
(( WARN )) && warning "$message" || msg "$message"
|
||||||
echo "$diff_output"
|
echo "$diff_output"
|
||||||
else
|
else
|
||||||
msg "No soname differences for %s" "$_pkgname."
|
msg "No soname differences for %s" "$_pkgname."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
(( RMDIR )) || msg "Files saved to %s" "$TEMPDIR"
|
||||||
|
@@ -32,8 +32,8 @@ add_svc_s6(){
|
|||||||
local mnt="$1" name="$2"
|
local mnt="$1" name="$2"
|
||||||
if [[ -d $mnt/etc/s6/sv/$name ]]; then
|
if [[ -d $mnt/etc/s6/sv/$name ]]; then
|
||||||
msg2 "Setting %s ..." "$name"
|
msg2 "Setting %s ..." "$name"
|
||||||
chroot $mnt s6-rc-bundle $name default &>/dev/null
|
# chroot $mnt s6-rc-bundle $name default &>/dev/null
|
||||||
chroot $mnt s6-rc -u change default &>/dev/null
|
# chroot $mnt s6-rc -u change default &>/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ write_unpackfs_conf(){
|
|||||||
yaml+=$(write_yaml_map 0 'unpack')
|
yaml+=$(write_yaml_map 0 'unpack')
|
||||||
yaml+=$(write_yaml_seq_map 2 'source' "/run/artix/bootmnt/artix/x86_64/rootfs.sfs")
|
yaml+=$(write_yaml_seq_map 2 'source' "/run/artix/bootmnt/artix/x86_64/rootfs.sfs")
|
||||||
yaml+=$(write_yaml_map 4 'sourcefs' 'squashfs')
|
yaml+=$(write_yaml_map 4 'sourcefs' 'squashfs')
|
||||||
yaml+=$(write_yaml_map 4 'destination' '')
|
yaml+=$(write_yaml_map 4 'destination' '""')
|
||||||
yaml+=$(write_empty_line)
|
yaml+=$(write_empty_line)
|
||||||
printf '%s' "${yaml}"
|
printf '%s' "${yaml}"
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ prepare_initramfs(){
|
|||||||
su ${OWNER} -c "gpg --export ${GPG_KEY} >/tmp/GPG_KEY"
|
su ${OWNER} -c "gpg --export ${GPG_KEY} >/tmp/GPG_KEY"
|
||||||
exec 17<>/tmp/GPG_KEY
|
exec 17<>/tmp/GPG_KEY
|
||||||
fi
|
fi
|
||||||
local _kernel=$(cat $mnt/usr/lib/modules/*/version)
|
local _kernel=$(<$mnt/usr/src/linux/version)
|
||||||
ARTIX_GNUPG_FD=${GPG_KEY:+17} artools-chroot $mnt \
|
ARTIX_GNUPG_FD=${GPG_KEY:+17} artools-chroot $mnt \
|
||||||
/usr/bin/mkinitcpio -k ${_kernel} \
|
/usr/bin/mkinitcpio -k ${_kernel} \
|
||||||
-c /etc/mkinitcpio-artix.conf \
|
-c /etc/mkinitcpio-artix.conf \
|
||||||
@@ -59,8 +59,7 @@ prepare_boot_extras(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure_grub(){
|
configure_grub(){
|
||||||
local conf="$1/boot/grub/kernels.cfg"
|
sed -e "s|@iso_label@|${iso_label}|" -i ${iso_root}/boot/grub/kernels.cfg
|
||||||
sed -e "s|@iso_label@|${iso_label}|" -i $conf
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_grub(){
|
prepare_grub(){
|
||||||
@@ -104,7 +103,7 @@ prepare_grub(){
|
|||||||
grub-mkfont -o ${grub}/unicode.pf2 /usr/share/fonts/misc/unifont.bdf
|
grub-mkfont -o ${grub}/unicode.pf2 /usr/share/fonts/misc/unifont.bdf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local size=4M mnt="${mnt_dir}/efiboot" efi_img="$3/efi.img"
|
local size=4M mnt="${mnt_dir}/efiboot" efi_img="${iso_root}/efi.img"
|
||||||
msg2 "Creating fat image of %s ..." "${size}"
|
msg2 "Creating fat image of %s ..." "${size}"
|
||||||
truncate -s ${size} "${efi_img}"
|
truncate -s ${size} "${efi_img}"
|
||||||
mkfs.fat -n ARTIX_EFI "${efi_img}" &>/dev/null
|
mkfs.fat -n ARTIX_EFI "${efi_img}" &>/dev/null
|
||||||
|
@@ -85,7 +85,7 @@ load_pkgs(){
|
|||||||
|
|
||||||
local _init="s|@$init||g"
|
local _init="s|@$init||g"
|
||||||
case "$init" in
|
case "$init" in
|
||||||
'openrc') _init_rm1="s|@runit.*||g"; _init_rm2="s|@s6*||g" ;;
|
'openrc') _init_rm1="s|@runit.*||g"; _init_rm2="s|@s6.*||g" ;;
|
||||||
's6') _init_rm1="s|@runit.*||g"; _init_rm2="s|@openrc.*||g" ;;
|
's6') _init_rm1="s|@runit.*||g"; _init_rm2="s|@openrc.*||g" ;;
|
||||||
'runit') _init_rm1="s|@s6.*||g"; _init_rm2="s|@openrc.*||g" ;;
|
'runit') _init_rm1="s|@s6.*||g"; _init_rm2="s|@openrc.*||g" ;;
|
||||||
esac
|
esac
|
||||||
|
@@ -81,7 +81,7 @@ pull_tree(){
|
|||||||
local remote_head=$(get_remote_head)
|
local remote_head=$(get_remote_head)
|
||||||
|
|
||||||
msg "Checking %s (%s)" "${tree}" "$os"
|
msg "Checking %s (%s)" "${tree}" "$os"
|
||||||
if $(has_changes "${local_head}" "${remote_head}");then
|
if has_changes "${local_head}" "${remote_head}";then
|
||||||
git pull origin master
|
git pull origin master
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user