srcpkgs/[A-Z]*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
for p in ${template%/template}/patches/*; do
sed -i '
\,^[+-][+-][+-] /dev/null,b
/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
s,^[*][*][*] ,&a/,
/^--- /{
s,\(^--- \)\(./\)*,\1a/,
s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1,
s/[.-][Oo][Rr][Ii][Gg]$//
s/[.]patched[.]\([^.]\)/.\1/
h
}
/^+++ -/{
g
s/^--- a/+++ b/
b
}
s,\(^+++ \)\(./\)*,\1b/,
' "$p"
done
sed -i '/^patch_args=/d' $template
done
```
2021-06-19 05:03:21 +02:00
|
|
|
--- a/src/libslic3r/Thread.cpp 2021-01-24 13:50:00.469444149 +0100
|
|
|
|
+++ b/src/libslic3r/Thread.cpp 2021-01-24 13:51:17.109443201 +0100
|
2021-01-25 09:55:30 +01:00
|
|
|
@@ -171,16 +171,27 @@ bool set_thread_name(boost::thread &thre
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifndef __GLIBC__
|
|
|
|
+thread_local char current_thread_name[16] = { 0 };
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
bool set_current_thread_name(const char *thread_name)
|
|
|
|
{
|
|
|
|
+#ifndef __GLIBC__
|
|
|
|
+ strncpy(current_thread_name, thread_name, 15);
|
|
|
|
+#endif
|
|
|
|
pthread_setname_np(pthread_self(), thread_name);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::optional<std::string> get_current_thread_name()
|
|
|
|
{
|
|
|
|
+#ifdef __GLIBC__
|
|
|
|
char buf[16];
|
|
|
|
return std::string(pthread_getname_np(pthread_self(), buf, 16) == 0 ? buf : "");
|
|
|
|
+#else
|
|
|
|
+ return std::string(current_thread_name);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|