0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-06 02:26:34 +00:00
termux-packages/packages/aptitude/0100-fix-hardcoded-paths.patch
Chongyun Lee a734bf2478 new package: aptitude
Co-Authored-By: kawanakaiku <80381779+kawanakaiku@users.noreply.github.com>
2024-01-08 06:55:43 +08:00

186 lines
6.4 KiB
Diff

diff -uNr a/configure b/configure
--- a/configure
+++ b/configure
@@ -10766,7 +10766,7 @@
STATEDIR="$enableval"
fi
else
- STATEDIR="/var/lib/aptitude"
+ STATEDIR="@TERMUX_PREFIX@/var/lib/aptitude"
fi
@@ -10780,7 +10780,7 @@
LOCKFILE="$enableval"
fi
else
- LOCKFILE="/var/lock/aptitude"
+ LOCKFILE="@TERMUX_PREFIX@/var/lock/aptitude"
fi
diff -uNr a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -633,7 +633,7 @@
else
STATEDIR="$enableval"
fi,
- STATEDIR="/var/lib/aptitude")
+ STATEDIR="@TERMUX_PREFIX@/var/lib/aptitude")
AC_ARG_WITH(lock-loc,
AS_HELP_STRING([--with-lock-loc], [use the given location for storing state (default /var/lock/aptitude)]),
@@ -643,7 +643,7 @@
else
LOCKFILE="$enableval"
fi,
- LOCKFILE="/var/lock/aptitude")
+ LOCKFILE="@TERMUX_PREFIX@/var/lock/aptitude")
AC_ARG_ENABLE(aptitude,
AS_HELP_STRING([--disable-aptitude], [don't compile the program itself]),
diff -uNr a/src/apt_options.cc b/src/apt_options.cc
--- a/src/apt_options.cc
+++ b/src/apt_options.cc
@@ -348,7 +348,7 @@
"be interpreted as a shell command that is to "
"receive the log on standard input."),
PACKAGE "::Log",
- "/var/log/aptitude"),
+ "@TERMUX_PREFIX@/var/log/aptitude"),
option_item(N_("Use localized messages and dates in the log"),
N_("If this option is enabled, aptitude will use the "
"user's locale for messages and dates in the log "
diff -uNr a/src/cmdline/cmdline_changelog.cc b/src/cmdline/cmdline_changelog.cc
--- a/src/cmdline/cmdline_changelog.cc
+++ b/src/cmdline/cmdline_changelog.cc
@@ -288,9 +288,9 @@
void do_cmdline_changelog(const vector<string> &packages,
const std::shared_ptr<terminal_metrics> &term_metrics)
{
- const char *pager="/usr/bin/sensible-pager";
+ const char *pager="@TERMUX_PREFIX@/bin/sensible-pager";
- if(access("/usr/bin/sensible-pager", X_OK)!=0)
+ if(access("@TERMUX_PREFIX@/bin/sensible-pager", X_OK)!=0)
{
_error->Warning(_("Can't execute sensible-pager, is this a working Debian system?"));
diff -uNr a/src/generic/apt/log.cc b/src/generic/apt/log.cc
--- a/src/generic/apt/log.cc
+++ b/src/generic/apt/log.cc
@@ -230,7 +230,7 @@
{
vector<string> logs;
- string main_log = aptcfg->Find(PACKAGE "::Log", "/var/log/" PACKAGE);
+ string main_log = aptcfg->Find(PACKAGE "::Log", "@TERMUX_PREFIX@/var/log/" PACKAGE);
if(!main_log.empty())
logs.push_back(main_log);
diff -uNr a/src/generic/apt/matching/match.cc b/src/generic/apt/matching/match.cc
--- a/src/generic/apt/matching/match.cc
+++ b/src/generic/apt/matching/match.cc
@@ -384,7 +384,7 @@
{
const std::string filename =
aptcfg->FindFile("Apt-Xapian-Index::Index",
- "/var/lib/apt-xapian-index/index");
+ "@TERMUX_PREFIX@/var/lib/apt-xapian-index/index");
db.reset(new Xapian::Database(filename));
}
catch(...)
diff -uNr a/src/generic/apt/pkg_changelog.cc b/src/generic/apt/pkg_changelog.cc
--- a/src/generic/apt/pkg_changelog.cc
+++ b/src/generic/apt/pkg_changelog.cc
@@ -515,7 +515,7 @@
// the changelog exists by trying to stat it.
struct stat buf;
- std::string changelog_file = "/usr/share/doc/";
+ std::string changelog_file = "@TERMUX_PREFIX@/share/doc/";
changelog_file += pkg.Name();
changelog_file += "/changelog.Debian";
diff -uNr a/src/generic/apt/resolver_manager.cc b/src/generic/apt/resolver_manager.cc
--- a/src/generic/apt/resolver_manager.cc
+++ b/src/generic/apt/resolver_manager.cc
@@ -497,7 +497,7 @@
// Should I close open fds here?
// Should I allow tar to be found on the path?
- execl("/bin/tar", "/bin/tar", "czf",
+ execl("@TERMUX_PREFIX@/bin/tar", "@TERMUX_PREFIX@/bin/tar", "czf",
resolver_trace_file.c_str(),
"-C",
trace_dir.c_str(),
diff -uNr a/src/generic/apt/tags.cc b/src/generic/apt/tags.cc
--- a/src/generic/apt/tags.cc
+++ b/src/generic/apt/tags.cc
@@ -196,7 +196,7 @@
static bool load_tags_from_debtags(OpProgress *progress)
{
const string filename(aptcfg->FindFile("Debtags::Package-Tags",
- "/var/lib/debtags/package-tags"));
+ "@TERMUX_PREFIX@/var/lib/debtags/package-tags"));
_error->PushToStack(); // Ignore no-such-file errors.
FileFd F(filename, FileFd::ReadOnly);
_error->RevertToStack();
@@ -353,7 +353,7 @@
tag_descriptions = new tag_description_map;
_error->PushToStack(); // Ignore no-such-file errors.
- FileFd F(aptcfg->FindFile("DebTags::Vocabulary", "/var/lib/debtags/vocabulary"),
+ FileFd F(aptcfg->FindFile("DebTags::Vocabulary", "@TERMUX_PREFIX@/var/lib/debtags/vocabulary"),
FileFd::ReadOnly);
_error->RevertToStack();
diff -uNr a/src/generic/apt/tasks.cc b/src/generic/apt/tasks.cc
--- a/src/generic/apt/tasks.cc
+++ b/src/generic/apt/tasks.cc
@@ -492,6 +492,7 @@
const char *descdirs[] =
{"/usr/share/tasksel/descs",
"/usr/local/share/tasksel/descs",
+ "@TERMUX_PREFIX@/share/tasksel/descs",
NULL};
vector<string> descfiles;
for(const char **it = descdirs; *it != NULL; ++it)
diff -uNr a/src/gtk/changelog.cc b/src/gtk/changelog.cc
--- a/src/gtk/changelog.cc
+++ b/src/gtk/changelog.cc
@@ -65,7 +65,7 @@
std::string URL = cw::util::ssprintf("http://bugs.debian.org/%s", bug_number.c_str());
std::vector<std::string> arguments;
- arguments.push_back("/usr/bin/sensible-browser");
+ arguments.push_back("@TERMUX_PREFIX@/bin/sensible-browser");
arguments.push_back(URL);
Glib::spawn_async(".", arguments);
diff -uNr a/src/gtk/filesview.cc b/src/gtk/filesview.cc
--- a/src/gtk/filesview.cc
+++ b/src/gtk/filesview.cc
@@ -297,7 +297,7 @@
ver.VerStr());
}
- Glib::ustring fileslistname = Glib::ustring("/var/lib/dpkg/info/")
+ Glib::ustring fileslistname = Glib::ustring("@TERMUX_PREFIX@/var/lib/dpkg/info/")
+ Glib::ustring(ver.ParentPkg().Name()) + Glib::ustring(".list");
std::ifstream fileslist(fileslistname.c_str());
diff -uNr a/src/gtk/gui.cc b/src/gtk/gui.cc
--- a/src/gtk/gui.cc
+++ b/src/gtk/gui.cc
@@ -363,7 +363,7 @@
saw_any_output(false)
{
std::vector<std::string> arguments;
- arguments.push_back("/usr/bin/diff");
+ arguments.push_back("@TERMUX_PREFIX@/bin/diff");
arguments.push_back("-u");
arguments.push_back(existing_file);
arguments.push_back(new_file);