adde88

some openwrt functions

Oct 20th, 2020
922
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. mf-update(){
  2.   if [ ! -f Makefile ]; then
  3.    echo "No Makefile found in folder."
  4.    return 0
  5.   fi
  6. #  export repo=`grep "PKG_SOURCE_URL" Makefile | awk -F"=" {'print $2'}`
  7.   export lcommit=`git ls-remote --heads src | grep master | awk {'print $1'} | head -1`
  8.   export oversion=`grep "PKG_SOURCE_VERSION:=" Makefile | awk -F"=" {'print $2'}| cut -b 7-`
  9.   export lrelease=`grep "PKG_RELEASE" Makefile | awk -F"=" {'print $2'}`
  10.   let nrelease="$lrelease+1"
  11. #  if [ -z "$repo" ]; then
  12. #    echo "Not a Git repository!"
  13. #    return 0
  14. #  fi
  15.   if [ "$lcommit" != "$oversion" ]; then
  16.     cd ./src
  17.     git pull
  18.     cd ..
  19. #    sed -i "s/^PKG_SOURCE_VERSION:=.*$/PKG_SOURCE_VERSION:=$lcommit/" Makefile
  20.     sed -i "s/^PKG_RELEASE:=.*$/PKG_RELEASE:=$nrelease/" Makefile
  21.     echo "Updated Makfile to use commit: $lcommit"
  22.     echo "OLD RELEASE: $lrelease"
  23.     echo "NEW RELEASE: $nrelease"
  24.     return 1
  25.   else
  26.     echo "Makefile is already up-to-date with latest commit!"
  27.     return 0
  28.   fi
  29. }
  30.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×