void-packages/srcpkgs/atop/patches/atop-bb-compat.patch
Đoàn Trần Công Danh ae69000001 srcpkgs/a*: convert patches to -Np1
* arduino and antiword is kept at -Np0

```sh

git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

36 lines
756 B
Diff

diff --git atop.daily atop.daily
index c72214c..ac4b3b7 100755
--- a/atop.daily
+++ b/atop.daily
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
CURDAY=`date +%Y%m%d`
LOGPATH=/var/log/atop
BINPATH=/usr/bin
@@ -7,15 +7,20 @@ INTERVAL=600 # interval 10 minutes
# verify if atop still runs for daily logging
#
-if [ -e $PIDFILE ] && ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
+pid=
+if [ -e $PIDFILE ]; then
+ pid=$(cat $PIDFILE)
+fi
+
+if [ -n "$pid" ] && [ -d /proc/$pid ]
then
- kill -USR2 `cat $PIDFILE` # final sample and terminate
+ kill -USR2 $pid # final sample and terminate
CNT=0
- while ps -p `cat $PIDFILE` > /dev/null
+ while [ -d /proc/$pid ]
do
- let CNT+=1
+ CNT=$(($CNT + 1))
if [ $CNT -gt 5 ]
then