Skip to content

Commit

Permalink
for -p0 patches do "no_prefix: true" in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTomecek committed Sep 29, 2020
1 parent 3c6dd29 commit c815816
Show file tree
Hide file tree
Showing 10 changed files with 591 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.egg-info
tests/data/acl/SOURCES

deployment/roles/deploy/files/secrets
tests/data/*/SOURCES/*.tar.gz

deployment/roles/deploy/files/secrets
deployment/roles/deploy/vars/*.yml
!deployment/roles/deploy/vars/local.yml
11 changes: 11 additions & 0 deletions packitpatch
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ patch_name: ${patch_name}
present_in_specfile: true
EOF
)

# when patches are applied with -p0, we need to strip the prefix
# in packit when creating the patch files
if echo ${@:3} | grep -E "[-]p0|[-]p 0"; then
commit_message=$(cat << EOF
$commit_message
no_prefix: true
EOF
)
fi

if [ "$patch_id" != "%{2}" ]; then
# concat 2 strings and separate them with \n - a nightmare to do in bash
printf -v commit_message "${commit_message}\nlocation_in_specfile: ${patch_id}"
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
("haproxy", "c8s"), # they ignore our files
]

# these packages only have a single commit in the respective dist-git branch
TEST_PROJECTS_WITH_BRANCHES_SINGLE_COMMIT = [
(
"HdrHistogram_c",
Expand All @@ -53,6 +54,7 @@
("vhostmd", "c8s"), # -S git, eazy
("acpica-tools", "c8"), # %setup, %patch, unpack %SOURCE1, a ton of operations
("socat", "c8s"), # %setup + %patch # problem with previous commit
("meanwhile", "c8"), # -p0 + -p1 patches
]


Expand Down
13 changes: 13 additions & 0 deletions tests/data/meanwhile/SOURCES/meanwhile-crash.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- src/st_list.c.orig 2008-08-27 11:32:47.000000000 +1000
+++ src/st_list.c 2008-08-27 10:24:34.000000000 +1000
@@ -662,7 +662,9 @@
g_return_if_fail(b != NULL);

mwString_get(b, &str);
- list_get(str, l);
- g_free(str);
+ if (str) {
+ list_get(str, l);
+ g_free(str);
+ }
}
21 changes: 21 additions & 0 deletions tests/data/meanwhile/SOURCES/meanwhile-file-transfer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# User Mikael Berthe <[email protected]>
# Date 1194544713 -3600
Fix file transfers with recent Sametime servers

It seems that the last guint32_get() fails when Meanwhile receives
the FT offer.
I think we can skip it -- works for me but I can't check it with an
older server.

diff -r 4aabc56c0e5f src/srvc_ft.c
--- a/src/srvc_ft.c Tue Nov 06 11:46:26 2007 +0100
+++ b/src/srvc_ft.c Thu Nov 08 18:58:33 2007 +0100
@@ -142,7 +142,7 @@ static void recv_channelCreate(struct mw
mwString_get(b, &fnm); /* offered filename */
mwString_get(b, &txt); /* offering message */
guint32_get(b, &size); /* size of offered file */
- guint32_get(b, &junk); /* unknown */
+ /* guint32_get(b, &junk); */ /* unknown */
/* and we just skip an unknown guint16 at the end */

b_err = mwGetBuffer_error(b);
279 changes: 279 additions & 0 deletions tests/data/meanwhile/SOURCES/meanwhile-fix-glib-headers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
Index: meanwhile-1.1.0/samples/logging_proxy.c
===================================================================
--- meanwhile-1.1.0.orig/samples/logging_proxy.c
+++ meanwhile-1.1.0/samples/logging_proxy.c
@@ -25,7 +25,6 @@
#include <unistd.h>

#include <glib.h>
-#include <glib/glist.h>

#include <mw_cipher.h>
#include <mw_common.h>
Index: meanwhile-1.1.0/samples/login_server.c
===================================================================
--- meanwhile-1.1.0.orig/samples/login_server.c
+++ meanwhile-1.1.0/samples/login_server.c
@@ -19,7 +19,6 @@
#include <unistd.h>

#include <glib.h>
-#include <glib/glist.h>

#include <mw_cipher.h>
#include <mw_common.h>
Index: meanwhile-1.1.0/samples/nocipher_proxy.c
===================================================================
--- meanwhile-1.1.0.orig/samples/nocipher_proxy.c
+++ meanwhile-1.1.0/samples/nocipher_proxy.c
@@ -29,7 +29,6 @@
#include <unistd.h>

#include <glib.h>
-#include <glib/glist.h>

#include <mw_common.h>
#include <mw_message.h>
Index: meanwhile-1.1.0/samples/redirect_server.c
===================================================================
--- meanwhile-1.1.0.orig/samples/redirect_server.c
+++ meanwhile-1.1.0/samples/redirect_server.c
@@ -22,7 +22,6 @@
#include <unistd.h>

#include <glib.h>
-#include <glib/glist.h>

#include <mw_common.h>
#include <mw_message.h>
Index: meanwhile-1.1.0/src/channel.c
===================================================================
--- meanwhile-1.1.0.orig/src/channel.c
+++ meanwhile-1.1.0/src/channel.c
@@ -19,8 +19,6 @@
*/

#include <glib.h>
-#include <glib/ghash.h>
-#include <glib/glist.h>
#include <string.h>

#include "mw_channel.h"
Index: meanwhile-1.1.0/src/mw_debug.c
===================================================================
--- meanwhile-1.1.0.orig/src/mw_debug.c
+++ meanwhile-1.1.0/src/mw_debug.c
@@ -19,7 +19,7 @@
*/


-#include <glib/gstring.h>
+#include <glib.h>

#include "mw_debug.h"

Index: meanwhile-1.1.0/src/mw_message.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_message.h
+++ meanwhile-1.1.0/src/mw_message.h
@@ -22,7 +22,7 @@
#define _MW_MESSAGE_H


-#include <glib/glist.h>
+#include <glib.h>
#include "mw_common.h"


Index: meanwhile-1.1.0/src/mw_srvc_conf.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_srvc_conf.h
+++ meanwhile-1.1.0/src/mw_srvc_conf.h
@@ -22,7 +22,7 @@
#define _MW_SRVC_CONF_H


-#include <glib/glist.h>
+#include <glib.h>
#include "mw_common.h"


Index: meanwhile-1.1.0/src/mw_srvc_dir.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_srvc_dir.h
+++ meanwhile-1.1.0/src/mw_srvc_dir.h
@@ -22,7 +22,6 @@


#include <glib.h>
-#include <glib/glist.h>


#ifdef __cplusplus
Index: meanwhile-1.1.0/src/mw_srvc_place.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_srvc_place.h
+++ meanwhile-1.1.0/src/mw_srvc_place.h
@@ -22,7 +22,7 @@
#define _MW_SRVC_PLACE_H


-#include <glib/glist.h>
+#include <glib.h>
#include "mw_common.h"


Index: meanwhile-1.1.0/src/mw_srvc_resolve.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_srvc_resolve.h
+++ meanwhile-1.1.0/src/mw_srvc_resolve.h
@@ -23,7 +23,6 @@


#include <glib.h>
-#include <glib/glist.h>


#ifdef __cplusplus
Index: meanwhile-1.1.0/src/mw_st_list.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_st_list.h
+++ meanwhile-1.1.0/src/mw_st_list.h
@@ -30,7 +30,6 @@


#include <glib.h>
-#include <glib/glist.h>
#include "mw_common.h"


Index: meanwhile-1.1.0/src/mw_util.h
===================================================================
--- meanwhile-1.1.0.orig/src/mw_util.h
+++ meanwhile-1.1.0/src/mw_util.h
@@ -23,9 +23,6 @@


#include <glib.h>
-#include <glib/ghash.h>
-#include <glib/glist.h>
-

#define map_guint_new() \
g_hash_table_new(g_direct_hash, g_direct_equal)
Index: meanwhile-1.1.0/src/srvc_aware.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_aware.c
+++ meanwhile-1.1.0/src/srvc_aware.c
@@ -19,8 +19,6 @@
*/

#include <glib.h>
-#include <glib/ghash.h>
-#include <glib/glist.h>
#include <string.h>

#include "mw_channel.h"
Index: meanwhile-1.1.0/src/srvc_conf.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_conf.c
+++ meanwhile-1.1.0/src/srvc_conf.c
@@ -19,8 +19,6 @@
*/

#include <glib.h>
-#include <glib/ghash.h>
-#include <glib/glist.h>

#include <stdio.h>
#include <stdlib.h>
Index: meanwhile-1.1.0/src/srvc_dir.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_dir.c
+++ meanwhile-1.1.0/src/srvc_dir.c
@@ -18,7 +18,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

-#include <glib/ghash.h>
+#include <glib.h>

#include "mw_channel.h"
#include "mw_common.h"
Index: meanwhile-1.1.0/src/srvc_ft.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_ft.c
+++ meanwhile-1.1.0/src/srvc_ft.c
@@ -19,7 +19,7 @@
*/


-#include <glib/glist.h>
+#include <glib.h>

#include "mw_channel.h"
#include "mw_common.h"
Index: meanwhile-1.1.0/src/srvc_im.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_im.c
+++ meanwhile-1.1.0/src/srvc_im.c
@@ -19,7 +19,6 @@
*/

#include <glib.h>
-#include <glib/glist.h>
#include <string.h>

#include "mw_channel.h"
Index: meanwhile-1.1.0/src/srvc_place.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_place.c
+++ meanwhile-1.1.0/src/srvc_place.c
@@ -19,8 +19,6 @@
*/

#include <glib.h>
-#include <glib/ghash.h>
-#include <glib/glist.h>

#include <stdio.h>
#include <stdlib.h>
Index: meanwhile-1.1.0/src/srvc_resolve.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_resolve.c
+++ meanwhile-1.1.0/src/srvc_resolve.c
@@ -18,7 +18,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

-#include <glib/ghash.h>
+#include <glib.h>

#include "mw_channel.h"
#include "mw_common.h"
Index: meanwhile-1.1.0/src/srvc_store.c
===================================================================
--- meanwhile-1.1.0.orig/src/srvc_store.c
+++ meanwhile-1.1.0/src/srvc_store.c
@@ -18,7 +18,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

-#include <glib/glist.h>
+#include <glib.h>

#include "mw_channel.h"
#include "mw_debug.h"
Index: meanwhile-1.1.0/src/st_list.c
===================================================================
--- meanwhile-1.1.0.orig/src/st_list.c
+++ meanwhile-1.1.0/src/st_list.c
@@ -20,7 +20,7 @@

#include <stdio.h>
#include <string.h>
-#include <glib/gstring.h>
+#include <glib.h>

#include "mw_debug.h"
#include "mw_util.h"
21 changes: 21 additions & 0 deletions tests/data/meanwhile/SOURCES/meanwhile-format-security-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff -purN meanwhile-1.1.0.orig/src/mw_debug.c meanwhile-1.1.0/src/mw_debug.c
--- meanwhile-1.1.0.orig/src/mw_debug.c 2013-12-03 14:32:31.828241985 +1100
+++ meanwhile-1.1.0/src/mw_debug.c 2013-12-03 14:34:30.152967856 +1100
@@ -92,7 +92,7 @@ void mw_debug_datav(const guchar *buf, g
}
pretty_print(str, buf, len);

- g_debug(str->str);
+ g_debug("%s", str->str);
g_string_free(str, TRUE);
}

@@ -149,7 +149,7 @@ void mw_mailme_datav(const guchar *buf,

g_string_append(str, MW_MAILME_CUT_STOP);

- g_debug(str->str);
+ g_debug("%s", str->str);
g_string_free(str, TRUE);

#else
Loading

0 comments on commit c815816

Please sign in to comment.