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
@ -49,4 +50,4 @@ DEVICE_BUS = 1
DEVICE_ADDR = 0x15
bus = smbus.SMBus(DEVICE_BUS)
bus.write_byte_data(DEVICE_ADDR, 0x00, 0x01)
```
```

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
@ -33,4 +34,4 @@ import wiringpi2 as wiringpi
wiringpi.wiringPiSetup()
serial = wiringpi.serialOpen('/dev/ttyAMA0',9600)
wiringpi.serialPuts(serial,'hello world!')
```
```

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
@ -50,4 +51,4 @@ DEVICE_BUS = 1
DEVICE_ADDR = 0x15
bus = smbus.SMBus(DEVICE_BUS)
bus.write_byte_data(DEVICE_ADDR, 0x00, 0x01)
```
```

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
@ -51,4 +51,4 @@ DEVICE_BUS = 1
DEVICE_ADDR = 0x15
bus = smbus.SMBus(DEVICE_BUS)
bus.write_byte_data(DEVICE_ADDR, 0x00, 0x01)
```
```

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
@ -33,4 +34,4 @@ import wiringpi2 as wiringpi
wiringpi.wiringPiSetup()
serial = wiringpi.serialOpen('/dev/ttyAMA0',9600)
wiringpi.serialPuts(serial,'ciao mondo!')
```
```

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
@ -49,4 +50,4 @@ DEVICE_BUS = 1
DEVICE_ADDR = 0x15
bus = smbus.SMBus(DEVICE_BUS)
bus.write_byte_data(DEVICE_ADDR, 0x00, 0x01)
```
```

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':
@ -61,12 +62,12 @@ wiringpi.mcp23S17Setup(PIN_BASE,SPI_ADDR)
# 16 pins including the starting pin
mcp23S17pins = range(PIN_BASE,PIN_BASE+15)
for pin in mcp23S17pins:
wiringpi.pinMode(pin,OUTPUT)
wiringpi.digitalWrite(pin,HIGH)
wiringpi.pinMode(pin,OUTPUT)
wiringpi.digitalWrite(pin,HIGH)
```
SPI portunuz ayrıca Gordon Henderson'un modifiye AVRDude'una Arduino skeçleri yükleyerek ATmega 328'ye "[bit banging](http://en.wikipedia.org/wiki/Bit_banging)" de yapabilirsiniz.
Raspberry Pi'nizin SPI port'unu ATmega'nıza bağlayın ve ATmega'yı Raspberry Pi'nin 3.3v gücüyle besleyip açın. SPI sürücüleri çalıştırmadığınızdan emin olduktan sonra "`avrdude -p m328p -c gpio`" komutu ile bağlantıyı kontrol edin.
ATmega'nız varsa her bir pin için ayrı ayrı tıklayarak nasıl bağlayabileceğinizi öğrenebilirsiniz.
ATmega'nız varsa her bir pin için ayrı ayrı tıklayarak nasıl bağlayabileceğinizi öğrenebilirsiniz.

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
@ -29,4 +30,4 @@ import wiringpi2 as wiringpi
wiringpi.wiringPiSetup()
serial = wiringpi.serialOpen('/dev/ttyAMA0',9600)
wiringpi.serialPuts(serial,'merhaba dunya')
```
```