url probe and fix as part of lang syncing

This commit is contained in:
RogueM 2016-11-02 20:42:07 +00:00
parent fc2c79d0cb
commit c84a0f1519
15 changed files with 53 additions and 14 deletions

View File

@ -6,6 +6,20 @@ srcdir="../src"
langlist=$(ls "$srcdir")
yamlfile="settings.yaml"
filesync=false
urlfix=false
confirm() {
if [ "$FORCE" == '-y' ]; then
true
else
read -r -p "$1 [y/N] " response < /dev/tty
if [[ $response =~ ^(yes|y|Y)$ ]]; then
true
else
false
fi
fi
}
for overlay in $mdlist; do
board=$(echo "$overlay" | rev | cut -c 4- | rev)
@ -25,11 +39,24 @@ for overlay in $mdlist; do
echo "adding $board to $dirmd/$yamlfile"
echo "- $board" | tee -a ../src/$dirmd/$yamlfile &> /dev/null
fi
if [ -f "$srcdir/$dirmd/overlay/$overlay" ]; then
besturl=$(grep "^url: http" "$masterdir/$overlay")
langurl=$(grep "^url: http" "$srcdir/$dirmd/overlay/$overlay")
if [ "$besturl" != "$langurl" ]; then
echo "url in en $overlay is $besturl"
echo "url in $dirmd $overlay is $langurl"
if confirm "would you like to fix this discrepancy?"; then
sed -i "s|^url.*$|$besturl|" "$srcdir/$dirmd/overlay/$overlay"
echo "external link was fixed" && urlfix=true
fi
fi
fi
done
done
if ! $filesync;then
echo "all pending translations are up-to-date"
if ! $filesync && ! $urlfix;then
echo "all translations are up-to-date"
fi
exit 0

View File

@ -4,6 +4,7 @@ name: I2C
class: interface
type: pinout
description: Raspberry Pi I2C Anschlüsse
url: http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
pin:
'3':
name: Data

View File

@ -4,6 +4,7 @@ name: SPI
class: interface
type: pinout
description: Raspberry Pi SPI Anschlüsse
url: https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/
pincount: 5
pin:
'11':

View File

@ -4,6 +4,7 @@ name: UART
class: interface
type: pinout
description: Raspberry Pi UART Anschlüsse
url: http://elinux.org/RPi_Serial_Connection
pin:
'8':
name: TXD / Senden

View File

@ -3,7 +3,7 @@
name: WiringPi
class: interface
type: pinout
url: http://wiringpi.com/
url: http://wiringpi.com
page_url: wiringpi
pin:
'3':

View File

@ -4,6 +4,7 @@ name: I2C
class: interface
type: pinout
description: Pines de i2c de Rasberry Pi
url: http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
pin:
'3':
name: Datos

View File

@ -4,6 +4,7 @@ name: SPI
class: interface
type: pinout
description: Pines SPI Raspberry Pi
url: https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/
pincount: 5
pin:
'11':

View File

@ -4,6 +4,7 @@ name: UART
class: interface
type: pinout
description: Pines de UART de la Raspberry Pi
url: http://elinux.org/RPi_Serial_Connection
pin:
'8':
name: TXD / Transmitir

View File

@ -4,6 +4,7 @@ name: I2C
class: interface
type: pinout
description: broches i2c de la Raspberry Pi
url: http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
pin:
'3':
name: Données

View File

@ -4,7 +4,7 @@ name: I2C
class: interface
type: pinout
description: Raspberry Pi pin i2c
type: info
url: http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
pin:
'3':
name: Dati

View File

@ -4,6 +4,7 @@ name: SPI
class: interface
type: pinout
description: Pin SPI del Raspberry
url: https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/
pincount: 5
pin:
'11':

View File

@ -4,6 +4,7 @@ name: UART
class: interface
type: pinout
description: Pin UART del Raspberry
url: http://elinux.org/RPi_Serial_Connection
pin:
'8':
name: TXD / Trasmissione

View File

@ -4,6 +4,7 @@ name: I2C
class: interface
type: pinout
description: Raspberry Pi i2c pinleri
url: http://www.raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
pin:
'3':
name: Data

View File

@ -4,6 +4,7 @@ name: SPI
class: interface
type: pinout
description: Raspberry Pi SPI pinleri
url: https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/
pincount: 5
pin:
'11':

View File

@ -4,6 +4,7 @@ name: UART
class: interface
type: pinout
description: Raspberry Pi UART pinleri
url: http://elinux.org/RPi_Serial_Connection
pin:
'8':
name: TXD / Transmit