[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#1021425: debmany: "The package does not exist" when in exists in cwd



* Axel Beckert <abe@debian.org>, 2022-10-08 14:49:
So maybe we need an "apt-get print-uris" (or "apt-cache print-uris") subcommand analogous to the "apt reinstall" shortcut for "apt --reinstall install") which reliably shows that URI independent of any current package state or downloaded files.

Such an option for APT would be indeed useful, but in the mean time, debmany could just chdir into a directory that doesn't contain any *.deb files before running "apt-get --print-uris ...". See the attached patch.

--
Jakub Wilk
diff --git a/debmany/debmany b/debmany/debmany
index dfea6e9..7a6029a 100755
--- a/debmany/debmany
+++ b/debmany/debmany
@@ -279,11 +279,11 @@ else
   if [ -z "$file" ]
   then
     debug "Mode3: Determining the path of '$package' using 'apt-get -q2 --print-uris download'" # comment
-    aptdata=`apt-get -q2 --print-uris download "$package" 2>/dev/null | grep "$package"_`
+    aptdata=`cd / && apt-get -q2 --print-uris download "$package" 2>/dev/null | grep "$package"_`
     if [ -z "$aptdata" ]
     then
       errormsg "There was an error looking for package '$package'."
-      aptdata=`apt-get -q2 --print-uris download "apt"  2>/dev/null | grep "apt"_`
+      aptdata=`cd / && apt-get -q2 --print-uris download "apt"  2>/dev/null | grep "apt"_`
       if [ $? -ne 0 ] ||  [ -z "$aptdata" ] ; then
       # If looking for apt fails then there is something amiss
         error "Apt-get might not be working properly Possible failure when running 'apt-get -q2 --print-uris download \"$package\"'"

Reply to: