nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

init-prefs.sh (557B)


      1 function initPrefs() {
      2   version=$1
      3   cfgfile=$2
      4 
      5   if [ ! -f $cfgfile ]; then
      6     $DRY_RUN_CMD mkdir -p $(dirname $cfgfile)
      7     $DRY_RUN_CMD eval "echo '<preferences/>' > $cfgfile"
      8     $DRY_RUN_CMD xml ed -P -L \
      9       -i "/preferences" -t attr -n "xmlns" -v "http://josm.openstreetmap.de/preferences-1.0" \
     10       -i "/preferences" -t attr -n "version" -v "$version" \
     11       $cfgfile
     12   else
     13     $DRY_RUN_CMD xml ed -P -L \
     14       -N N="http://josm.openstreetmap.de/preferences-1.0" \
     15       -u "/N:preferences/@version" -v "$version" \
     16       $cfgfile
     17   fi
     18 }