Package: rpm / 4.11.3-1.1

debian-disable-rpm.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Description: RPM is not default package manager on Debian
 In Debian, rpm should be used to install packages, but rather as a tool to
 work with rpm packages or as a helper in alien. Because of this we protect
 complain, when user tries to install a package. This warning can be hidden 
 by --force-debian.
Author: Michal Čihař <nijel@debian.org>
Forwarded: http://rpm.org/ticket/79
--- a/configure.ac
+++ b/configure.ac
@@ -567,6 +567,8 @@
 
 AM_CONDITIONAL(ENABLE_PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1])
 
+AC_ARG_WITH(debian, [  --with-debian		build rpm for usage on Debian],[AC_DEFINE(ON_DEBIAN, 1, [Define as 1 if you do not want to use rpm for installing packages])])
+
 AC_PATH_PROG(DOXYGEN, doxygen, no)
 dnl
 dnl Only build internal API + source hacking docs on request
--- a/lib/poptI.c
+++ b/lib/poptI.c
@@ -141,6 +141,11 @@
 
  { "force", '\0', 0, NULL, RPMCLI_POPT_FORCE,
 	N_("short hand for --replacepkgs --replacefiles"), NULL},
+#if defined(ON_DEBIAN)
+ { "force-debian", '\0', POPT_BIT_SET, &rpmIArgs.probFilter,
+	(RPMPROB_FILTER_DEBIAN),
+	N_("force installation of rpm on Debian system"), NULL},
+#endif
 
  { "freshen", 'F', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags,
 	(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL),
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -148,6 +148,14 @@
 #endif	/* IAM_RPMEIU */
 
 #if defined(IAM_RPMEIU)
+#if defined(ON_DEBIAN)
+    if ((bigMode == MODE_INSTALL || bigMode == MODE_ERASE) &&
+        (ia->probFilter & RPMPROB_FILTER_DEBIAN) == 0) {
+        fprintf(stderr, _("%s: %s\n"), __progname, _("RPM should not be used directly install RPM packages, use Alien instead!"));
+        fprintf(stderr, _("%s: %s\n"), __progname, _("However assuming you know what you are doing..."));
+    }
+#endif
+
     if (!( bigMode == MODE_INSTALL ) &&
 (ia->probFilter & (RPMPROB_FILTER_REPLACEPKG | RPMPROB_FILTER_OLDPACKAGE)))
 	argerror(_("only installation and upgrading may be forced"));
--- a/lib/rpmprob.h
+++ b/lib/rpmprob.h
@@ -28,7 +28,8 @@
     RPMPROB_FILTER_REPLACEOLDFILES= (1 << 5),	/*!< from --replacefiles */
     RPMPROB_FILTER_OLDPACKAGE	= (1 << 6),	/*!< from --oldpackage */
     RPMPROB_FILTER_DISKSPACE	= (1 << 7),	/*!< from --ignoresize */
-    RPMPROB_FILTER_DISKNODES	= (1 << 8)	/*!< from --ignoresize */
+    RPMPROB_FILTER_DISKNODES	= (1 << 8),	/*!< from --ignoresize */
+    RPMPROB_FILTER_DEBIAN	= (1 << 9)	/*!< from --force-debian */
 };
 
 typedef rpmFlags rpmprobFilterFlags;