diff options
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r-- | archival/dpkg.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 8031956e9..a6a8333a8 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -149,6 +149,11 @@ enum edge_type_e { | |||
149 | EDGE_RECOMMENDS = 13, | 149 | EDGE_RECOMMENDS = 13, |
150 | EDGE_ENHANCES = 15 | 150 | EDGE_ENHANCES = 15 |
151 | }; | 151 | }; |
152 | #if ENABLE_PLATFORM_MINGW32 | ||
153 | #undef VER_EQUAL | ||
154 | #undef VER_LESS | ||
155 | #undef VER_LESS_EQUAL | ||
156 | #endif | ||
152 | enum operator_e { | 157 | enum operator_e { |
153 | VER_NULL = 0, | 158 | VER_NULL = 0, |
154 | VER_EQUAL = 1, | 159 | VER_EQUAL = 1, |
@@ -1770,6 +1775,10 @@ int dpkg_main(int argc UNUSED_PARAM, char **argv) | |||
1770 | int state_status; | 1775 | int state_status; |
1771 | int status_num; | 1776 | int status_num; |
1772 | int i; | 1777 | int i; |
1778 | #if ENABLE_PLATFORM_MINGW32 | ||
1779 | char **ptr, *path; | ||
1780 | int fd; | ||
1781 | #endif | ||
1773 | #if ENABLE_LONG_OPTS | 1782 | #if ENABLE_LONG_OPTS |
1774 | static const char dpkg_longopts[] ALIGN1 = | 1783 | static const char dpkg_longopts[] ALIGN1 = |
1775 | // FIXME: we use -C non-compatibly, should be: | 1784 | // FIXME: we use -C non-compatibly, should be: |
@@ -1814,6 +1823,26 @@ int dpkg_main(int argc UNUSED_PARAM, char **argv) | |||
1814 | bb_show_usage(); | 1823 | bb_show_usage(); |
1815 | } | 1824 | } |
1816 | 1825 | ||
1826 | #if ENABLE_PLATFORM_MINGW32 | ||
1827 | if (opt & OPT_install) { | ||
1828 | /* add system drive prefix to filenames, if necessary */ | ||
1829 | for (ptr = argv; *ptr; ++ptr) { | ||
1830 | *ptr = xabsolute_path(*ptr); | ||
1831 | } | ||
1832 | } | ||
1833 | |||
1834 | chdir_system_drive(); | ||
1835 | |||
1836 | /* initialise data store */ | ||
1837 | path = xstrdup("/var/lib/dpkg/info"); | ||
1838 | bb_make_directory(path, -1, FILEUTILS_RECUR); | ||
1839 | free(path); | ||
1840 | |||
1841 | fd = open("/var/lib/dpkg/status", O_RDWR|O_CREAT, 0666); | ||
1842 | if (fd >= 0) | ||
1843 | xclose(fd); | ||
1844 | #endif | ||
1845 | |||
1817 | /* puts("(Reading database ... xxxxx files and directories installed.)"); */ | 1846 | /* puts("(Reading database ... xxxxx files and directories installed.)"); */ |
1818 | index_status_file("/var/lib/dpkg/status"); | 1847 | index_status_file("/var/lib/dpkg/status"); |
1819 | 1848 | ||