Removed dups
This commit is contained in:
parent
5807ba2279
commit
bf852f86f8
19
REPO
19
REPO
@ -45,9 +45,7 @@ d:prboom-plus
|
||||
d:greetd
|
||||
d:libde265
|
||||
d:geany
|
||||
d:pkgutils
|
||||
d:qhull
|
||||
d:prt-utils
|
||||
d:libusb
|
||||
d:qrupdate
|
||||
d:fortune-mod-de
|
||||
@ -273,27 +271,10 @@ f:a0d0c43ccd086ebcff1de84c68faa2b2:geany/.md5sum
|
||||
f:d043b24a83709648d2c9ce50f5aca1c2:geany/.signature
|
||||
f:9d03d3bfd648354b24ed899495efdb16:geany/Pkgfile
|
||||
f:7b53597c81a09afcb5ba1b4dfa8e140b:geany/.footprint
|
||||
f:131e60f4ab758f4b909f22489b3b7fef:pkgutils/pkgmk.in.patch
|
||||
f:d2d9a847f473f449696183e7c5304bfd:pkgutils/.md5sum
|
||||
f:84aa9229478ab3dbcd946359f1b6bdfd:pkgutils/.signature
|
||||
f:14822e345e33bae372a01932e2d53dc3:pkgutils/Pkgfile
|
||||
f:0d3a6fed127ba555ba0c1a587130c6bc:pkgutils/.footprint
|
||||
f:e3782d5410390702f1d518204f00f4a1:qhull/.md5sum
|
||||
f:9cc1e0d3df2cb84ab9ff0c81dd5a1699:qhull/.signature
|
||||
f:4d2e2d7d9cfcb0d5f55d76e232131149:qhull/Pkgfile
|
||||
f:9eeac2eb669de8af5ecdcf0095745a45:qhull/.footprint
|
||||
f:e3040feeec90558ef2f0129ae7b5e614:prt-utils/prtsweep
|
||||
f:c9e0d6e4928526bd3086035eb706ec12:prt-utils/.md5sum
|
||||
f:7f3d824af39b85c2caf715d9a25f37a0:prt-utils/.signature
|
||||
f:af5f5f9b9876ba435f2b2e770a7b95d7:prt-utils/portspage.patch
|
||||
f:940e7d309500cc2bf9e504abefa86ce4:prt-utils/Pkgfile
|
||||
f:512a1536a0c515a7cbe6cb54a65e121f:prt-utils/prtwash.1
|
||||
f:09b6f7bf985c2bc67ea87fe8cf635769:prt-utils/prtsweep.1
|
||||
f:61b9b7c642e0d18d27a0ec79d0c36359:prt-utils/dllist.patch
|
||||
f:23a83189641ed432224d7e55c6e905a4:prt-utils/dllist.1.patch
|
||||
f:ce8937dd6544aa372003b9f7ea46a7e0:prt-utils/pkgfile.5
|
||||
f:aaa2b6d05e90f274883dd8e4f878a8a5:prt-utils/.footprint
|
||||
f:3faee29802663f422b918a826e752cc0:prt-utils/prtwash
|
||||
f:47d648374e2f81ad8e210a8448575e59:libusb/fix-descriptor-parsing.patch
|
||||
f:f8b92579502a89cbc209606f4b4261e2:libusb/.md5sum
|
||||
f:0b5ffa64e70bd37de67fda420383b513:libusb/.signature
|
||||
|
@ -1,21 +0,0 @@
|
||||
drwxr-xr-x root/root etc/
|
||||
-rw-r--r-- root/root etc/pkgadd.conf
|
||||
-rw-r--r-- root/root etc/pkgmk.conf
|
||||
-rw-r--r-- root/root etc/rejmerge.conf
|
||||
drwxr-xr-x root/root usr/
|
||||
drwxr-xr-x root/root usr/bin/
|
||||
-rwxr-xr-x root/root usr/bin/pkgadd
|
||||
lrwxrwxrwx root/root usr/bin/pkginfo -> pkgadd
|
||||
-rwxr-xr-x root/root usr/bin/pkgmk
|
||||
lrwxrwxrwx root/root usr/bin/pkgrm -> pkgadd
|
||||
-rwxr-xr-x root/root usr/bin/rejmerge
|
||||
drwxr-xr-x root/root usr/share/
|
||||
drwxr-xr-x root/root usr/share/man/
|
||||
drwxr-xr-x root/root usr/share/man/man5/
|
||||
-rw-r--r-- root/root usr/share/man/man5/pkgmk.conf.5.gz
|
||||
drwxr-xr-x root/root usr/share/man/man8/
|
||||
-rw-r--r-- root/root usr/share/man/man8/pkgadd.8.gz
|
||||
-rw-r--r-- root/root usr/share/man/man8/pkginfo.8.gz
|
||||
-rw-r--r-- root/root usr/share/man/man8/pkgmk.8.gz
|
||||
-rw-r--r-- root/root usr/share/man/man8/pkgrm.8.gz
|
||||
-rw-r--r-- root/root usr/share/man/man8/rejmerge.8.gz
|
@ -1,2 +0,0 @@
|
||||
131e60f4ab758f4b909f22489b3b7fef pkgmk.in.patch
|
||||
526c897cb2ba8f1659545608fe629cab pkgutils-5.40.7.tar.xz
|
@ -1,6 +0,0 @@
|
||||
untrusted comment: verify with /etc/ports/jmq.pub
|
||||
RWTTPlFarK9CxP/0vPuhN43Sv0zzJnCexzKGLM9cebnwlP71tZ6PXzC8G0JEKbJhsrOxFYyBMJWRCqx+Uzdh2QwkGzgpduYzggw=
|
||||
SHA256 (Pkgfile) = 3b9f90496a3c40113d4d254657fee08ebc963a64aab3e9c51e8abf55635ba9bd
|
||||
SHA256 (.footprint) = e7d863393a07a29b512a2b627a65f731d8896bf0ee75cf430a9b1423716ae437
|
||||
SHA256 (pkgutils-5.40.7.tar.xz) = ee9e3e7258983ffabe5959736e8f029c02b0ea1037b2bb588a88daafcda0fafc
|
||||
SHA256 (pkgmk.in.patch) = 6ed57b8a707f5c5860be82b6911012f5f51c7fe71579cc30c3418b432205451e
|
@ -1,15 +0,0 @@
|
||||
# Description: utilities to install and manage CRUX packages, with support for renaming tarballs
|
||||
# URL: http://crux.nu/gitweb/?p=tools/pkgutils.git
|
||||
# Maintainer: John McQuah, jmcquah at disroot dot org
|
||||
# Depends on: libarchive
|
||||
|
||||
name=pkgutils
|
||||
version=5.40.7
|
||||
release=2
|
||||
source=(http://crux.nu/files/$name-$version.tar.xz pkgmk.in.patch)
|
||||
|
||||
build () {
|
||||
cd $name-$version
|
||||
patch -p1 < $SRC/pkgmk.in.patch
|
||||
make DESTDIR=$PKG install
|
||||
}
|
@ -1,195 +0,0 @@
|
||||
--- pkgutils-5.40.7/pkgmk.in 2021-06-20 06:55:38.965326116 -0400
|
||||
+++ pkgutils-5.40.7d/pkgmk.in 2021-07-02 07:49:45.218000256 -0400
|
||||
@@ -171,36 +171,47 @@ download_file() {
|
||||
}
|
||||
|
||||
download_source() {
|
||||
- local FILE LOCAL_FILENAME
|
||||
+ local RENAME LOCAL_FILE ORIG_FILE srcind
|
||||
|
||||
- for FILE in ${source[@]}; do
|
||||
- LOCAL_FILENAME=`get_filename $FILE`
|
||||
- if [ ! -e $LOCAL_FILENAME ]; then
|
||||
- if [ "$LOCAL_FILENAME" = "$FILE" ]; then
|
||||
- error "Source file '$LOCAL_FILENAME' not found (can not be downloaded, URL not specified)."
|
||||
+ srcind=0
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ ORIG_FILE=`get_filename "${source[$srcind]}"`
|
||||
+ LOCAL_FILE=$ORIG_FILE
|
||||
+ RENAME="${renames[$srcind]}"
|
||||
+ [ -n "$RENAME" -a "$RENAME" != "SKIP" ] && LOCAL_FILE="$PKGMK_SOURCE_DIR/$RENAME"
|
||||
+ if [ ! -e $LOCAL_FILE ]; then
|
||||
+ if [ "$ORIG_FILE" = "${source[$srcind]}" ]; then
|
||||
+ error "Source file '$LOCAL_FILE' not found (can not be downloaded, URL not specified)."
|
||||
exit $E_DOWNLOAD
|
||||
else
|
||||
if [ "$PKGMK_DOWNLOAD" = "yes" ]; then
|
||||
- download_file $FILE
|
||||
+ download_file "${source[$srcind]}"
|
||||
+ [ "$LOCAL_FILE" = "$ORIG_FILE" ] || mv $ORIG_FILE $LOCAL_FILE
|
||||
+
|
||||
else
|
||||
- error "Source file '$LOCAL_FILENAME' not found (use option -d to download)."
|
||||
+ error "Source file '$LOCAL_FILE' not found (use option -d to download)."
|
||||
exit $E_DOWNLOAD
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
done
|
||||
}
|
||||
|
||||
unpack_source() {
|
||||
- local FILE LOCAL_FILENAME COMMAND
|
||||
+ local ORIG_FILE RENAME LOCAL_FILE srcind COMMAND
|
||||
|
||||
- for FILE in ${source[@]}; do
|
||||
- LOCAL_FILENAME=`get_filename $FILE`
|
||||
- case $LOCAL_FILENAME in
|
||||
+ srcind=0
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ ORIG_FILE=`get_filename ${source[$srcind]}`
|
||||
+ LOCAL_FILE=$ORIG_FILE
|
||||
+ RENAME="${renames[$srcind]}"
|
||||
+ [ -n "$RENAME" -a "$RENAME" != "SKIP" ] && LOCAL_FILE="$PKGMK_SOURCE_DIR/$RENAME"
|
||||
+ case $LOCAL_FILE in
|
||||
*.tar|*.tar.gz|*.tar.Z|*.tgz|*.tar.bz2|*.tbz2|*.tar.xz|*.txz|*.tar.lzma|*.tar.lz|*.zip|*.rpm|*.7z)
|
||||
- COMMAND="bsdtar -p -o -C $SRC -xf $LOCAL_FILENAME" ;;
|
||||
+ COMMAND="bsdtar -p -o -C $SRC -xf $LOCAL_FILE" ;;
|
||||
*)
|
||||
- COMMAND="cp $LOCAL_FILENAME $SRC" ;;
|
||||
+ COMMAND="cp $LOCAL_FILE $SRC" ;;
|
||||
esac
|
||||
|
||||
echo "$COMMAND"
|
||||
@@ -214,15 +225,25 @@ unpack_source() {
|
||||
error "Building '$TARGET' failed."
|
||||
exit $E_UNPACK
|
||||
fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
done
|
||||
}
|
||||
|
||||
make_md5sum() {
|
||||
- local FILE LOCAL_FILENAMES
|
||||
+ local srcind FILE LOCAL_FILENAMES
|
||||
|
||||
if [ "$source" ]; then
|
||||
- for FILE in ${source[@]}; do
|
||||
+ srcind=0
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ FILE="${source[$srcind]}"
|
||||
+ if [ -n "${renames[$srcind]}" -a "${renames[$srcind]}" != "SKIP" ]; then
|
||||
+ LOCAL_FILENAMES="$LOCAL_FILENAMES $PKGMK_SOURCE_DIR/${renames[$srcind]}"
|
||||
+ elif [ "`get_basename $FILE`" = "$FILE" ]; then
|
||||
+ LOCAL_FILENAMES="$LOCAL_FILENAMES $FILE"
|
||||
+ else
|
||||
LOCAL_FILENAMES="$LOCAL_FILENAMES `get_filename $FILE`"
|
||||
+ fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
done
|
||||
|
||||
md5sum $LOCAL_FILENAMES | sed -e 's| .*/| |' | sort -k 2
|
||||
@@ -294,7 +315,16 @@ check_signature() {
|
||||
|
||||
if [ -f $PKGMK_ROOT/$PKGMK_SIGNATURE ]; then
|
||||
cd $SRC
|
||||
- for FILE in "$PKGMK_PKGFILE" "$PKGMK_FOOTPRINT" ${source[@]}; do
|
||||
+ local srcind=0
|
||||
+
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ if [ -n "${renames[$srcind]}" -a "${renames[$srcind]}" != "SKIP" ]; then
|
||||
+ source[$srcind]="http://somehost/${renames[$srcind]}"
|
||||
+ fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
+ done
|
||||
+
|
||||
+ for FILE in "$PKGMK_PKGFILE" "$PKGMK_FOOTPRINT" "${source[@]}"; do
|
||||
ln -s $(get_filename -a $FILE) .
|
||||
done
|
||||
|
||||
@@ -359,7 +389,15 @@ make_signature() {
|
||||
local FILE LOCAL_FILENAMES
|
||||
local REPO
|
||||
|
||||
- for FILE in "$PKGMK_PKGFILE" "$PKGMK_FOOTPRINT" ${source[@]}; do
|
||||
+ local srcind=0
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ if [ -n "${renames[$srcind]}" -a "${renames[$srcind]}" != "SKIP" ]; then
|
||||
+ source[$srcind]="http://somehost/${renames[$srcind]}"
|
||||
+ fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
+ done
|
||||
+
|
||||
+ for FILE in "$PKGMK_PKGFILE" "$PKGMK_FOOTPRINT" "${source[@]}"; do
|
||||
LOCAL_FILENAMES="$LOCAL_FILENAMES `get_filename $FILE`"
|
||||
done
|
||||
|
||||
@@ -619,19 +662,26 @@ recursive() {
|
||||
}
|
||||
|
||||
clean() {
|
||||
- local FILE LOCAL_FILENAME
|
||||
+ local ORIG_FILE LOCAL_FILE srcind
|
||||
|
||||
if [ -f $TARGET ]; then
|
||||
info "Removing $TARGET"
|
||||
rm -f $TARGET
|
||||
fi
|
||||
|
||||
- for FILE in ${source[@]}; do
|
||||
- LOCAL_FILENAME=`get_filename $FILE`
|
||||
- if [ -e $LOCAL_FILENAME ] && [ "$LOCAL_FILENAME" != "$FILE" ]; then
|
||||
- info "Removing $LOCAL_FILENAME"
|
||||
- rm -f $LOCAL_FILENAME
|
||||
+ srcind=0
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ ORIG_FILE="${source[$srcind]}"
|
||||
+ LOCAL_FILE=`get_filename "$ORIG_FILE"`
|
||||
+ RENAME="${renames[$srcind]}"
|
||||
+ if [ -n "$RENAME" -a "$RENAME" != "SKIP" ]; then
|
||||
+ LOCAL_FILE="$PKGMK_SOURCE_DIR/$RENAME"
|
||||
+ fi
|
||||
+ if [ -e $LOCAL_FILE ] && [ "$LOCAL_FILE" != "$ORIG_FILE" ]; then
|
||||
+ info "Removing $LOCAL_FILE"
|
||||
+ rm -f $LOCAL_FILE
|
||||
fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
done
|
||||
}
|
||||
|
||||
@@ -649,18 +699,30 @@ update_footprint() {
|
||||
}
|
||||
|
||||
build_needed() {
|
||||
- local FILE RESULT
|
||||
+ local ORIG_FILE RENAME LOCAL_FILE srcind RESULT
|
||||
|
||||
RESULT="yes"
|
||||
if [ -f $TARGET ]; then
|
||||
RESULT="no"
|
||||
- for FILE in $PKGMK_PKGFILE ${source[@]}; do
|
||||
- FILE=`get_filename $FILE`
|
||||
- if [ -e $FILE ] && [ ! $TARGET -nt $FILE ]; then
|
||||
+ srcind=0
|
||||
+
|
||||
+ while [ $srcind -lt ${#source[@]} ]; do
|
||||
+ ORIG_FILE=`get_filename "${source[$srcind]}"`
|
||||
+ LOCAL_FILE=$ORIG_FILE
|
||||
+ RENAME="${renames[$srcind]}"
|
||||
+ if [ -n "$RENAME" -a "$RENAME" != "SKIP" ]; then
|
||||
+ LOCAL_FILE="$PKGMK_SOURCE_DIR/$RENAME"
|
||||
+ fi
|
||||
+ if [ -e $LOCAL_FILE ] && [ ! $TARGET -nt $LOCAL_FILE ]; then
|
||||
RESULT="yes"
|
||||
break
|
||||
fi
|
||||
+ srcind=$(( srcind+1 ))
|
||||
done
|
||||
+
|
||||
+ if [ -e $PKGMK_PKGFILE ] && [ ! $TARGET -nt $PKGMK_PKGFILE ]; then
|
||||
+ RESULT="yes"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
echo $RESULT
|
@ -1,68 +0,0 @@
|
||||
drwxr-xr-x root/root etc/
|
||||
drwxr-xr-x root/root etc/revdep.d/
|
||||
drwxr-xr-x root/root usr/
|
||||
drwxr-xr-x root/root usr/bin/
|
||||
-rwxr-xr-x root/root usr/bin/dllist
|
||||
-rwxr-xr-x root/root usr/bin/finddeps
|
||||
-rwxr-xr-x root/root usr/bin/findredundantdeps
|
||||
-rwxr-xr-x root/root usr/bin/oldfiles
|
||||
-rwxr-xr-x root/root usr/bin/pkg_installed
|
||||
-rwxr-xr-x root/root usr/bin/pkgexport
|
||||
-rwxr-xr-x root/root usr/bin/pkgfoster
|
||||
-rwxr-xr-x root/root usr/bin/pkgsize
|
||||
-rwxr-xr-x root/root usr/bin/portspage
|
||||
-rwxr-xr-x root/root usr/bin/prtcheck
|
||||
-rwxr-xr-x root/root usr/bin/prtcheckmissing
|
||||
-rwxr-xr-x root/root usr/bin/prtcreate
|
||||
-rwxr-xr-x root/root usr/bin/prtorphan
|
||||
-rwxr-xr-x root/root usr/bin/prtrej
|
||||
-rwxr-xr-x root/root usr/bin/prtsweep
|
||||
-rwxr-xr-x root/root usr/bin/prtverify
|
||||
-rwxr-xr-x root/root usr/bin/prtwash
|
||||
-rwxr-xr-x root/root usr/bin/revdep
|
||||
drwxr-xr-x root/root usr/lib/
|
||||
drwxr-xr-x root/root usr/lib/prtverify/
|
||||
-rw-r--r-- root/root usr/lib/prtverify/00_prtverify_lib.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/05_file_check.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/10_file_check_clean_repo.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_duplicated_deps.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_encoding.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_evil_cmds.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_maintainer_email.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_missing_deps.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_pkgfile_headers.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_pkgfile_vars.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_port_name_match.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/20_release_number.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_file_conflict.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_file_permissions.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_filesystem_collisions.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_invalid_dirs.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_junk_files.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_suid_sgid.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/30_system_users.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/90_mk_footprint_db.awk
|
||||
-rw-r--r-- root/root usr/lib/prtverify/prtverify.wl
|
||||
drwxr-xr-x root/root usr/share/
|
||||
drwxr-xr-x root/root usr/share/man/
|
||||
drwxr-xr-x root/root usr/share/man/man1/
|
||||
-rw-r--r-- root/root usr/share/man/man1/dllist.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/finddeps.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/findredundantdeps.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/oldfiles.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/pkg_installed.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/pkgexport.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/pkgfoster.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/pkgsize.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/portspage.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prt-utils.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtcheck.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtcheckmissing.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtcreate.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtorphan.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtsweep.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtverify.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/prtwash.1.gz
|
||||
-rw-r--r-- root/root usr/share/man/man1/revdep.1.gz
|
||||
drwxr-xr-x root/root usr/share/man/man5/
|
||||
-rw-r--r-- root/root usr/share/man/man5/Pkgfile.5.gz
|
@ -1,9 +0,0 @@
|
||||
23a83189641ed432224d7e55c6e905a4 dllist.1.patch
|
||||
61b9b7c642e0d18d27a0ec79d0c36359 dllist.patch
|
||||
ce8937dd6544aa372003b9f7ea46a7e0 pkgfile.5
|
||||
af5f5f9b9876ba435f2b2e770a7b95d7 portspage.patch
|
||||
b3e93f4d0a364a5a2ca331cbcd46afc1 prt-utils-1.1.4.tar.xz
|
||||
e3040feeec90558ef2f0129ae7b5e614 prtsweep
|
||||
09b6f7bf985c2bc67ea87fe8cf635769 prtsweep.1
|
||||
3faee29802663f422b918a826e752cc0 prtwash
|
||||
512a1536a0c515a7cbe6cb54a65e121f prtwash.1
|
@ -1,13 +0,0 @@
|
||||
untrusted comment: verify with /etc/ports/jmq.pub
|
||||
RWTTPlFarK9CxOIgF1zXfK5jtEZ2ZvJqi0cG/nFR4UtxQJXt9VUkS7jPoPLP/4BvD0QADLQDnSBrXBVY4nRBbpYZNjA218j4Egk=
|
||||
SHA256 (Pkgfile) = 88ea99056c032f6693b9ecc6c817e7f08ddc9883791461d6384401a5e2f8a57b
|
||||
SHA256 (.footprint) = 303698dc8c95d39b5efb27898428833b9d37ed6542526a68a278573bffc09b77
|
||||
SHA256 (prt-utils-1.1.4.tar.xz) = caa8b634ca988ccdf801eac9986b8838caecdcba3755f01baed6bb5f929bd6d6
|
||||
SHA256 (dllist.1.patch) = c71872f46d412de97c5de5399cbc4eac0b2e201b7b8e6e842f02b3dafae7eb77
|
||||
SHA256 (dllist.patch) = 76c73dc58d53b8d5388be40ee483c1a6205486afcd1728aab408c0a9a7bd849a
|
||||
SHA256 (portspage.patch) = a8b3a6a0ef5c9244245908c5cc251dc328137eee4a5cf6b39b668f512a5d9195
|
||||
SHA256 (prtsweep) = 4d21aa4e7a0d89a317617420a5248b02f10075b906773c899826ddbf95920957
|
||||
SHA256 (prtwash) = 8142e0d5b30cd8dd90157af466247336d0bd2f1389f3479b6b540628f5d4e9c7
|
||||
SHA256 (prtsweep.1) = 14280ee174ee50514f9f08269c2d54f0be134622374ed2d7d76687b13579ebc2
|
||||
SHA256 (prtwash.1) = e495778e274ea5f1a54786572c6b824d95af25dee52eef786a6f87a40ea00682
|
||||
SHA256 (pkgfile.5) = 7180b3df759dfd109ee84cdb66bcb1ff0acdae5e09f957c978ef02c93d7f4ae9
|
@ -1,32 +0,0 @@
|
||||
# Description: port management scripts for CRUX, with support for renamed tarballs
|
||||
# URL: http://crux.nu/Wiki/PrtUtils
|
||||
# Maintainer: John McQuah, jmcquah at disroot dot org
|
||||
# Depends on: elfutils
|
||||
|
||||
name=prt-utils
|
||||
version=1.1.4
|
||||
release=2
|
||||
source=(http://crux.nu/files/tools/prt-utils/$name-$version.tar.xz \
|
||||
dllist.1.patch dllist.patch portspage.patch prtsweep prtwash prtsweep.1 prtwash.1 pkgfile.5)
|
||||
|
||||
build() {
|
||||
cd $name-$version
|
||||
# enable the download listing tool to recognize already-downloaded sources
|
||||
patch -p1 < $SRC/dllist.1.patch
|
||||
patch -p1 < $SRC/dllist.patch
|
||||
|
||||
# augment portspage with the ability to find and print the signify public key
|
||||
patch -p1 < $SRC/portspage.patch
|
||||
|
||||
# enable the cleanup tools to recognize sources that have been renamed
|
||||
cp $SRC/prtsweep* .
|
||||
cp $SRC/prtwash* .
|
||||
|
||||
make
|
||||
make DESTDIR=$PKG install
|
||||
|
||||
# put the documentation of Pkgfile syntax in more convenient location
|
||||
install -d $PKG/usr/share/man/man5
|
||||
gzip -c $SRC/pkgfile.5 > $PKG/usr/share/man/man5/Pkgfile.5.gz
|
||||
install -d $PKG/etc/revdep.d
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
--- prt-utils-1.1.4/dllist.1 2020-10-15 05:16:54.000000000 -0400
|
||||
+++ prt-utils-1.1.4d/dllist.1 2021-06-26 14:12:30.860942185 -0400
|
||||
@@ -1,5 +1,5 @@
|
||||
." Text automatically generated by txt2man-1.4.7
|
||||
-.TH dllist "October 20, 2004" "" ""
|
||||
+.TH dllist "June 25, 2021" "" ""
|
||||
.SH NAME
|
||||
\fBdllist \fP- Show sources to be downloaded for compiling a port
|
||||
\fB
|
||||
@@ -12,21 +12,29 @@
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
\fBdllist\fP displays a list of URLs that have to be downloaded for compiling
|
||||
-the given \fBport\fP(s).
|
||||
+the given \fBport\fP(s), using \fBprt-get\fP(8) to collect information on
|
||||
+ports and installation status.
|
||||
.PP
|
||||
-The script can operate in two modes: list files needed for sepcified
|
||||
-ports or list files needed to update the system.
|
||||
+The script can operate in two modes: list files needed for specified
|
||||
+ports, or list files needed to update the system.
|
||||
.PP
|
||||
-Only files from ports not already installed are considered,
|
||||
+The list is restricted to packages not currently installed,
|
||||
unless the --all option is specified.
|
||||
.PP
|
||||
-\fBdllist\fP uses \fBprt-get\fP(8) to collect information on ports
|
||||
-and installation status.
|
||||
+\fBdllist\fP filters the list based on the contents of $PKGMK_SOURCE_DIR,
|
||||
+reporting only those source files that are not found in the expected download
|
||||
+location on the filesystem. It is the user's responsibility to ensure that
|
||||
+$PKGMK_SOURCE_DIR is consistent for all invocations of \fBpkgmk\fB; otherwise
|
||||
+\fBdllist\fP might exaggerate the number of downloads needed. For a similar reason,
|
||||
+moving or renaming downloaded source files using a mechanism other
|
||||
+than the \(oqrenames\(cq array of \fBPkgfile\fB(5) will cause \fBdllist\fP
|
||||
+to report them as needing a fresh download.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B
|
||||
--all
|
||||
-also display URLs that
|
||||
+read the source array of each dependency (even those already installed)
|
||||
+and print the URLs that have no corresponding file in $PKGMK_SOURCE_DIR
|
||||
.TP
|
||||
.B
|
||||
--diff
|
||||
@@ -46,9 +54,9 @@
|
||||
\fBdllist\fP --diff
|
||||
list files to be downloaded for a system upgrade
|
||||
.SH SEE ALSO
|
||||
-\fBprt-get\fP(8), \fBports\fP(8)
|
||||
-.SH AUTHOR
|
||||
-Johannes Winkelmann <jw@tks6.net>
|
||||
+\fBprt-get\fP(8), \fBports\fP(8), \fBPkgfile\fP(5)
|
||||
+.SH AUTHORS
|
||||
+Johannes Winkelmann <jw at tks6 dot net>, John McQuah <jmcquah at disroot dot org>
|
||||
.RE
|
||||
.PP
|
||||
|
@ -1,53 +0,0 @@
|
||||
--- prt-utils-1.1.4/dllist 2020-10-15 05:16:54.000000000 -0400
|
||||
+++ prt-utils-1.1.4d/dllist 2021-06-26 14:18:08.139831908 -0400
|
||||
@@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
-# Print a list of files to download; allows to either download the
|
||||
-# files required to install a package, all files (including those you
|
||||
-# already have installed) to install a package, or all files required
|
||||
-# to update your system
|
||||
+# Print a list of files to download, formatted in one of three ways:
|
||||
+# - the files required to install a specified package
|
||||
+# - the files required to install a package and all its dependencies
|
||||
+# (even dependencies that are already present on the system)
|
||||
+# - all files required to update your system
|
||||
#
|
||||
-# Johannes Winkelmann <jw@tks6.net>
|
||||
+# version 1.0 by Johannes Winkelmann, updated 2021-06 by John McQuah
|
||||
|
||||
version=1.1
|
||||
|
||||
@@ -32,14 +33,26 @@
|
||||
if [ "$DIFF" = "yes" ]; then
|
||||
list=(`prt-get quickdiff`)
|
||||
elif [ "$ALL" = "yes" ]; then
|
||||
- list=(`prt-get quickdep $@`)
|
||||
+ list=(`prt-get quickdep ${args[*]}`)
|
||||
else
|
||||
- list=(`prt-get depends ${args[*]}|grep "\[ "|awk '{print $3}'`)
|
||||
+ wlist=(${args[*]} `prt-get depends ${args[*]} | grep "\[ "|awk '{print $3}'`)
|
||||
+ list=(`echo "${wlist[*]}" | sort | uniq`)
|
||||
fi
|
||||
|
||||
-for p in ${list[*]}; do
|
||||
- . `prt-get path $p`/Pkgfile
|
||||
- for s in ${source[*]}; do
|
||||
- echo $s|grep tp:
|
||||
+SRCGLOB=$(grep PKGMK_SOURCE_DIR /etc/pkgmk.conf | sed 's/^\s*#// ; s/.*=//; s/\"//g')
|
||||
+
|
||||
+for l in ${list[*]}; do
|
||||
+ PORTDIR=`prt-get path $l`
|
||||
+ . $PORTDIR/Pkgfile
|
||||
+ SAVELOC=`eval printf '%s' "$SRCGLOB"`
|
||||
+ for (( p=0; p<${#source[@]}; p++ )) ; do
|
||||
+ if [[ ${source[$p]} =~ ^(http|ftp|https): ]]; then
|
||||
+ if [ -n "${renames[$p]}" -a "${renames[$p]}" != "SKIP" ]; then
|
||||
+ FILE=${renames[$p]}
|
||||
+ else
|
||||
+ FILE=$(echo "${source[$p]}" | sed 's,.*/,,')
|
||||
+ fi
|
||||
+ [ -e ${SAVELOC:-$PORTDIR}/$FILE ] || echo ${source[$p]}
|
||||
+ fi
|
||||
done
|
||||
done
|
@ -1,266 +0,0 @@
|
||||
.\"
|
||||
.\" Pkgfile manual page.
|
||||
.\" (C) 2018 by Fun, updated 2021 by John McQuah <jmcquah at disroot dot org>
|
||||
.\"
|
||||
.TH Pkgfile 5
|
||||
.SH NAME
|
||||
Pkgfile \- sourced by \fBpkgmk\fP(8) when building a package in the ports tree
|
||||
.SH DESCRIPTION
|
||||
a \fBbash\fP(1) script that tells \fBpkgmk\fP(8) where the source code for a port may be downloaded,
|
||||
and what to do once that source code is unpacked.
|
||||
.SH FILE FORMAT
|
||||
\fBPkgfile\fP starts with a header of commented lines, which are read by \fBprt-get\fP(8)
|
||||
to resolve dependencies, or by \fBportspage\fP(1) to generate an HTML index of the ports collection.
|
||||
After the header \fBpkgmk\fP will expect to find definitions of several mandatory variables, including
|
||||
\fIname\fP, \fIversion\fP, \fIrelease\fP, the bash array \fIsource\fP, and
|
||||
the bash function \fIbuild()\fP.
|
||||
.SS Example:
|
||||
.EX
|
||||
# Description: A library for demonstrating how to create delicious ports.
|
||||
# URL: http://www.gnu.org/software/somelib/index.html
|
||||
# Maintainer: Joe Maintainer, joe at myfantasticisp dot net
|
||||
# Depends on: someotherlib coolness
|
||||
|
||||
name=somelib
|
||||
version=1.2.3
|
||||
release=1
|
||||
source=(ftp://ftp.gnu.org/gnu/$name/archive/$version/$version.tar.gz Makefile.in.patch)
|
||||
renames=($name-$version.tar.gz SKIP)
|
||||
|
||||
build() {
|
||||
cd $name-$version
|
||||
patch -p1 < ../Makefile.in.patch
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
make DESTDIR=$PKG install
|
||||
rm -rf $PKG/usr/info
|
||||
}
|
||||
.EE
|
||||
|
||||
.SS General guidelines
|
||||
The name of a package should always be lowercase (e.g. \fBname=eterm\fP and
|
||||
not \fBname=Eterm\fP). In case the package is added to the CRUX ports system
|
||||
the exact same name should be used for the name of the directory in the
|
||||
ports structure, i.e. \fI/usr/ports/???/eterm\fP.
|
||||
.LP
|
||||
Do not combine several separately distributed programs/libraries into
|
||||
one package. Make several packages instead.
|
||||
.LP
|
||||
Use \fBprtverify\fP to check the port.
|
||||
|
||||
.SS Variable names
|
||||
.LP
|
||||
Do not add new variables to the \fBPkgfile\fP. Only in very few cases
|
||||
does this actually improve the readability or the quality of the
|
||||
package. Further, the only variables that are guaranteed to work with
|
||||
future versions of \fBpkgmk\fP are \fIname\fP, \fIversion\fP, \fIrelease\fP,
|
||||
and \fIsource\fP. Other names could be in conflict with internal variables
|
||||
in \fBpkgmk\fP.
|
||||
.LP
|
||||
Use the \fI$name\fP and \fI$version\fP variables to make the
|
||||
package easier to update/maintain. For example,
|
||||
|
||||
.EX
|
||||
source=(http://xyz.org/$name-$version.tar.gz)
|
||||
.EE
|
||||
|
||||
is better than
|
||||
|
||||
.EX
|
||||
source=(http://xyz.org/myprog-1.0.3.tar.gz)
|
||||
.EE
|
||||
|
||||
since the URL will automatically update when you modify the \fI$version\fP variable.
|
||||
|
||||
.SS Support for renaming source files
|
||||
Note that in the \fBsomelib\fP example above, Joe Maintainer chose to define the optional bash array
|
||||
\fIrenames\fP (same length as \fIsource\fP), so that the ambiguously-named file retrieved by FTP
|
||||
would not collide with another port's files, if downloaded into a common directory.
|
||||
The keyword \(oqSKIP\(cq was given in the \fIrenames\fP array to indicate that renaming was not
|
||||
necessary for the corresponding source file. SKIP should always be used for a file retrieved by
|
||||
\(oqports -u\(cq, because the port maintainer has the freedom to choose an unambiguous name in the
|
||||
\fisource\fP array itself.
|
||||
.PP
|
||||
Tools from prior versions of CRUX (before 3.7), ignorant of the \fIrenames\fP array, will
|
||||
execute the \fIbuild\fP function using the original filenames given by the remote sources.
|
||||
For maximum compatibility, nothing in your \fIbuild\fP function should rely on the specific names
|
||||
you choose for the downloaded tarballs (their contents will be unpacked into identically-named
|
||||
work directories anyway, assuming you do not take the liberty of redefining \fIunpack_source()\fP in your
|
||||
Pkgfile). But because earlier CRUX tools also have to be instructed to disregard md5 and signature
|
||||
mismatches, port creators should avoid the renaming feature unless absolutely necessary.
|
||||
|
||||
.SS Directories
|
||||
In general packages should install files in these directories. Exceptions
|
||||
are of course allowed if there is a good reason. But try to follow the
|
||||
following directory structure as closely as possible.
|
||||
|
||||
.EX
|
||||
Directory Description
|
||||
--------- ------------
|
||||
/usr/bin/ User command/application binaries
|
||||
/usr/sbin/ System binaries (e.g. daemons)
|
||||
/usr/lib/ Libraries
|
||||
/usr/include/ Header files
|
||||
/usr/lib/<prog>/ Plug-ins, addons, etc
|
||||
/usr/share/man/ Man pages
|
||||
/usr/share/<prog>/ Data files
|
||||
/usr/etc/<prog>/ Configuration files
|
||||
/etc/ Configuration files for system software (daemons, etc)
|
||||
.EE
|
||||
.LP
|
||||
\fI/opt\fP directory is reserved for manually compiled/installed
|
||||
applications. Packages should never place anything there.
|
||||
.LP
|
||||
\fI/usr/libexec/\fP is not used in CRUX, thus packages should never
|
||||
install anything there. Use \fI/usr/lib/<prog>/\fP instead.
|
||||
|
||||
.SS Junk files
|
||||
.LP
|
||||
Packages should not contain "junk files". This includes:
|
||||
.IP \[bu] 2
|
||||
info pages and other online documentation, man pages excluded (e.g. \fIusr/doc/*\fP,
|
||||
\fIREADME\fP, \fI*.info\fP, \fI*.html\fP, etc).
|
||||
.IP \[bu]
|
||||
Files related to NLS (national language support). If \fB--disable-nls\fP is not available as
|
||||
an option to \fBconfigure\fP, then manually inserting \(oqrm -rf $PKG/usr/share/locale\(cq near the
|
||||
end of the \fBbuild\fP function is an acceptable alternative.
|
||||
.IP \[bu]
|
||||
Useless or obsolete binaries (e.g. \fI/usr/games/banner\fP and \fI/sbin/mkfs.minix\fP).
|
||||
.LP
|
||||
Apart from these global rules, the definition of "junk" is often a matter of personal taste.
|
||||
One user might regard as "junk" the same files that another user sees as indispensible. See
|
||||
\fBOptional dependencies\fP below for a simple way to let your port handle such
|
||||
individual preferences automatically.
|
||||
|
||||
.SS Header
|
||||
|
||||
Provide a header including the following fields:
|
||||
|
||||
.EX
|
||||
Name Meaning
|
||||
---- -------
|
||||
Description A short description of the package; keep it factual
|
||||
Maintainer Your full name and e-mail address, obfuscated if you want
|
||||
Packager The original packager's full name and e-mail address
|
||||
URL A webpage with more information on this software package
|
||||
Depends on A list of dependencies, separated either by spaces or commas
|
||||
.EE
|
||||
|
||||
Note that you should use the obfuscated email address (illustrated in the example above) if
|
||||
you want to put your ports in any of the official CRUX repositories.
|
||||
|
||||
\fIDepends on\fP can be omitted if there are no dependencies.
|
||||
|
||||
.SS Dependencies
|
||||
|
||||
Dependencies are supported by CRUX tools like \fBprt-get\fP and \fBpkg-get\fP.
|
||||
The following rules should be respected:
|
||||
|
||||
.IP "" 4
|
||||
List all runtime dependencies except for gcc (libstdc++) and glibc.
|
||||
.IP "" 4
|
||||
\fBcore\fP contains essential packages for a CRUX system, and our scripts
|
||||
and ports expect the programs provided by \fBcore\fP to be installed; this
|
||||
means that:
|
||||
.IP "" 8
|
||||
build dependencies provided by \fBcore\fP are not listed in the dependency header
|
||||
.IP "" 8
|
||||
run-time dependencies from \fBcore\fP which aren't dynamically linked in are not to be listed, either
|
||||
.TP
|
||||
Examples:
|
||||
.IP "" 4
|
||||
\fBopt/sloccount\fP does \fInot\fP list \fBperl\fP, because the program is a perl script -- there's no binary that links to \fBlibperl\fP
|
||||
.IP "" 4
|
||||
\fBopt/libxml2\fP \fIdoes\fP list \fBzlib\fP, because \fBlibxml\fP is linked to \fBlibz\fP.
|
||||
.LP
|
||||
The reasoning for these guidelines is that you can use \fBrevdep\fP to find ports
|
||||
that need to be updated if one of the dependent libraries has become
|
||||
binary incompatible. To find out what libraries a binary is linked to,
|
||||
use \fBldd\fP or \fBfinddeps\fP.
|
||||
.LP
|
||||
It \fIis\fP permissible to list build dependencies outside of \fBcore\fP, whose only purpose is to
|
||||
generate the manpage of the port. But if the dependency chain is too convoluted, try to find
|
||||
alternative ways of providing such static documentation.
|
||||
.TP
|
||||
Examples:
|
||||
.IP "" 4
|
||||
\fBgreetd\fP \fIdoes\fP list \fBscdoc\fP (only needed to generate the manpages), because the dependency chain
|
||||
leading to this dependency is just \fBscdoc\fP itself.
|
||||
.IP "" 4
|
||||
\fBmpd\fP does \fInot\fP list \fBpython3-sphinx\fP (only needed to generate the manpages), because of the
|
||||
long dependency chain leading to \fBpython3-sphinx\fP, and the possibility of delivering the manpages by
|
||||
simpler means.
|
||||
|
||||
.SS Optional dependencies
|
||||
|
||||
A common practice among port maintainers is to put filesystem tests in the \fIbuild\fP function,
|
||||
allowing the package configuration to vary depending on what other packages the system administrator
|
||||
has installed. This practice can result in footprint mismatches. It is recommended that
|
||||
maintainers build their ports in a container with the bare minimum of dependencies, or prune the
|
||||
auto-generated footprint so that the spurious files are not reported as MISSING on another user's
|
||||
system.
|
||||
.PP
|
||||
Filesystem tests are also useful at the end of a \fIbuild\fP function, for example when determining
|
||||
which shell completions should be installed. Here is a template for tests of this kind:
|
||||
.EX
|
||||
prt-get isinst bash-completion || rm -rf $PKG/usr/share/bash-completion
|
||||
prt-get isinst zsh || rm -rf $PKG/usr/share/zsh
|
||||
prt-get isinst fish || rm -rf $PKG/usr/share/fish
|
||||
.EE
|
||||
.PP
|
||||
If the maintainer built the package in a clean container, then another user with fish installed will
|
||||
see the path /usr/share/fish listed as NEW in the footprint mismatch, and that user can proceed with
|
||||
installation if PKGMK_IGNORE_NEW was enabled in \fBpkgmk.conf\fP(5). More dangerous is the reverse
|
||||
situation: the maintainer built the package in a system with fish, and a user without fish sees
|
||||
/usr/share/fish listed as MISSING in the footprint mismatch. Users should not be encouraged to disregard
|
||||
MISSING, but enabling PKGMK_IGNORE_NEW is generally safe.
|
||||
|
||||
.SS rc start scripts
|
||||
|
||||
You can use the following template for ports that provide some
|
||||
sort of daemon. The runnable script should be called \fI$name.rc\fP,
|
||||
and your port should install it to \fI/etc/rc.d/$name\fP. The installation
|
||||
can happen by calling the following in your \fIbuild\fP function:
|
||||
|
||||
.EX
|
||||
install -D -m 755 $SRC/$name.rc $PKG/etc/rc.d/$name
|
||||
.EE
|
||||
.LP
|
||||
See the existing scripts under /etc/rc.d for examples of using \fBstart-stop-daemon\fP(8)
|
||||
to generate the necessary pid files, temp directories, and logs for your daemon.
|
||||
|
||||
.SH ENVIRONMENT
|
||||
.LP
|
||||
The \fIbuild\fP function should use the \fI$SRC\fP variable whenever it needs
|
||||
to access the files listed in the source variable, and the \fI$PKG\fP
|
||||
variable as the root destination of the output files.
|
||||
.LP
|
||||
Being a shell script executed in the context of \fBpkgmk\fP(8), the
|
||||
entire \fBPkgfile\fP has access to the variables initialized
|
||||
in \fBpkgmk.conf\fP(5) and the default values set by \fBpkgmk\fP(8). Also, as a
|
||||
side effect of how it is used by \fBpkgmk\fP(8), the Pkgfile can also
|
||||
change the behaviour of \fBpkgmk\fP(8) by rewriting some of its functions
|
||||
and variables before \fIbuild()\fP is called. However, the \fIbuild\fP
|
||||
function itself has only read access to these environment variables
|
||||
and shell functions.
|
||||
.SH ERRORS
|
||||
.LP
|
||||
Most of the command failures in \fIbuild()\fP will stop
|
||||
the build process. There is no need to explicitly check the return
|
||||
codes. If you need/want to handle a command failure you should use
|
||||
constructs like:
|
||||
|
||||
.EX
|
||||
\fBif ! command...; then ...\fP
|
||||
\fBcommand || ...\fP
|
||||
.EE
|
||||
.SH SEE ALSO
|
||||
pkgmk(8), pkgmk.conf(5),
|
||||
.UR https://crux.nu/Main/PortGuidelines
|
||||
.UE ,
|
||||
.UR https://crux.nu/Main/PrePostInstallGuidelines
|
||||
.UE .
|
||||
.SH COPYRIGHT
|
||||
pkgmk (pkgutils) is Copyright (c) 2000-2005 Per Liden and Copyright (c) 2006-2018 CRUX team (http://crux.nu).
|
||||
pkgmk (pkgutils) is licensed through the GNU General Public License.
|
||||
Read the COPYING file for the complete license.
|
@ -1,70 +0,0 @@
|
||||
--- prt-utils-1.1.4/portspage 2020-10-15 05:16:54.000000000 -0400
|
||||
+++ prt-utils-1.1.4d/portspage 2021-06-26 09:48:55.002676259 -0400
|
||||
@@ -1,16 +1,18 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
-our $version = "1.0.4";
|
||||
+our $version = "1.0.5";
|
||||
|
||||
########################################################################
|
||||
#
|
||||
-# portspage (http://www.karsikkopuu.net/crux/scripts/)
|
||||
+# portspage
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# This is a script for generating CRUX port listings.
|
||||
# Distributed under the terms of the GPL license.
|
||||
-# Report bugs and suggestions to <jukka@karsikkopuu.net>.
|
||||
+# Report bugs and suggestions to jmcquah at disroot dot org.
|
||||
#
|
||||
# Changelog:
|
||||
+# 1.0.5
|
||||
+# - Added a table row containing the signify public key
|
||||
# 1.0.4
|
||||
# - Added --date-from-pkgfile (patch from Mikhail Kolesnik)
|
||||
# 1.0.3
|
||||
@@ -23,6 +25,7 @@
|
||||
########################################################################
|
||||
|
||||
use strict;
|
||||
+use Cwd qw(cwd getcwd);
|
||||
|
||||
our %options =
|
||||
(
|
||||
@@ -229,7 +232,28 @@
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
+
|
||||
+
|
||||
+
|
||||
print " <table width=\"100%\" cellspacing=\"0\">\n";
|
||||
+ my $CWD = getcwd;
|
||||
+ my @repopath = split /\//, $CWD;
|
||||
+ my $repo = $repopath[$#repopath];
|
||||
+ my $pubkey = "/etc/ports/".$repo.".pub";
|
||||
+ if (-e $pubkey) {
|
||||
+ open(KH, $pubkey) or die "Couldn't read from public key!";
|
||||
+ while (my $line = <KH>) {
|
||||
+ chomp $line;
|
||||
+ if ($line =~ "untrusted comment") {
|
||||
+ }
|
||||
+ else {
|
||||
+ print " <tr class=\"header\"><td colspan=\"4\">\n";
|
||||
+ print " <strong>Signify public key:</strong> $line\n";
|
||||
+ print " </td></tr>\n";
|
||||
+ }
|
||||
+ }
|
||||
+ close(KH);
|
||||
+ }
|
||||
print " <tr class=\"header\"><td><b>Port</b></td><td><b>Version</b></td><td><b>Description</b></td>";
|
||||
if ($options{timestamp_accuracy} > 0)
|
||||
{
|
||||
@@ -293,7 +317,7 @@
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
- print " <p><i>Generated by <a href=\"http://www.karsikkopuu.net/crux/scripts/\">portspage</a> $version on " . isotime() . ".</i></p>\n";
|
||||
+ print " <p><i>Generated by portspage $version on " . isotime() . ".</i></p>\n";
|
||||
|
||||
print <<EOH;
|
||||
</body>
|
@ -1,315 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# $Id: prtsweep,v 1.2 2003/12/17 21:17:02 opel Exp $
|
||||
# (c) 2002, 2003 by Martin Opel <martin at obbl-net dot de>
|
||||
# Revised 2021 by John McQuah <jmcquah at disroot dot org>
|
||||
#
|
||||
# May be redistributed and modified under the terms of the GPL
|
||||
# only usable with CRUX Linux, version 1.0 or higher
|
||||
#
|
||||
# USE AT YOUR OWN RISK
|
||||
#
|
||||
# This script scans your supfiles in /etc/ports to find out your port
|
||||
# directories and then scans all ports for old files, which are not part
|
||||
# of the source-array in the Pkgfile and are not pkgfiles (name#version...).
|
||||
# All these old files are removed. For details see "man 1 prtsweep".
|
||||
#
|
||||
|
||||
info() {
|
||||
echo -e "=======> $@"
|
||||
}
|
||||
|
||||
msg() {
|
||||
echo -e "+ $@"
|
||||
}
|
||||
|
||||
error() {
|
||||
info "ERROR: $@"
|
||||
}
|
||||
|
||||
interrupted() {
|
||||
info "exiting..."
|
||||
exit 1
|
||||
}
|
||||
|
||||
getportdirs() {
|
||||
cat /etc/ports/*.{httpup,rsync} 2>/dev/null \
|
||||
| awk -F= '$1=="destination" || $1=="ROOT_DIR" {print $2}'
|
||||
}
|
||||
|
||||
remove() {
|
||||
item=$1
|
||||
if [ -f "$item" ]; then
|
||||
if [ "$dryrun" = "1" ]; then
|
||||
msg "removing file $item (dryrun)"
|
||||
else
|
||||
msg "removing file $item"
|
||||
rm "$item"
|
||||
fi
|
||||
elif [ -d "$item" ]; then
|
||||
if [ "$dryrun" = "1" ]; then
|
||||
msg "removing directory $item (dryrun)"
|
||||
else
|
||||
msg "removing directory $item"
|
||||
rm -r "$item"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
removeemptydir() {
|
||||
# called if the directory lacks a Pkgfile. Still need to check whether
|
||||
# it is actually empty.
|
||||
local baggage
|
||||
baggage=(`find $1`)
|
||||
if [ ${#baggage[@]} -eq 1 ]; then
|
||||
remove $1
|
||||
else
|
||||
info "files still remaining in port directory '$1'!"
|
||||
info "okay to remove them? (y/n)"
|
||||
read CONSENT
|
||||
if [ "$CONSENT" = "y" ]; then
|
||||
for (( f=1; f<${#baggage[@]}; f++ )); do
|
||||
remove ${baggage[$f]}
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
inlist() {
|
||||
local excode
|
||||
item=$1
|
||||
shift
|
||||
list="$@"
|
||||
excode=1 # assume not in the list until proven otherwise
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
if [ "$item" = "$1" ]; then
|
||||
excode=0
|
||||
break
|
||||
else
|
||||
shift
|
||||
fi
|
||||
done
|
||||
|
||||
return $excode
|
||||
}
|
||||
|
||||
PWD_filename() {
|
||||
if [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
|
||||
echo "${BASH_REMATCH[2]}"
|
||||
else
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
remote_filename() {
|
||||
if [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
|
||||
echo "/remote/path/${BASH_REMATCH[2]}"
|
||||
else
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
nsweep() {
|
||||
dir=$1
|
||||
reset_keepfiles
|
||||
local printedpwd="false"
|
||||
local name version source renames pkgfiles packagename packagepath subdir
|
||||
|
||||
if [ ! -d $dir ]; then
|
||||
error "'`pwd`/$dir' is not a directory!"
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ ! -f $dir/Pkgfile ]; then
|
||||
info `pwd`/$dir
|
||||
msg "no Pkgfile found, empty port '$dir'."
|
||||
if [ "$delete" = "1" ]; then
|
||||
removeemptydir $dir
|
||||
else
|
||||
msg "use '-d' to remove empty directories."
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
echo "sweeping the directory for port $dir"
|
||||
|
||||
# read the port information from its Pkgfile and save the results in a bash array.
|
||||
# This loop assumes that renaming is only applied to files downloaded over http or ftp,
|
||||
# not under version control systems like rsync or httpup. To preserve this information,
|
||||
# an arbitrary URI scheme is prepended before the desired filename.
|
||||
pkgfiles=(`( . $dir/Pkgfile; PKGLOC=$(eval "printf '%s' $PKGGLOB"); \
|
||||
PKGFILE=$(eval "printf '%s' $BLTGLOB"); \
|
||||
for (( p=0; p<${#source[@]}; p++ )); do \
|
||||
[ -n "${renames[$p]}" -a "${renames[$p]}" != "SKIP" ] && source[$p]="ftp://somehost/${renames[$p]}"; \
|
||||
done; echo "$PKGLOC/$PKGFILE"; \
|
||||
printf '%s ' "${source[@]}" )`)
|
||||
|
||||
cd $dir
|
||||
# (new feature in v0.5) remove the package too, if the user requests it with the "-p" flag
|
||||
if [ "$pkgtoo" != "1" ]; then
|
||||
packagename=`basename ${pkgfiles[0]}`
|
||||
packagepath=`dirname ${pkgfiles[0]}`
|
||||
if [ "${packagepath:0:1}" = "/" ]; then
|
||||
KEEP_FILES="${KEEP_FILES} $packagename"
|
||||
elif [ "${packagepath:0:1}" != "/" ]; then
|
||||
subdir=$(echo $PKGLOC | sed "s|/.*||")
|
||||
KEEP_FILES="${KEEP_FILES} $subdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Now that we're safely out of the nested subshell, the URI scheme can be replaced.
|
||||
# Make the new value match the `ls -A` output unless the user has requested
|
||||
# removal of source files too.
|
||||
if [ "$rmsources" = 1 ]; then
|
||||
for (( p=1; p<${#pkgfiles[@]}; p++ )); do
|
||||
pkgfiles[$p]=`remote_filename ${pkgfiles[$p]}`
|
||||
done
|
||||
else
|
||||
for (( p=1; p<${#pkgfiles[@]}; p++ )); do
|
||||
pkgfiles[$p]=`PWD_filename ${pkgfiles[$p]}`
|
||||
done
|
||||
fi
|
||||
|
||||
unset pkgfiles[0]
|
||||
for f in `ls -A`; do
|
||||
if [[ ! ${KEEP_FILES} =~ "$f" ]] && ! inlist "$f" ${pkgfiles[@]}; then
|
||||
if [ "$printedpwd" = "false" ]; then
|
||||
printedpwd="true"
|
||||
info `pwd`
|
||||
fi
|
||||
remove $f
|
||||
fi
|
||||
done
|
||||
cd - &>/dev/null
|
||||
}
|
||||
|
||||
reset_keepfiles() {
|
||||
KEEP_FILES="Pkgfile README pre-install post-install
|
||||
.footprint .signature .32bit .nostrip"
|
||||
}
|
||||
|
||||
getoptions() {
|
||||
while [ "$1" = "-a" -o "$1" = "-d" -o "$1" = "-n" -o "$1" = "-p" -o "$1" = "-s" -o "$1" = "-q" ]; do
|
||||
if [ "$1" = "-q" ]; then
|
||||
quiet=1
|
||||
shift
|
||||
elif [ "$1" = "-s" ]; then
|
||||
rmsources=1
|
||||
shift
|
||||
elif [ "$1" = "-p" ]; then
|
||||
pkgtoo=1
|
||||
shift
|
||||
elif [ "$1" = "-n" ]; then
|
||||
dryrun=1
|
||||
shift
|
||||
elif [ "$1" = "-d" ]; then
|
||||
delete=1
|
||||
shift
|
||||
elif [ "$1" = "-a" ]; then
|
||||
auto=1
|
||||
shift
|
||||
fi
|
||||
done
|
||||
ports="$@"
|
||||
|
||||
if [ -z "$ports" -a "$auto" != "1" ]; then
|
||||
echo "You must explicitly call for automatic mode (-a) if you"
|
||||
echo "do not provide the paths of ports you want cleaned."
|
||||
usage
|
||||
elif [ -n "$ports" -a "$auto" = "1" ]; then
|
||||
echo "Automatic mode (-a) is incompatible with providing an"
|
||||
echo "explicit list of ports to clean."
|
||||
usage
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo "Usage: prtsweep [-a] [-d] [-n] [-s] [-p] [-q] [PORTDIR ...]"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
do_sweep() {
|
||||
if [ -z "$ports" -a "$auto" = "1" ]; then
|
||||
for portdir in $collections; do
|
||||
echo $portdir
|
||||
cd $portdir
|
||||
for dir in *; do
|
||||
test -d $dir && nsweep $dir
|
||||
done
|
||||
done
|
||||
elif [ -n "$ports" -a "$auto" != "1" ]; then
|
||||
for dir in $ports; do
|
||||
test -d $dir && nsweep $dir
|
||||
done
|
||||
else
|
||||
usage
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
info_portsgiven() {
|
||||
echo "$0 will not touch anything outside of the portdirs given on the command line,"
|
||||
echo "but it looks like the debris from building your ports might be lying around somewhere else."
|
||||
echo "Consider following up with another script."
|
||||
echo "Press enter to continue."
|
||||
read ACKNOWLEDGE
|
||||
}
|
||||
|
||||
info_auto() {
|
||||
echo "$0 will not touch anything outside of"
|
||||
printf '%s\n' $collections
|
||||
echo "but it looks like the debris from building your ports might be lying around somewhere else."
|
||||
echo "Consider following up with another script."
|
||||
echo "Press enter to continue."
|
||||
read ACKNOWLEDGE
|
||||
}
|
||||
|
||||
# Main work happens below
|
||||
trap "interrupted" SIGHUP SIGINT SIGQUIT SIGTERM
|
||||
|
||||
getoptions $@
|
||||
|
||||
# First determine the directories that have been configured for downloads and built packages.
|
||||
if [ -f /etc/pkgmk.conf ]; then
|
||||
SRCGLOB=$(grep PKGMK_SOURCE_DIR /etc/pkgmk.conf | sed "s/[\t w]*#.*//; s/.*=//")
|
||||
PKGGLOB=$(grep PKGMK_PACKAGE_DIR /etc/pkgmk.conf | sed "s/[\t w]*#.*//; s/.*=//")
|
||||
COMPRESSION_MODE=$(grep COMPRESSION_MODE /etc/pkgmk.conf | sed "s/[\t w]*#.*//; s/.*=//")
|
||||
fi
|
||||
# No custom setting for compression mode means that pkgmk falls back to the default, gzip.
|
||||
[ -n "$COMPRESSION_MODE" ] || COMPRESSION_MODE="gz"
|
||||
|
||||
BLTGLOB='$name#$version-$release.pkg.tar.$COMPRESSION_MODE'
|
||||
|
||||
# Layouts 1 and 2: If all ports share a common directory (either for the sources or for
|
||||
# the built packages), then this script might need to be supplemented by further cleaning.
|
||||
# Suppress the warning if option -q (quiet mode) was given.
|
||||
collections=`getportdirs`
|
||||
|
||||
if [ "$quiet" != "1" ]; then
|
||||
if [ -n "$SRCGLOB" ] && echo "${SRCGLOB}" | grep -q -v '\$name'; then
|
||||
if [ -n "$ports" ]; then
|
||||
info_portsgiven
|
||||
elif [ "$auto" = 1 ]; then
|
||||
info_auto
|
||||
fi
|
||||
do_sweep
|
||||
fi
|
||||
if [ -n "$PKGGLOB" ] && echo "${PKGGLOB}" | grep -q -v '\$name'; then
|
||||
if [ -n "$ports" ]; then
|
||||
info_portsgiven
|
||||
elif [ "$auto" = 1 ]; then
|
||||
info_auto
|
||||
fi
|
||||
do_sweep
|
||||
fi
|
||||
fi
|
||||
|
||||
# Layout 3: the admin has left either PKGMK_SOURCE_DIR or PKGMK_PACKAGE_DIR at its default,
|
||||
# or has defined at least one of them in terms of the port name. Do the sweep
|
||||
# without issuing a warning (The option -q is not applicable for this layout).
|
||||
|
||||
do_sweep
|
@ -1,109 +0,0 @@
|
||||
.\"
|
||||
.\" prtsweep manual page.
|
||||
.\" (C) 2e003 by Martin Opel
|
||||
.\" Revised 2021 by John McQuah
|
||||
.\"
|
||||
.TH prtsweep 1
|
||||
.SH NAME
|
||||
prtsweep \- sweep old files from the ports directories
|
||||
.SH SYNOPSIS
|
||||
.PP
|
||||
.B prtsweep
|
||||
[\-a] [\-d] [\-n] [PORTDIR ...]
|
||||
.SH DESCRIPTION
|
||||
|
||||
The \fIprtsweep\fP program sweeps port directories, deleting unneeded files.
|
||||
"Unneeded" here means not found in the Pkgfile source array, and not the
|
||||
built package
|
||||
.PP
|
||||
.nf
|
||||
name#version-release.pkg.tar.gz
|
||||
.fi
|
||||
.PP
|
||||
All other files are removed. If a port directory is empty, the whole directory
|
||||
can be removed with the \fI\-d\fP option.
|
||||
|
||||
.SH OPTIONS
|
||||
The following options are supported:
|
||||
.TP
|
||||
.I "\-a"
|
||||
This is the automatic mode. In this mode \fIprtsweep\fP reads the ports
|
||||
directories from the rsync and httpup files in /etc/ports and cleans all ports
|
||||
in these directories.
|
||||
.TP
|
||||
.I "\-d"
|
||||
Removes empty directories completely. This happens when ports are moved for
|
||||
example from opt to contrib or vice versa. Note that this option only
|
||||
deletes empty directories, so accidently removing whole directory trees
|
||||
should not happen, even if you use
|
||||
.IP
|
||||
.nf
|
||||
prtsweep \-d /
|
||||
.fi
|
||||
.IP
|
||||
To remove these moved ports completely you have to run \fIprtsweep\fP twice
|
||||
to first remove the files and second remove the empty directory.
|
||||
.TP
|
||||
.I "\-p"
|
||||
Also removes the built package.
|
||||
.TP
|
||||
.I "\-n"
|
||||
Dry-run. Do not remove anything really.
|
||||
.TP
|
||||
.I "\-q"
|
||||
Quiet mode. Do not pause to inform the user when analysis of the config file
|
||||
indicates that clutter from building ports might still remain elsewhere
|
||||
in the filesystem.
|
||||
.SH ENVIRONMENT
|
||||
In automatic mode, \fBprtsweep\fP reads from /etc/pkgmk.conf
|
||||
any custom settings for PKGMK_SOURCE_DIR and PKGMK_PACKAGE_DIR
|
||||
to determine where the clutter from a pkgmk build is likely to
|
||||
appear. If the directories potentially cluttered by pkgmk builds
|
||||
are shared among many ports, e.g., by setting a nonempty
|
||||
PKGMK_SOURCE_DIR with no reference to the port name, then
|
||||
\fBprtsweep\fP will pause and inform the user that a follow-up
|
||||
cleaning using other tools might be needed. This warning can be suppressed
|
||||
by passing the \fB\-q\fP option.
|
||||
.PP
|
||||
\fBprtsweep\fP then gets a list of active port collections
|
||||
from /etc/ports/*.{rsync,httpup}, and for each collection descends into the
|
||||
individual port directories to read the associated Pkgfiles.
|
||||
After reading the Pkgfile, \fBprtsweep\fP will know the source filenames and
|
||||
the package filename. \fBprtsweep\fP then compares the contents of the port
|
||||
directory with this list of needed files, and any non-matching filename is
|
||||
deleted (or just printed to stderr if dry-run mode is enabled).
|
||||
.PP
|
||||
After a real cleaning by \fBprtsweep\fP (not dry-run mode), each port
|
||||
directory should contain only the Pkgfile, source files obtained
|
||||
by rsync or httpup, and the built package (if present, and option -p was
|
||||
not given on the command line).
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
You can call \fIprtsweep\fP with one port:
|
||||
.PP
|
||||
.nf
|
||||
root@hostname:/root # prtsweep /usr/ports/opt/dialog
|
||||
=======> /usr/ports/opt/dialog
|
||||
+ removing file dialog-0.9b-20020814.tgz
|
||||
.fi
|
||||
.PP
|
||||
Or you could call the automatic mode, which scans your supfiles in /etc/ports
|
||||
for all ports directories and cleans them automatically:
|
||||
.PP
|
||||
.nf
|
||||
root@hostname:/root # prtsweep -a
|
||||
=======> /usr/ports/clc/stable/atop
|
||||
+ removing file atop-1.8.tar.gz
|
||||
=======> /usr/ports/clc/stable/coldsync
|
||||
+ removing file coldsync-2.2.5-gcc3.diff
|
||||
+ removing file coldsync-2.2.5.tar.gz
|
||||
=======> /usr/ports/clc/stable/dnsmasq
|
||||
+ removing file dnsmasq-1.10.tar.gz
|
||||
...
|
||||
.fi
|
||||
|
||||
.SH AUTHORS
|
||||
Martin Opel <mo at obbl-net dot de>, John McQuah <jmcquah at disroot dot org>
|
||||
.SH "SEE ALSO"
|
||||
prtwash(1)
|
@ -1,417 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# prtwash - a simple bash script for cleaning the port tree
|
||||
# of the CRUX Linux distribution.
|
||||
#
|
||||
# Copyright (c) 2003 by Simone Rota <sip@varlock.com>
|
||||
# Revised 2021 by John McQuah <jmcquah@disroot.org>
|
||||
#
|
||||
# *************************************************************************
|
||||
# * *
|
||||
# * This program 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 2 of the License, or *
|
||||
# * (at your option) any later version. *
|
||||
# * *
|
||||
# *************************************************************************
|
||||
#
|
||||
# Took some inspiration and code from Martin Opel's prtsweep v1.6 script,
|
||||
# and comments by therealfun on FlySpray bug 1851.
|
||||
#
|
||||
# **** USE AT YOUR OWN RISK ****
|
||||
#
|
||||
# TODO
|
||||
# - a summary of files / bytes removed after the
|
||||
# execution would be useful.
|
||||
# - verify signatures before sourcing each Pkgfile.
|
||||
#
|
||||
|
||||
VERSION="0.9"
|
||||
|
||||
usage() {
|
||||
echo "Usage: prtwash [-p] [-s] [-d] [-t] [-a] <path> [<path> ...]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
showversion() {
|
||||
echo "prtwash" $VERSION
|
||||
echo "(c) 2003 by Simone Rota, revised 2021 by John McQuah"
|
||||
echo "This program is distributed under the GNU GPL license"
|
||||
}
|
||||
|
||||
interrupted() {
|
||||
echo "=======> operation interrupted."
|
||||
exit 1
|
||||
}
|
||||
|
||||
checkparams() {
|
||||
# Do some test on given parameters.
|
||||
if [ "$auto" = "0" ]; then
|
||||
|
||||
if [ -z "$prtdirs" ]; then
|
||||
usage
|
||||
exit -1
|
||||
fi
|
||||
|
||||
for (( p=0 ; p<=${#prtdirs[@]} ; p++ )); do
|
||||
|
||||
if [ -z "${prtdirs[$p]}" ]; then
|
||||
unset prtdirs[$p]
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ ! -d "${prtdirs[$p]}" ]; then
|
||||
echo "WARN: '${prtdirs[$p]}' is not the directory for a port. Skipping."
|
||||
unset prtdirs[$p]
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ ! -f "${prtdirs[$p]}"/Pkgfile ]; then
|
||||
echo "WARN: no Pkgfile found in '${prtdirs[$p]}'. Skipping."
|
||||
unset prtdirs[$p]
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
getoptions () {
|
||||
# Name says it all.
|
||||
while getopts bpsdathv opt; do
|
||||
case "$opt" in
|
||||
b) removeoldbuilds=1;;
|
||||
p) removepackage=1;;
|
||||
s) removesources=1;;
|
||||
d) removeaddonfiles=1;;
|
||||
t) test=1;;
|
||||
a) auto=1;;
|
||||
h) usage
|
||||
exit 0
|
||||
;;
|
||||
v) showversion
|
||||
exit 0
|
||||
;;
|
||||
\?) usage
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
prtdirs=("$@")
|
||||
}
|
||||
|
||||
getdirs() {
|
||||
# scans /etc/prt-get.conf for port dirs to process
|
||||
current=""
|
||||
for s in `sed 's/^[ \t]*//;s/[ \t]*$//' \
|
||||
$CONF_PGET|grep '^prtdir.*:'|sed 's/:/ /;s/,/ /;s/prtdir//;s/#.*//'`
|
||||
do
|
||||
if [ "`echo $s|grep '/'`" != "" ]; then
|
||||
current=$s
|
||||
else
|
||||
if [ "$current" != "" ]; then
|
||||
singledirs=(${singledirs[*]} $current/$s)
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for s in `sed 's/^[ \t]*//;s/[ \t]*$//;/:/d' \
|
||||
$CONF_PGET|grep '^prtdir.*'|sed 's/prtdir//;s/#.*//'`
|
||||
do
|
||||
basedirs=(${basedirs[*]} $s)
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
remove() {
|
||||
# Removes a file/directory
|
||||
if [ "$test" = 1 ]; then
|
||||
echo "+ (t) removing" $1
|
||||
else
|
||||
echo "+ removing" $1
|
||||
rm -r $1
|
||||
fi
|
||||
}
|
||||
|
||||
swash() {
|
||||
# There are faster and safer ways of cleaning a directory shared among all ports than
|
||||
# to iterate through the ports collection itself.
|
||||
# Inform the admin that this script is ill-suited for their configuration.
|
||||
echo "It looks like you have defined common directories for downloads or packages." >&2
|
||||
echo "For such a configuration, this script is slower and less reliable" >&2
|
||||
echo "than a custom tool would be." >&2
|
||||
echo "If you intended to clean out your ports repositories instead," >&2
|
||||
echo "consider the companion tool prtsweep." >&2
|
||||
echo "Proceed anyway? (y/n)" >&2
|
||||
read CONFIRM
|
||||
if [ "$CONFIRM" != "y" ]; then
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
finalwarning() {
|
||||
echo "Last chance to bail out!" >&2
|
||||
echo "This script will remove from the common download directories more files " >&2
|
||||
echo "than perhaps you intended." >&2
|
||||
echo "Proceed anyway? (y/n)" >&2
|
||||
read CONFIRM
|
||||
if [ "$CONFIRM" != "y" ]; then
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
nwash() {
|
||||
if [ "$auto" = 0 ]; then
|
||||
|
||||
for p in ${prtdirs[@]}; do
|
||||
echo "Washing the directory of port $p:"
|
||||
wash $p
|
||||
done
|
||||
|
||||
exit 0
|
||||
else
|
||||
|
||||
if [ ! -f "$CONF_PGET" ]; then
|
||||
echo "ERROR: cannot find configuration file '$CONF_PGET'"
|
||||
exit -1
|
||||
fi
|
||||
echo "Analyzing port tree..."
|
||||
|
||||
getdirs
|
||||
|
||||
# wash base dirs
|
||||
for d in ${basedirs[*]}; do
|
||||
if [ -d "$d" ]; then
|
||||
for p in "$d"/*; do
|
||||
if [ -d "$p" ]; then
|
||||
wash $p
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "ERROR: directory '$d' not found, check your configuration file!"
|
||||
fi
|
||||
done
|
||||
|
||||
# wash custom dirs (see prt-get.conf)
|
||||
for p in ${singledirs[*]}; do
|
||||
if [ -d "$p" ]; then
|
||||
wash $p
|
||||
else
|
||||
echo "ERROR: directory '$p' not found, check your configuration file!"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
wash() {
|
||||
# Does the actual removal work.
|
||||
local tosave name version source renames pkgfiles packagename portname SAVELOC PKGLOC
|
||||
local dir=$1
|
||||
if [ ! -f "$dir"/Pkgfile ]; then
|
||||
# tested before, the test here is for
|
||||
# auto (-a) command
|
||||
echo "WARN: no Pkgfile found in $dir. Skipping."
|
||||
else
|
||||
declare -a tosave # array of files not to be deleted
|
||||
pkgfiles=(`( . $dir/Pkgfile; PKGLOC=$(eval "printf '%s' $PKGGLOB"); \
|
||||
PKGFILE=$(eval "printf '%s' $BLTGLOB"); \
|
||||
SAVELOC=$(eval "printf '%s' $SRCGLOB"); \
|
||||
for (( p=0; p<${#source[@]}; p++ )); do \
|
||||
[ -n "${renames[$p]}" -a "${renames[$p]}" != "SKIP" ] && source[$p]="ftp://host/${renames[$p]}"; \
|
||||
done; \
|
||||
printf '%s ' "${SAVELOC:-$dir}"; \
|
||||
printf '%s ' "${PKGLOC:-$dir}/$PKGFILE"; \
|
||||
printf '%s ' "${source[@]}")`)
|
||||
|
||||
SAVELOC=${pkgfiles[0]}
|
||||
packagename=`basename ${pkgfiles[1]}`
|
||||
PKGLOC=`dirname ${pkgfiles[1]}`
|
||||
|
||||
# keep sources
|
||||
if [ "$removesources" = 0 ]; then
|
||||
for (( p=2; p<${#pkgfiles[@]}; p++ )) ; do
|
||||
tosave=( "${tosave[@]}" `get_filename "${pkgfiles[$p]}"` )
|
||||
done
|
||||
fi
|
||||
|
||||
# new in version 0.3 we (try to) always save files that are
|
||||
# retrieved by rsync/httpup (non http(s) or ftp in source)
|
||||
# ie patches, etc. These can be deleted with -d (extra files)
|
||||
# option
|
||||
if [ "$removesources" = 1 ] && [ "$removeaddonfiles" = 0 ]; then
|
||||
for (( p=2; p<${#pkgfiles[@]}; p++ )) ; do
|
||||
src="${pkgfiles[$p]}"
|
||||
pkgfiles[$p]=$(get_filename $src)
|
||||
[ "${src:0:7}" = "ftp://" \
|
||||
-o "${src:0:8}" = "http://" \
|
||||
-o "${src:0:6}" = "https://" ] ||
|
||||
tosave=( "${tosave[@]}" "${pkgfiles[$p]}" )
|
||||
done
|
||||
fi
|
||||
|
||||
# Now that the distinction between files obtained via rsync/httpup
|
||||
# and files downloaded during `pkgmk -d` has been encoded in the
|
||||
# array $tosave, clean up the filenames in the $pkgfiles array.
|
||||
if [ "$removesources" = 0 ] || [ "$removeaddonfiles" = 1 ]; then
|
||||
for (( p=2; p<${#pkgfiles[@]}; p++ )) ; do
|
||||
pkgfiles[$p]=$(get_filename ${pkgfiles[$p]})
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! "$removepackage" = 1 ]; then
|
||||
# keep package
|
||||
tosave=( "${tosave[@]}" "$packagename" )
|
||||
fi
|
||||
|
||||
if [ ! "$removeaddonfiles" = 1 ]; then
|
||||
# keep additional and dot files
|
||||
tosave=( "${tosave[@]}" \
|
||||
".signature" \
|
||||
".32bit" \
|
||||
".footprint" \
|
||||
".nostrip" \
|
||||
"README" \
|
||||
"FAQ" \
|
||||
"pre-install" \
|
||||
"post-install" )
|
||||
fi
|
||||
|
||||
# keep Pkgfile. We always want to keep this nice funny file.
|
||||
tosave=( "${tosave[@]}" "Pkgfile" )
|
||||
|
||||
unset pkgfiles[0] pkgfiles[1]
|
||||
|
||||
# trust that our parsing of the Pkgfile has not set the wrong source directory.
|
||||
# But if an absolute path is specified, restrict the `ls -A` output
|
||||
# to avoid overzealous deletions.
|
||||
cd $SAVELOC
|
||||
if [ "${SAVELOC:0:1}" != "/" ]; then
|
||||
for f in `ls -A`; do
|
||||
keep $f || remove $f
|
||||
done
|
||||
elif [ ${#pkgfiles[@]} -gt 0 ]; then
|
||||
for f in ${pkgfiles[@]}; do
|
||||
for match in `ls -A ${f}* 2>/dev/null`; do
|
||||
keep $match || remove $match
|
||||
done
|
||||
done
|
||||
fi
|
||||
cd - &>/dev/null
|
||||
|
||||
# same trust as to the location of the built packages, if different from SAVELOC.
|
||||
# Older versions can be discarded too, if $removeoldbuilds = 1.
|
||||
if [ "$removepackage" = 1 ]; then
|
||||
(cd $PKGLOC; [ -f $packagename ] && keep "$packagename" || remove "$packagename")
|
||||
fi
|
||||
|
||||
if [ "$removeoldbuilds" = 1 ]; then
|
||||
portname=$(echo "$packagename" | sed 's/#.*//')
|
||||
(cd $PKGLOC; for f in `ls ${portname}*.pkg.tar.[bgx]z* 2>/dev/null`; do keep $f || remove $f; done)
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
keep() {
|
||||
# Checks if filename item is in tosave[] array
|
||||
# return 0 if present, 1 if not.
|
||||
item=$1
|
||||
local excode
|
||||
excode=1 # assume not in the array until proven otherwise
|
||||
|
||||
for i in "${tosave[@]}"; do
|
||||
if [ "$i" = "$item" ]; then
|
||||
[ "$test" = "1" ] && echo "= (t) ... keeping $item" || echo "= ... keeping $item"
|
||||
excode=0
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
return $excode
|
||||
}
|
||||
|
||||
get_filename() {
|
||||
if [[ $1 =~ ^(http|https|ftp|file)://.*/(.+) ]]; then
|
||||
echo "${BASH_REMATCH[2]}"
|
||||
else
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
printparams() {
|
||||
echo "removepackage: $removepackage"
|
||||
echo "removeoldbuilds: $removeoldbuilds"
|
||||
echo "removesources: $removesources"
|
||||
echo "removeaddonfiles: $removeaddonfiles"
|
||||
echo "auto: $auto"
|
||||
echo "test: $test"
|
||||
}
|
||||
|
||||
|
||||
###################################################
|
||||
# Main
|
||||
###################################################
|
||||
|
||||
trap "interrupted" SIGHUP SIGINT SIGQUIT SIGTERM
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
usage
|
||||
exit -1
|
||||
fi
|
||||
|
||||
removepackage=0
|
||||
removesources=0
|
||||
removeaddonfiles=0
|
||||
removeoldbuilds=0
|
||||
test=0
|
||||
auto=0
|
||||
basedirs=()
|
||||
singledirs=()
|
||||
prtdirs=()
|
||||
|
||||
CONF_PGET="/etc/prt-get.conf"
|
||||
CONF_PMK="/etc/pkgmk.conf"
|
||||
|
||||
getoptions $@
|
||||
checkparams $@
|
||||
|
||||
COMPRESSION_MODE="gz"
|
||||
if [ -f $PKGCONFIG ]; then
|
||||
COMPRESS_CFG=$(grep "PKGMK_COMPRESSION_MODE" $CONF_PMK | \
|
||||
sed 's/[\t w]*#.*//;s/.*=//;s/\"//g')
|
||||
[ -n "$COMPRESS_CFG" ] && COMPRESSION_MODE=$COMPRESS_CFG
|
||||
SRCGLOB=$(grep "PKGMK_SOURCE_DIR" $CONF_PMK | sed 's/[\t w]*#.*//; s/.*=//; s/\"//g')
|
||||
PKGGLOB=$(grep "PKGMK_PACKAGE_DIR" $CONF_PMK | sed 's/[\t w]*#.*//; s/.*=//; s/\"//g')
|
||||
fi
|
||||
|
||||
BLTGLOB='$name#$version-$release.pkg.tar.$COMPRESSION_MODE'
|
||||
|
||||
# First determine the type of fs layout the admin configured for source downloads.
|
||||
# Layouts 1 and 2: at least one directory is shared among all ports (for sources or built packages),
|
||||
# or the admin has organized downloads in some other way outside of $PORTS_ROOT.
|
||||
|
||||
if [ -n "${SRCGLOB}" ] && echo "${SRCGLOB}" | grep -q -v '\$name'; then
|
||||
swash
|
||||
nwash
|
||||
elif [ -n "${PKGGLOB}" ] && echo "${PKGGLOB}" | grep -q -v '\$name'; then
|
||||
swash
|
||||
nwash
|
||||
fi
|
||||
|
||||
# Layout 3: separate directories, named according to port, are potentially cluttered with downloads.
|
||||
# Unlike prtsweep, actually try to follow these dynamically-defined paths and clean them up.
|
||||
# $PORTS_ROOT might still remain cluttered after this "wash", but the admin can just run prtsweep.
|
||||
# For such filesystem layouts, the two scripts complement each other nicely.
|
||||
if [ -z "${SRCGLOB}" -o -z "${PKGGLOB}" ]; then
|
||||
nwash
|
||||
elif [ -n "${SRCGLOB}" ] && echo "$SRCGLOB" | grep -q '\$name'; then
|
||||
nwash
|
||||
elif [ -n "${PKGGLOB}" ] && echo "$PKGGLOB" | grep -q '\$name'; then
|
||||
nwash
|
||||
else
|
||||
# Should have exited by now, but if not,
|
||||
# offer another chance to abort.
|
||||
finalwarning
|
||||
nwash
|
||||
fi
|
@ -1,116 +0,0 @@
|
||||
.TH prtwash 1 "June 15, 2021" "prtwash 0.9" ""
|
||||
.SH NAME
|
||||
\fBprtwash \fP- a script to clean the port dirs in CRUX.
|
||||
\fB
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.fam C
|
||||
\fBprtwash\fP [-p] [-s] [-d] [-t] [-a] <path> [<path> ...]
|
||||
.fam T
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
\fBprtwash\fP is a bash script to clean the port tree of a CRUX
|
||||
distribution. You can clean a single or multiple directories
|
||||
or the entire port tree. With the given options it is possible to
|
||||
choose what kind of files the program should delete.
|
||||
A test mode is provided.
|
||||
.PP
|
||||
\fBprtwash\fP was inspired by Martin Opel's prtsweep script.
|
||||
.SH OPTIONS
|
||||
By default prtwash will NOT delete the following items
|
||||
in a port directory:
|
||||
.IP \(bu 3
|
||||
The Pkgfile
|
||||
.IP \(bu 3
|
||||
The sources (as stated in the Pkgfile)
|
||||
.IP \(bu 3
|
||||
The built package
|
||||
.IP \(bu 3
|
||||
The .signature, .footprint, .32bit and .nostrip files
|
||||
.IP \(bu 3
|
||||
Additional files: README, FAQ, pre-install, post-install
|
||||
.PP
|
||||
All items not included in the previous list WILL be deleted
|
||||
(e.g.: the 'work' dir of pkgmk, if present).
|
||||
.PP
|
||||
You can choose to delete some of the above passing the proper
|
||||
option:
|
||||
.TP
|
||||
.B
|
||||
-p
|
||||
also removes the built package
|
||||
.TP
|
||||
.B
|
||||
-s
|
||||
also removes the sources
|
||||
.TP
|
||||
.B
|
||||
-d
|
||||
also remove the additional files: .signature, .footprint, .32bit
|
||||
README, FAQ, pre/post-install
|
||||
.TP
|
||||
.B
|
||||
-t
|
||||
test mode: displays the target files without deleting
|
||||
.TP
|
||||
.B
|
||||
-a
|
||||
run in automatic mode: takes the port dirs from the
|
||||
/etc/prt-get.conf file and do a recursive cleaning.
|
||||
.PP
|
||||
Misc options
|
||||
.TP
|
||||
.B
|
||||
-h
|
||||
Display usage information
|
||||
.TP
|
||||
.B
|
||||
-v
|
||||
Display version
|
||||
.SH ENVIRONMENT
|
||||
In automatic mode, \fBprtwash\fP gets a list of repositories from
|
||||
/etc/prt-get.conf, and for each repository descends into the
|
||||
individual port directories to read the associated Pkgfiles.
|
||||
After reading the Pkgfile in light of any custom settings from
|
||||
/etc/pkgmk.conf, \fBprtwash\fP will know the source filenames,
|
||||
the package filename, and where those files are likely to be found.
|
||||
.PP
|
||||
If the directories potentially cluttered by pkgmk builds are shared
|
||||
among many ports, e.g., by setting a nonempty PKGMK_SOURCE_DIR with
|
||||
no reference to the port name, then \fBprtwash\fP will pause and
|
||||
ask the user to confirm the wash. This gives users the chance to
|
||||
consider whether a different tool like \fBprtsweep\fP is better
|
||||
suited to the task they want performed.
|
||||
.PP
|
||||
If the directories potentially cluttered by pkgmk builds are
|
||||
defined dynamically by port name (or unset), then \fBprtwash\fP
|
||||
in automatic mode will proceed without user intervention.
|
||||
.SH EXAMPLES
|
||||
.TP
|
||||
.B
|
||||
\fBprtwash\fP -a -t
|
||||
does a default wash action on the entire port tree;
|
||||
doesn't really delete the files
|
||||
.TP
|
||||
.B
|
||||
\fBprtwash\fP -a -p -s
|
||||
now we're getting serious: removes all downoaded files
|
||||
and built packages from the entire port tree
|
||||
.TP
|
||||
.B
|
||||
\fBprtwash\fP -a -p -s -d
|
||||
same as the above, but also
|
||||
removes .signature, .footprint, README, etc
|
||||
.TP
|
||||
.B
|
||||
\fBprtwash\fP -p -s /usr/ports/contrib/sitecopy
|
||||
removes all downoaded files
|
||||
and built packages from the sitecopy directory
|
||||
.TP
|
||||
.B
|
||||
\fBprtwash\fP /usr/ports/contrib/*
|
||||
does a default wash action on the contrib port tree
|
||||
.SH AUTHORS
|
||||
Simone Rota <sip at varlock dot com>, John McQuah <jmcquah at disroot dot org>
|
||||
.SH SEE ALSO
|
||||
\fBprtsweep\fP(1)
|
Loading…
Reference in New Issue
Block a user