4b97cd2fb4
```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 ```
60 lines
1.9 KiB
Diff
60 lines
1.9 KiB
Diff
From db62a534ebcf60391d9e0acffa641e60dfba18fb Mon Sep 17 00:00:00 2001
|
||
From: Andrea Brancaleoni <abc@pompel.me>
|
||
Date: Wed, 19 Sep 2018 10:36:36 +0200
|
||
Subject: [PATCH] getmntent fix
|
||
|
||
---
|
||
sbuild/sbuild-mntstream.cc | 15 ++-------------
|
||
sbuild/sbuild-mntstream.h | 3 +--
|
||
2 files changed, 3 insertions(+), 15 deletions(-)
|
||
|
||
diff --git sbuild/sbuild-mntstream.cc sbuild/sbuild-mntstream.cc
|
||
index d376fe5..d7324e7 100644
|
||
--- a/sbuild/sbuild-mntstream.cc
|
||
+++ b/sbuild/sbuild-mntstream.cc
|
||
@@ -37,9 +37,7 @@ namespace
|
||
emap init_errors[] =
|
||
{
|
||
// TRANSLATORS: %1% = mount file name
|
||
- emap(mntstream::MNT_OPEN, N_("Failed to open mount file ‘%1%’")),
|
||
- // TRANSLATORS: %1% = mount file name
|
||
- emap(mntstream::MNT_READ, N_("Failed to read mount file ‘%1%’"))
|
||
+ emap(mntstream::MNT_OPEN, N_("Failed to open mount file ‘%1%’"))
|
||
};
|
||
|
||
}
|
||
@@ -109,16 +107,7 @@ mntstream::read(int quantity)
|
||
errno = 0;
|
||
entry = getmntent(mntfile);
|
||
|
||
- if (entry == 0) // EOF or error
|
||
- {
|
||
- //std::cerr << "Mount file read error: ";
|
||
- if (errno) // error
|
||
- {
|
||
- this->error_status = true;
|
||
- throw error(this->file, MNT_READ, strerror(errno));
|
||
- }
|
||
- return;
|
||
- }
|
||
+ if (entry == 0) return;
|
||
|
||
mntentry newentry(*entry); // make a mntentry
|
||
this->data.push_back(newentry); // push onto the end of the list
|
||
diff --git sbuild/sbuild-mntstream.h sbuild/sbuild-mntstream.h
|
||
index ea3d179..fffcdf4 100644
|
||
--- a/sbuild/sbuild-mntstream.h
|
||
+++ b/sbuild/sbuild-mntstream.h
|
||
@@ -49,8 +49,7 @@ namespace sbuild
|
||
/// Error codes.
|
||
enum error_code
|
||
{
|
||
- MNT_OPEN, ///< Failed to open mount file.
|
||
- MNT_READ ///< Failed to read mount file.
|
||
+ MNT_OPEN ///< Failed to open mount file.
|
||
};
|
||
|
||
/// Exception type.
|
||
--
|
||
2.19.0
|
||
|