Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #199144

Re: Installing package *NOT* in repository

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Installing package *NOT* in repository
Date 2018-08-21 15:40 +0200
Message-ID <wpf33-37V-5@gated-at.bofh.it> (permalink)
References <wmjwd-5IS-5@gated-at.bofh.it> <wnRYS-3xy-1@gated-at.bofh.it> <wpcyd-1Aw-3@gated-at.bofh.it> <wpdDY-2qU-9@gated-at.bofh.it> <wpegF-2Df-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 21, 2018 at 02:48:25PM +0200, tomas@tuxteam.de wrote:
> On Tue, Aug 21, 2018 at 08:02:02AM -0400, Gene Heskett wrote:
> > Odd, maybe apt does not look in $PATH?

(That wouldn't be "odd".  That would be "normal".)

> There's no reason to assume that, unless when looking for an executable
> (i.e. those things which tend to live in /bin and /usr/bin).
> 
> Actually, dpkg's man page mentions $PATH, but only for searching
> executables, which is to be expected. Not for searching packages.
> 
> To me, it would be a surprise.

Y'know what, I'm getting sick of apt having this feature and not
documenting it anywhere.  So I decided to do an "apt-get source apt"
and try to find it in the freakin' code.

Unfortunately, it is written in C++.  It is a nightmare.  Totally
unreadable.

I managed to find the file apt-1.4.8/cmdline/apt.cc which looks like
the starting point for the "apt" command line tool.  So, yay?  We can
start here, right?  Hah!

The "obvious" thing that I found was this:

      // package stuff
      {"install", &DoInstall, _("install packages")},

So, if we pass the command "install", it should call this function named
"DoInstall", right?  So all we have to do is find the function named
"DoInstall" somewhere in the source code, and read that, and it will
tell us what the "install" command does.  Right?

Wrong.  Because it's an unmaintinable C++ nightmare.

Oh, but, here's main() and in main() we see this call:

   auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);

So, we can just find the function named "ParseCommandLine" and read THAT,
and surely THAT would have to tell us how it parses the command line
arguments, right?  RIGHT?!

Wrong.  Because it's an unreadable C++ nightmare.

I also tried looking for "strchr" (thinking, "somewhere there HAS to be
a check to see whether the argument string contains a slash character,
right?").  I found a few of them, but none seemed relevant.

I even tried doing searches for "'/'" (that is, the three-character
literal string '/') in a few places, but no luck with that either.

Oh, you know what else?  Here in the top-level directory there's this
file named README.md and it says:

  APT uses cmake.

At that point, I just gave up.  cmake is the WORST.  As near as I
can tell, it exists for only one reason: to make development hellish.
As soon as I saw that this project uses cmake, I literally gave up,
wrote this screed, and deleted the source directory.

Someone else can try to find the god damned argument parsing code.
Which should be in the god damned main() function.  But isn't.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Installing package *NOT* in repository Richard Owlett <rowlett@cloud85.net> - 2018-08-13 13:50 +0200
  Re: Installing package *NOT* in repository Joe <joe@jretrading.com> - 2018-08-13 14:00 +0200
    Re: Installing package *NOT* in repository Richard Owlett <rowlett@cloud85.net> - 2018-08-13 14:30 +0200
      Re: Installing package *NOT* in repository Samuel Henrique <samueloph@debian.org> - 2018-08-13 14:40 +0200
        Re: Installing package *NOT* in repository Vincent Lefevre <vincent@vinc17.net> - 2018-08-17 11:30 +0200
          Re: Installing package *NOT* in repository Gene Heskett <gheskett@shentel.net> - 2018-08-17 13:40 +0200
            Re: Installing package *NOT* in repository Richard Owlett <rowlett@cloud85.net> - 2018-08-17 14:30 +0200
              Re: Installing package *NOT* in repository Reco <recoverym4n@gmail.com> - 2018-08-17 14:50 +0200
                Re: Installing package *NOT* in repository Richard Owlett <rowlett@cloud85.net> - 2018-08-17 17:00 +0200
            Re: Installing package *NOT* in repository David Wright <deblis@lionunicorn.co.uk> - 2018-08-17 20:50 +0200
              Re: Installing package *NOT* in repository Vincent Lefevre <vincent@vinc17.net> - 2018-08-21 13:00 +0200
                Re: Installing package *NOT* in repository Gene Heskett <gheskett@shentel.net> - 2018-08-21 14:10 +0200
                Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-21 14:50 +0200
                Re: Installing package *NOT* in repository Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-21 15:40 +0200
                Re: Installing package *NOT* in repository Michael Stone <mstone@debian.org> - 2018-08-21 16:40 +0200
                Re: Installing package *NOT* in repository David Wright <deblis@lionunicorn.co.uk> - 2018-08-21 17:10 +0200
                Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-21 17:40 +0200
                Re: Installing package *NOT* in repository Gene Heskett <gheskett@shentel.net> - 2018-08-21 19:30 +0200
                Re: Installing package *NOT* in repository David Wright <deblis@lionunicorn.co.uk> - 2018-08-21 17:10 +0200
                Re: Installing package *NOT* in repository Greg Wooledge <wooledg@eeg.ccf.org> - 2018-08-21 17:30 +0200
                Re: Installing package *NOT* in repository Michael Stone <mstone@debian.org> - 2018-08-21 18:00 +0200
                Re: Installing package *NOT* in repository David Wright <deblis@lionunicorn.co.uk> - 2018-08-21 19:00 +0200
      Re: Installing package *NOT* in repository Joe <joe@jretrading.com> - 2018-08-13 15:00 +0200
      Re: Installing package *NOT* in repository Zenaan Harkness <zenaan@freedbms.net> - 2018-08-13 16:10 +0200
  Re: Installing package *NOT* in repository john doe <johndoe65534@mail.com> - 2018-08-13 14:10 +0200
  Re: Installing package *NOT* in repository Matthew Crews <mailinglists@mattcrews.com> - 2018-08-13 15:00 +0200
    Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-13 15:50 +0200
  Re: Installing package *NOT* in repository Patrick Bartek <nemommxiv@gmail.com> - 2018-08-13 17:40 +0200
    Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-13 17:50 +0200
      Re: Installing package *NOT* in repository Samuel Henrique <samueloph@debian.org> - 2018-08-13 18:00 +0200
        Re: Installing package *NOT* in repository tomas@tuxteam.de - 2018-08-13 18:20 +0200
          Re: Installing package *NOT* in repository Brian <ad44@cityscape.co.uk> - 2018-08-13 18:50 +0200
            Re: Installing package *NOT* in repository Curt <curty@free.fr> - 2018-08-13 19:10 +0200
              Re: Installing package *NOT* in repository Brian <ad44@cityscape.co.uk> - 2018-08-13 19:30 +0200
      Re: Installing package *NOT* in repository Brian <ad44@cityscape.co.uk> - 2018-08-13 18:00 +0200
        Re: Installing package *NOT* in repository Cindy-Sue Causey <butterflybytes@gmail.com> - 2018-08-14 19:50 +0200
          Re: Installing package *NOT* in repository Jason <electron@emypeople.net> - 2018-08-15 13:10 +0200
      Re: Installing package *NOT* in repository Patrick Bartek <nemommxiv@gmail.com> - 2018-08-14 04:10 +0200
        Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-14 09:00 +0200
          Re: Installing package *NOT* in repository Patrick Bartek <nemommxiv@gmail.com> - 2018-08-14 17:00 +0200
            Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-14 17:30 +0200
  Re: Installing package *NOT* in repository songbird <songbird@anthive.com> - 2018-08-14 05:50 +0200
  Re: Installing package *NOT* in repository Erik Christiansen <dvalin@internode.on.net> - 2018-08-14 08:50 +0200
    Re: Installing package *NOT* in repository Richard Owlett <rowlett@cloud85.net> - 2018-08-14 13:50 +0200
      Re: Installing package *NOT* in repository Erik Christiansen <dvalin@internode.on.net> - 2018-08-15 07:10 +0200
        Re: Installing package *NOT* in repository Kenneth Parker <sea7kenp@gmail.com> - 2018-08-15 07:30 +0200
          Re: Installing package *NOT* in repository <tomas@tuxteam.de> - 2018-08-15 10:00 +0200
          Re: Installing package *NOT* in repository Darac Marjal <mailinglist@darac.org.uk> - 2018-08-15 10:30 +0200
        Re: Installing package *NOT* in repository Zenaan Harkness <zenaan@freedbms.net> - 2018-08-15 08:20 +0200

csiph-web