summaryrefslogtreecommitdiffstats
path: root/meta/packages/oprofile/oprofile/oparchive-list-files.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/oprofile/oprofile/oparchive-list-files.patch')
-rw-r--r--meta/packages/oprofile/oprofile/oparchive-list-files.patch131
1 files changed, 0 insertions, 131 deletions
diff --git a/meta/packages/oprofile/oprofile/oparchive-list-files.patch b/meta/packages/oprofile/oprofile/oparchive-list-files.patch
deleted file mode 100644
index 8d92efead6..0000000000
--- a/meta/packages/oprofile/oprofile/oparchive-list-files.patch
+++ /dev/null
@@ -1,131 +0,0 @@
1Index: oprofile/pp/oparchive.cpp
2===================================================================
3--- oprofile.orig/pp/oparchive.cpp
4+++ oprofile/pp/oparchive.cpp
5@@ -35,6 +35,11 @@ namespace {
6
7 void copy_one_file(image_error err, string const & source, string const & dest)
8 {
9+ if (options::list_files) {
10+ cout << source << endl;
11+ return;
12+ }
13+
14 if (!copy_file(source, dest) && err == image_ok) {
15 cerr << "can't copy from " << source << " to " << dest
16 << " cause: " << strerror(errno) << endl;
17@@ -46,7 +51,7 @@ int oparchive(options::spec const & spec
18 handle_options(spec);
19
20 /* Check to see if directory can be created */
21- if (create_path(options::outdirectory.c_str())) {
22+ if (!options::list_files && create_path(options::outdirectory.c_str())) {
23 cerr << "Unable to create directory for "
24 << options::outdirectory << "." << endl;
25 exit (EXIT_FAILURE);
26@@ -73,7 +78,8 @@ int oparchive(options::spec const & spec
27
28 cverb << vdebug << exe_name << endl;
29 /* Create directory for executable file. */
30- if (create_path(exe_archive_file.c_str())) {
31+ if (!options::list_files
32+ && create_path(exe_archive_file.c_str())) {
33 cerr << "Unable to create directory for "
34 << exe_archive_file << "." << endl;
35 exit (EXIT_FAILURE);
36@@ -100,7 +106,8 @@ int oparchive(options::spec const & spec
37 /* found something copy it over */
38 string dest_debug_dir = options::outdirectory +
39 dirname + "/.debug/";
40- if (create_dir(dest_debug_dir.c_str())) {
41+ if (!options::list_files
42+ && create_dir(dest_debug_dir.c_str())) {
43 cerr << "Unable to create directory: "
44 << dest_debug_dir << "." << endl;
45 exit (EXIT_FAILURE);
46@@ -130,7 +137,8 @@ int oparchive(options::spec const & spec
47
48 cverb << vdebug << (sample_name) << endl;
49 cverb << vdebug << " destp " << sample_archive_file << endl;
50- if (create_path(sample_archive_file.c_str())) {
51+ if (!options::list_files
52+ && create_path(sample_archive_file.c_str())) {
53 cerr << "Unable to create directory for "
54 << sample_archive_file << "." << endl;
55 exit (EXIT_FAILURE);
56Index: oprofile/pp/oparchive_options.cpp
57===================================================================
58--- oprofile.orig/pp/oparchive_options.cpp
59+++ oprofile/pp/oparchive_options.cpp
60@@ -36,6 +36,7 @@ namespace options {
61 bool exclude_dependent;
62 merge_option merge_by;
63 string outdirectory;
64+ bool list_files;
65 }
66
67
68@@ -47,7 +48,9 @@ popt::option options_array[] = {
69 popt::option(options::outdirectory, "output-directory", 'o',
70 "output to the given directory", "directory"),
71 popt::option(options::exclude_dependent, "exclude-dependent", 'x',
72- "exclude libs, kernel, and module samples for applications")
73+ "exclude libs, kernel, and module samples for applications"),
74+ popt::option(options::list_files, "list-files", 'l',
75+ "just list the files necessary, don't produce the archive")
76 };
77
78
79@@ -60,7 +63,7 @@ void check_options()
80 using namespace options;
81
82 /* output directory is required */
83- if (outdirectory.size() == 0) {
84+ if (outdirectory.size() == 0 && !list_files) {
85 cerr << "Requires --output-directory option." << endl;
86 exit(EXIT_FAILURE);
87 }
88Index: oprofile/pp/oparchive_options.h
89===================================================================
90--- oprofile.orig/pp/oparchive_options.h
91+++ oprofile/pp/oparchive_options.h
92@@ -22,6 +22,7 @@ namespace options {
93 extern bool exclude_dependent;
94 extern merge_option merge_by;
95 extern std::string outdirectory;
96+ extern bool list_files;
97 }
98
99 /// All the chosen sample files.
100Index: oprofile/ChangeLog
101===================================================================
102--- oprofile.orig/ChangeLog
103+++ oprofile/ChangeLog
104@@ -1,5 +1,12 @@
105 2007-05-09 Richard Purdie <rpurdie@openedhand.com>
106
107+ * oparchive.cpp:
108+ * oparchive_options.cpp:
109+ * oparchive_options.h: Add --list-files option to list all files that
110+ would be handled by oparchive.
111+
112+2007-05-09 Richard Purdie <rpurdie@openedhand.com>
113+
114 * oprofile/pp/oparchive.cpp: If the debug files have the same name
115 as the original binary, the binary gets overwritten. Add in a .debug
116 directory to avoid this.
117Index: oprofile/doc/oparchive.1.in
118===================================================================
119--- oprofile.orig/doc/oparchive.1.in
120+++ oprofile/doc/oparchive.1.in
121@@ -50,6 +50,10 @@ Output to the given directory. There is
122 Do not include application-specific images for libraries, kernel modules
123 and the kernel. This option only makes sense if the profile session
124 used --separate.
125+.br
126+.TP
127+.BI "--list-files / -l"
128+Only list the files that would be archived, don't copy them.
129
130 .SH ENVIRONMENT
131 No special environment variables are recognised by oparchive.