diff options
Diffstat (limited to 'core/ports/post_update_patches.patch.new')
-rw-r--r-- | core/ports/post_update_patches.patch.new | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/core/ports/post_update_patches.patch.new b/core/ports/post_update_patches.patch.new new file mode 100644 index 0000000..a69b192 --- /dev/null +++ b/core/ports/post_update_patches.patch.new @@ -0,0 +1,69 @@ +--- ports.in 2004-03-07 21:55:24.000000000 +0100 ++++ ports.in 2016-04-27 22:41:06.030194539 +0200 +@@ -21,7 +21,50 @@ + # + + VERSION="#VERSION#" + PORTS_DIR="/usr/ports" ++PATCHES_DIR="/usr/patches" ++ ++post_update_hooks() { ++ ( ++ . $file ++ case $(basename $driver) in ++ httpup) ++ CURRENT_DIR=${ROOT_DIR#$PORTS_DIR} ++ ;; ++ rsync) ++ CURRENT_DIR=${destination#$PORTS_DIR} ++ ;; ++ git) ++ CURRENT_DIR=/$NAME ++ ;; ++ *) ++ echo "$COMMAND: unknown driver '$(basename $driver)'" ++ exit 1 ++ esac ++ [ -d $PATCHES_DIR$CURRENT_DIR ] || exit 0 ++ for PATCH_PORT in $PATCHES_DIR$CURRENT_DIR/* ++ do ++ [ -d $PATCH_PORT ] || continue ++ [ -d $PORTS_DIR${PATCH_PORT#$PATCHES_DIR} ] || continue ++ cd $PORTS_DIR${PATCH_PORT#$PATCHES_DIR} ++ for DATEI in $(find $PATCH_PORT \( -name ".*" -prune -false \) -o \( -type f -not -name ".*" \) ) ++ do ++ case $DATEI in ++ *.patch) ++ patch -p0 -i $DATEI ++ ;; ++ *.new) ++ cp $DATEI $(basename $DATEI .new) ++ md5sum $(basename $DATEI .new) >> .md5sum ++ ;; ++ *) ++ echo "$COMMAND: patch file '$DATEI' has unknown extension" ++ exit 1 ++ esac ++ done ++ done ++ ) || exit $? ++} + + check_ports_dir() { + if [ ! -d "$PORTS_DIR" ]; then +@@ -53,6 +96,7 @@ + file=/etc/ports/$collection.$suffix + if [ -f $file ]; then + $driver $file ++ post_update_hooks $driver $file + fi + fi + done +@@ -67,6 +111,7 @@ + suffix=`basename $driver` + for file in /etc/ports/*.$suffix; do + $driver $file ++ post_update_hooks $driver $file + done + fi + done |