port-jobs: Added script for removal of blank lines

Former-commit-id: 207f3b35f60accf85eecbd03e1fd12d914478388
Former-commit-id: 61ea79b06c1af0c70fd7cb3d1b4a6696944ca9fe
This commit is contained in:
2023-04-18 12:58:45 -04:00
parent 4a1752f613
commit 65e5c31163
2 changed files with 22 additions and 0 deletions
+6
View File
@@ -38,6 +38,7 @@ _create_generic_linux() {
cd port-jobs
./CLIPBOARD.py LINUX
./COMMENTS.py ALL
./BLANKS.py
./TABS.sh TABS
cd ..
mv port-jobs/working/* output/linuxtemp/usr/lib/sshyp/
@@ -146,6 +147,7 @@ urls {
cd port-jobs
./CLIPBOARD.py HAIKU
./COMMENTS.py ALL
./BLANKS.py
./TABS.sh TABS
cd ..
mv port-jobs/working/* output/haikutemp/lib/sshyp/
@@ -205,6 +207,7 @@ Installed-Size: 71680
special=WSL-ONLY-UBUNTU
fi
./COMMENTS.py ALL
./BLANKS.py
./TABS.sh TABS
cd ..
mv port-jobs/working/* output/debiantemp/sshyp_"$version"-"$revision"_all/usr/lib/sshyp/
@@ -245,6 +248,7 @@ Installed-Size: 71680
cd port-jobs
./CLIPBOARD.py TERMUX
./COMMENTS.py ALL
./BLANKS.py
./TABS.sh TABS
cd ..
mv port-jobs/working/* output/termuxtemp/sshyp_"$version"-"$revision"_all_termux/data/data/com.termux/files/usr/lib/sshyp/
@@ -301,6 +305,7 @@ cp -r %%{_sourcedir}/usr %%{buildroot}
cd port-jobs
./CLIPBOARD.py LINUX
./COMMENTS.py ALL
./BLANKS.py
./TABS.sh TABS
cd ..
mv port-jobs/working/* output/fedoratemp/usr/lib/sshyp/
@@ -366,6 +371,7 @@ printf "/usr/bin/sshyp
cd port-jobs
./CLIPBOARD.py TERMUX
./COMMENTS.py ALL
./BLANKS.py
./TABS.sh TABS
cd ..
mv port-jobs/working/* output/freebsdtemp/usr/lib/sshyp/
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
from os import listdir
# loop through all Python files in the working directory
for filename in listdir('working'):
if filename.endswith('.py'):
filepath = 'working/' + filename
# read input file
with open(filepath, 'r') as file:
new_file = []
for line in file:
# remove blank lines
if line != '\n':
new_file.append(line)
# write the updated file contents
open(filepath, 'w').writelines(new_file)