Merge lp:~ubuntu-branches/ubuntu/precise/deets/precise-201110200524 into lp:ubuntu/precise/deets

Proposed by Ubuntu Package Importer
Status: Rejected
Rejected by: James Westby
Proposed branch: lp:~ubuntu-branches/ubuntu/precise/deets/precise-201110200524
Merge into: lp:ubuntu/precise/deets
Diff against target: 503 lines (+492/-0) (has conflicts)
1 file modified
.pc/multiarch-dpkg/luau.c (+492/-0)
Text conflict in .pc/multiarch-dpkg/luau.c
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/precise/deets/precise-201110200524
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+79909@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/precise/deets reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/precise/deets/precise-201110200524. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

12. By Steve Langasek

releasing version 0.1.2-1ubuntu1

11. By Steve Langasek

Merge version 0.1.2-1 from Debian testing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/multiarch-dpkg/luau.c'
2--- .pc/multiarch-dpkg/luau.c 2011-10-18 01:38:13 +0000
3+++ .pc/multiarch-dpkg/luau.c 2011-10-20 05:30:32 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 /* deets: luau.c
7 Copyright (C) 2009, 2010, 2011 Clint Adams
8
9@@ -494,3 +495,494 @@
10
11 return 0;
12 }
13+=======
14+/* deets: luau.c
15+ Copyright (C) 2009, 2010, 2011 Clint Adams
16+
17+ This program is free software; you can redistribute it and/or modify
18+ it under the terms of the GNU General Public License as published by
19+ the Free Software Foundation; either version 3 of the License, or
20+ (at your option) any later version.
21+
22+ This program is distributed in the hope that it will be useful,
23+ but WITHOUT ANY WARRANTY; without even the implied warranty of
24+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+ GNU General Public License for more details.
26+
27+ You should have received a copy of the GNU General Public License
28+ along with this program; if not, write to the Free Software
29+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30+ */
31+
32+#include <stdio.h>
33+
34+#include <stdlib.h>
35+#include <string.h>
36+
37+#include <sys/types.h>
38+#include <pwd.h>
39+#include <grp.h>
40+
41+#include <sys/stat.h>
42+#include <unistd.h>
43+
44+#include <sys/utsname.h>
45+
46+#include <getopt.h>
47+
48+#include <sys/socket.h>
49+#include <netdb.h>
50+
51+#define LIBDPKG_VOLATILE_API 1
52+#include <dpkg/dpkg.h>
53+#include <dpkg/dpkg-db.h>
54+
55+#define LUA_LIB 1
56+#include <lua.h>
57+#include <lauxlib.h>
58+#include <lualib.h>
59+
60+int audit_mode = 1;
61+int rectify_mode = 0;
62+int report_mode = 0;
63+int deptrace_mode = 0;
64+int delete_tmpdir_mode = 1;
65+int print_usage = 0;
66+int print_version = 0;
67+const char thisname[] = "luau";
68+
69+static int
70+dpkg_status (lua_State * L)
71+{
72+ struct pkginfo *p;
73+ int j = 0;
74+ int n = lua_gettop (L);
75+ int i;
76+ for (i = 1; i <= n; i++)
77+ {
78+ if (!lua_isstring (L, i))
79+ {
80+ lua_pushstring (L, "incorrect argument");
81+ lua_error (L);
82+ }
83+
84+ p = pkg_db_find (lua_tostring (L, i));
85+ switch (p->status)
86+ {
87+ case stat_notinstalled:
88+ lua_pushstring (L, "not-installed");
89+ break;
90+ case stat_configfiles:
91+ lua_pushstring (L, "config-files");
92+ break;
93+ case stat_halfinstalled:
94+ lua_pushstring (L, "half-installed");
95+ break;
96+ case stat_unpacked:
97+ lua_pushstring (L, "unpacked");
98+ break;
99+ case stat_halfconfigured:
100+ lua_pushstring (L, "half-configured");
101+ break;
102+ case stat_triggersawaited:
103+ lua_pushstring (L, "triggers-awaited");
104+ break;
105+ case stat_triggerspending:
106+ lua_pushstring (L, "triggers-pending");
107+ break;
108+ case stat_installed:
109+ lua_pushstring (L, "installed");
110+ break;
111+ default:
112+ lua_pushinteger (L, p->status);
113+ }
114+ j++;
115+ }
116+ return j;
117+}
118+
119+static int
120+dpkg_pkglist (lua_State * L)
121+{
122+ struct pkgiterator *iter;
123+ struct pkginfo *pkg;
124+ int i = 0;
125+
126+ lua_newtable (L);
127+
128+ for (iter = pkg_db_iter_new (); (pkg = pkg_db_iter_next (iter));)
129+ {
130+ lua_pushnumber (L, ++i);
131+ lua_pushstring (L, pkg->name);
132+ lua_rawset (L, -3);
133+ }
134+ pkg_db_iter_free (iter);
135+
136+ return 1;
137+}
138+
139+static int
140+dpkg_conffilelist (lua_State * L)
141+{
142+ struct pkginfo *p;
143+ struct conffile *c;
144+ int n = lua_gettop (L);
145+ int i = 0;
146+
147+ if (n != 1 || (!lua_isstring (L, 1)))
148+ {
149+ lua_pushstring (L, "incorrect argument");
150+ lua_error (L);
151+ }
152+
153+ p = pkg_db_find (lua_tostring (L, 1));
154+ if (!(c = p->installed.conffiles))
155+ {
156+ lua_pushnil (L);
157+ return 1;
158+ }
159+
160+ lua_newtable (L);
161+
162+ do
163+ {
164+ lua_pushnumber (L, ++i);
165+ lua_pushstring (L, c->name);
166+ lua_rawset (L, -3);
167+ }
168+ while (c = c->next);
169+
170+ return 1;
171+}
172+
173+static const luaL_reg dpkglib[] = {
174+ {"status", dpkg_status},
175+ {"pkglist", dpkg_pkglist},
176+ {"conffilelist", dpkg_conffilelist},
177+ {NULL, NULL}
178+};
179+
180+static int
181+deets_uid_to_name (lua_State * L)
182+{
183+ struct passwd *p;
184+
185+ int n = lua_gettop (L);
186+ int i;
187+ int j = 0;
188+ for (i = 1; i <= n; i++)
189+ {
190+ if (!lua_isnumber (L, i))
191+ {
192+ lua_pushstring (L, "incorrect argument");
193+ lua_error (L);
194+ }
195+
196+ p = getpwuid (lua_tonumber (L, i));
197+ lua_pushstring (L, p->pw_name);
198+ j++;
199+ }
200+
201+ return j;
202+}
203+
204+static int
205+deets_gid_to_name (lua_State * L)
206+{
207+ struct group *g;
208+
209+ int n = lua_gettop (L);
210+ int i;
211+ int j = 0;
212+ for (i = 1; i <= n; i++)
213+ {
214+ if (!lua_isnumber (L, i))
215+ {
216+ lua_pushstring (L, "incorrect argument");
217+ lua_error (L);
218+ }
219+
220+ g = getgrgid (lua_tonumber (L, i));
221+ lua_pushstring (L, g->gr_name);
222+ j++;
223+ }
224+
225+ return j;
226+}
227+
228+static int
229+deets_tempstat (lua_State * L)
230+{
231+ char m[25];
232+ struct stat s;
233+
234+ int n = lua_gettop (L);
235+ int i;
236+ int j = 0;
237+ for (i = 1; i <= n; i++)
238+ {
239+ if (!lua_isstring (L, i))
240+ {
241+ lua_pushstring (L, "incorrect argument");
242+ j++;
243+ lua_error (L);
244+ }
245+
246+ if (!lstat (lua_tostring (L, i), &s))
247+ {
248+ if (S_ISREG (s.st_mode))
249+ lua_pushstring (L, "file");
250+ else if (S_ISDIR (s.st_mode))
251+ lua_pushstring (L, "directory");
252+ else if (S_ISLNK (s.st_mode))
253+ lua_pushstring (L, "link");
254+ else
255+ lua_pushstring (L, "other");
256+
257+ snprintf (m, 24, "%0o", s.st_mode & 007777);
258+ lua_pushstring (L, m);
259+ lua_pushnumber (L, s.st_uid);
260+ lua_pushnumber (L, s.st_gid);
261+ j += 4;
262+ }
263+ else
264+ {
265+ lua_pushnil (L);
266+ j++;
267+ }
268+ }
269+
270+ return j;
271+}
272+
273+static const luaL_reg deetslib[] = {
274+ {"username", deets_uid_to_name},
275+ {"groupname", deets_gid_to_name},
276+ {"tempstat", deets_tempstat},
277+ {NULL, NULL}
278+};
279+
280+void
281+populate_systeminfo (lua_State * L)
282+{
283+
284+ int i;
285+ char buf[64];
286+ struct utsname ubuf;
287+ struct addrinfo hints;
288+ struct addrinfo *carne_de = NULL;
289+
290+ lua_getfield (L, LUA_GLOBALSINDEX, "deets");
291+ lua_newtable (L);
292+
293+ i = gethostname (buf, 63);
294+ lua_pushstring (L, "hostname");
295+ if (i)
296+ lua_pushnil (L);
297+ else
298+ {
299+ buf[63] = '\0';
300+ lua_pushstring (L, buf);
301+ memset (&hints, 0, sizeof (struct addrinfo));
302+ hints.ai_socktype = SOCK_DGRAM;
303+ hints.ai_flags = AI_CANONNAME;
304+
305+ if (getaddrinfo (buf, NULL, &hints, &carne_de))
306+ carne_de = NULL;
307+ }
308+ lua_rawset (L, -3);
309+
310+ lua_pushstring (L, "fqdn");
311+ if (carne_de && carne_de->ai_canonname)
312+ lua_pushstring (L, carne_de->ai_canonname);
313+ else
314+ lua_pushnil (L);
315+ lua_rawset (L, -3);
316+
317+ i = getdomainname (buf, 63);
318+ lua_pushstring (L, "nis_domainname");
319+ if (i)
320+ lua_pushnil (L);
321+ else
322+ {
323+ buf[63] = '\0';
324+ lua_pushstring (L, buf);
325+ }
326+ lua_rawset (L, -3);
327+
328+ if (uname (&ubuf))
329+ {
330+ lua_pushstring (L, "uts_sysname");
331+ lua_pushnil (L);
332+ lua_rawset (L, -3);
333+ lua_pushstring (L, "uts_nodename");
334+ lua_pushnil (L);
335+ lua_rawset (L, -3);
336+ lua_pushstring (L, "uts_release");
337+ lua_pushnil (L);
338+ lua_rawset (L, -3);
339+ lua_pushstring (L, "uts_version");
340+ lua_pushnil (L);
341+ lua_rawset (L, -3);
342+ lua_pushstring (L, "uts_machine");
343+ lua_pushnil (L);
344+ lua_rawset (L, -3);
345+ }
346+ else
347+ {
348+ lua_pushstring (L, "uts_sysname");
349+ lua_pushstring (L, ubuf.sysname);
350+ lua_rawset (L, -3);
351+ lua_pushstring (L, "uts_nodename");
352+ lua_pushstring (L, ubuf.nodename);
353+ lua_rawset (L, -3);
354+ lua_pushstring (L, "uts_release");
355+ lua_pushstring (L, ubuf.release);
356+ lua_rawset (L, -3);
357+ lua_pushstring (L, "uts_version");
358+ lua_pushstring (L, ubuf.version);
359+ lua_rawset (L, -3);
360+ lua_pushstring (L, "uts_machine");
361+ lua_pushstring (L, ubuf.machine);
362+ lua_rawset (L, -3);
363+ }
364+
365+ lua_setfield (L, -2, "systeminfo");
366+
367+}
368+
369+int
370+main (int argc, char **argv)
371+{
372+ int c;
373+ int digit_optind = 0;
374+
375+ int status;
376+
377+ char *tempdir;
378+ char template_dir[] = "/tmp/deets.XXXXXX"; /* use TEMPDIR instead? */
379+
380+ fprintf (stderr, "deets luau version " PACKAGE_VERSION
381+ "\nCopyright (C) 2009, 2010, 2011 Clint Adams\n");
382+ fprintf (stderr, "deets comes with ABSOLUTELY NO WARRANTY.\n");
383+ fprintf (stderr,
384+ "This is free software, and you are welcome to redistribute it\n");
385+ fprintf (stderr, "under certain conditions.\n");
386+
387+ push_error_context ();
388+
389+ modstatdb_open (msdbrw_readonly); /* Use default dpkg db directory. */
390+
391+ while (1)
392+ {
393+ int option_index = 0;
394+ static struct option long_options[] = {
395+ {"audit", 0, &audit_mode, 1},
396+ {"rectify", 0, &rectify_mode, 1},
397+ {"report", 0, &report_mode, 1},
398+ {"dep-trace", 0, &deptrace_mode, 1},
399+ {"delete-tmpdir", 0, &delete_tmpdir_mode, 1},
400+ {"no-audit", 0, &audit_mode, 0},
401+ {"no-rectify", 0, &rectify_mode, 0},
402+ {"no-report", 0, &report_mode, 0},
403+ {"no-dep-trace", 0, &deptrace_mode, 0},
404+ {"no-delete-tmpdir", 0, &delete_tmpdir_mode, 0},
405+ {"help", 0, &print_usage, 1},
406+ {"version", 0, &print_version, 1},
407+ {0, 0, 0, 0}
408+ };
409+
410+ c = getopt_long (argc, argv, "", long_options, &option_index);
411+ if (c == -1)
412+ break;
413+
414+ switch (c)
415+ {
416+ case 0:
417+ case '?':
418+ break;
419+
420+ default:
421+ fprintf (stderr, "Warning: ignoring unknown option %c\n", c);
422+ }
423+ }
424+
425+ if (print_usage)
426+ {
427+ printf ("\n\nUsage: %s [OPTION]... /path/to/luarfile.lua\n\n", argv[0]);
428+ printf (" --audit report conformance rate (default)\n");
429+ printf
430+ (" --rectify bring system into conformance with model\n");
431+ printf (" --report print what --rectify needs to do\n");
432+ printf (" --dep-trace show dependency ordering\n");
433+ printf (" --delete-tmpdir delete deets tmpdir (default)\n");
434+ printf ("\nAny option may be prefixed with 'no' to disable it\n");
435+ printf ("(example: --no-audit)\n");
436+ exit (0);
437+ }
438+
439+ if (print_version)
440+ {
441+ printf
442+ ("\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n");
443+ printf ("\nWritten by Clint Adams.\n");
444+ exit (0);
445+ }
446+
447+ setenv ("LUA_PATH",
448+ DEETS_LUADIR
449+ "/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua;/usr/share/lua/5.1/?.lua;/usr/share/lua/5.1/?/init.lua",
450+ 1);
451+
452+ lua_State *l;
453+ l = luaL_newstate ();
454+ luaL_openlibs (l);
455+
456+ luaL_register (l, "dpkg", dpkglib);
457+ luaL_register (l, "deets", deetslib);
458+
459+ lua_pushboolean (l, audit_mode);
460+ lua_setglobal (l, "audit_mode");
461+ lua_pushboolean (l, rectify_mode);
462+ lua_setglobal (l, "rectify_mode");
463+ lua_pushboolean (l, report_mode);
464+ lua_setglobal (l, "report_mode");
465+ lua_pushboolean (l, deptrace_mode);
466+ lua_setglobal (l, "deptrace_mode");
467+ lua_pushboolean (l, delete_tmpdir_mode);
468+ lua_setglobal (l, "delete_tmpdir_mode");
469+
470+ populate_systeminfo (l);
471+
472+ tempdir = mkdtemp (template_dir);
473+ lua_pushstring (l, tempdir);
474+ lua_setglobal (l, "tempdir");
475+
476+
477+/* status = (luaL_loadfile(l, "init.lua") || lua_pcall(l, 0, 0, 0)); */
478+ status = 999;
479+ status = (luaL_loadfile (l, DEETS_LUADIR "/init.lua"));
480+ lua_call (l, 0, 0);
481+ if (optind < argc)
482+ {
483+ while (optind < argc)
484+ {
485+ status = (luaL_loadfile (l, argv[optind++]));
486+ lua_call (l, 0, 0);
487+ }
488+ }
489+ else
490+ {
491+ status = (luaL_loadfile (l, DEETS_LUADIR "/default.lua"));
492+ lua_call (l, 0, 0);
493+ }
494+ status = (luaL_loadfile (l, DEETS_LUADIR "/fin.lua"));
495+ lua_call (l, 0, 0);
496+
497+ lua_close (l);
498+
499+ pop_error_context (ehflag_normaltidy);
500+
501+ return 0;
502+}
503+>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches

to all changes: