mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-24 19:25:33 +01:00
Platform independent manifest verification
This commit is contained in:
parent
4fe5caa7d9
commit
f7ed4da0d0
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
OUTPUT=`check-manifest`
|
|
||||||
EXPECTED_OUTPUT="lists of files in version control and sdist match"
|
|
||||||
if [[ "$OUTPUT" != "$EXPECTED_OUTPUT" ]]; then
|
|
||||||
echo "Check-manifest didn't match."
|
|
||||||
echo "OUTPUT: $OUTPUT"
|
|
||||||
echo "EXPECTED_OUTPUT: $EXPECTED_OUTPUT"
|
|
||||||
exit 1 # Error
|
|
||||||
else
|
|
||||||
echo "Manifest verified."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
17
bin/verify-manifest.py
Executable file
17
bin/verify-manifest.py
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
import os, subprocess
|
||||||
|
import errno, sys
|
||||||
|
|
||||||
|
EXPECTED_OUTPUT = "lists of files in version control and sdist match"
|
||||||
|
|
||||||
|
|
||||||
|
def check_manifest():
|
||||||
|
os.chdir('..')
|
||||||
|
output = subprocess.check_output(["check-manifest"]).decode()
|
||||||
|
print(output)
|
||||||
|
if EXPECTED_OUTPUT == output.strip():
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
check_manifest()
|
@ -104,14 +104,14 @@ class VarInt(Type):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def send(value, socket):
|
def send(value, socket):
|
||||||
o = ""
|
out = ""
|
||||||
while True:
|
while True:
|
||||||
b = value & 0x7F
|
byte = value & 0x7F
|
||||||
value >>= 7
|
value >>= 7
|
||||||
o += struct.pack("B", b | (0x80 if value > 0 else 0))
|
out += struct.pack("B", byte | (0x80 if value > 0 else 0))
|
||||||
if value == 0:
|
if value == 0:
|
||||||
break
|
break
|
||||||
socket.send(o)
|
socket.send(out)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def size(value):
|
def size(value):
|
||||||
|
Loading…
Reference in New Issue
Block a user