tzdata: update bbappend for 2013i
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0007-opkg_remove-auto-delete-.pyo-files.patch
1 From 10f884bb67074050bfed837ce674efbe7b5a0527 Mon Sep 17 00:00:00 2001
2 From: Andreas Oberritter <obi@opendreambox.org>
3 Date: Mon, 21 May 2012 14:05:37 +0200
4 Subject: [PATCH 07/19] opkg_remove: auto-delete .pyo files
5 To: opkg-devel@googlegroups.com
6 Cc: paul@paulbarker.me.uk
7
8 Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
9 ---
10  libopkg/opkg_remove.c | 7 +++++++
11  1 file changed, 7 insertions(+)
12
13 diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
14 index 34f9154..03657da 100644
15 --- a/libopkg/opkg_remove.c
16 +++ b/libopkg/opkg_remove.c
17 @@ -375,8 +375,15 @@ remove_data_files_and_list(pkg_t *pkg)
18           }
19  
20           if (!conf->noaction) {
21 +               size_t l = strlen(file_name);
22                 opkg_msg(INFO, "Deleting %s.\n", file_name);
23                unlink(file_name);
24 +               if (l >= 3 && !strcmp(&file_name[l - 3], ".py")) {
25 +                       char pyo_file_name[l + 2];
26 +                       strcpy(pyo_file_name, file_name);
27 +                       strcat(pyo_file_name, "o");
28 +                       unlink(pyo_file_name);
29 +               }
30           } else
31                 opkg_msg(INFO, "Not deleting %s. (noaction)\n",
32                                 file_name);
33 -- 
34 1.9.1
35