Changeset 391


Ignore:
Timestamp:
Oct 1, 2012, 1:35:52 AM (8 years ago)
Author:
ehem
Message:

More features for patching. This version doesn't have problems with
subdirectories or checking directories with different depths. This also
adds the ability to include the branch name specification in the files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/openwrt/openwrt.mk

    r349 r391  
    22#
    33# Copyright (C) 2010 Johan van Zoomeren <amain@debwrt.net>
     4# Copyright (C) 2012 Elliott Mitchell <ehem+debwrt@m5p.com>
    45#
    56# This program is free software: you can redistribute it and/or modify
     
    7980openwrt/patch: openwrt/checkout
    8081        rev=$(call get_svn_revision,$(OPENWRT_BUILD_DIR)) ; \
    81         field=`echo "$(OPENWRT_PATCHES_DIR)" | awk -F / '{print NF+2}'` ; \
    82         find "$(OPENWRT_PATCHES_DIR)/all" "$(OPENWRT_PATCHES_DIR)/$(OPENWRT_BRANCH)" -name .svn -prune -o -print | \
    83         awk -F / \
    84           'match($$'$${field}', "^[[:digit:]]+(-([[:digit:]]*):([[:digit:]]*))?_", revs) \
    85           { if(revs[2] <= "'$${rev}'" && (!length(revs[3]) || revs[3] >= "'$${rev}'")) print }' | \
    86         sort -t / -k $${field} | \
     82        find \
     83          "$(OPENWRT_PATCHES_DIR)/all" "$(OPENWRT_PATCHES_DIR)/$(OPENWRT_BRANCH)" \
     84          -name .svn -prune -o \! -type d -printf %f/%p\\n | \
     85        gawk \
     86          'match($$1, "^[[:digit:]]+(-$(OPENWRT_BRANCH))?(-([[:digit:]]*):([[:digit:]]*))?_", revs) \
     87          { if(revs[3] <= '$${rev}' && (!length(revs[4]) || revs[4] >= '$${rev}')) print }' | \
     88        sort | sed -e's/^[^/]\+\///' | \
    8789        while read pat ; \
    8890        do \
     
    98100openwrt/unpatch: openwrt/checkout
    99101        rev=$(call get_svn_revision,$(OPENWRT_BUILD_DIR)) ; \
    100         field=`echo "$(OPENWRT_PATCHES_DIR)" | awk -F / '{print NF+2}'` ; \
    101         find "$(OPENWRT_PATCHES_DIR)/all" "$(OPENWRT_PATCHES_DIR)/$(OPENWRT_BRANCH)" -name .svn -prune -o -print | \
    102         awk -F / \
    103           'match($$'$${field}', "^[[:digit:]]+(-([[:digit:]]*):([[:digit:]]*))?_", revs) \
    104           { if(revs[2] <= "'$${rev}'" && (!length(revs[3]) || revs[3] >= "'$${rev}'")) print }' | \
    105         sort -t / -k $${field} -r | \
     102        find \
     103          "$(OPENWRT_PATCHES_DIR)/all" "$(OPENWRT_PATCHES_DIR)/$(OPENWRT_BRANCH)" \
     104          -name .svn -prune -o \! -type d -printf %f/%p\\n | \
     105        gawk \
     106          'match($$1, "^[[:digit:]]+(-$(OPENWRT_BRANCH))?(-([[:digit:]]*):([[:digit:]]*))?_", revs) \
     107          { if(revs[3] <= '$${rev}' && (!length(revs[4]) || revs[4] >= '$${rev}')) print }' | \
     108        sort -r | sed -e's/^[^/]\+\///' | \
    106109        while read pat ; \
    107110        do \
Note: See TracChangeset for help on using the changeset viewer.