Skip to content

Complete overhaul of apt and related scripts - #82

Closed
gm10 wants to merge 1 commit into
linuxmint:masterfrom
gm10:apt-assorted-fixes
Closed

gm10 wants to merge 1 commit into
linuxmint:masterfrom
gm10:apt-assorted-fixes

Conversation

@gm10

@gm10 gm10 commented Aug 23, 2018 •

Copy link
Copy Markdown
Contributor

Modified and Fixed Commands:

  • add-repository works again
  • changelog command can now retrieve full changelogs for almost any
    package and retrieves changelogs for installed packages locally
    (unless --no-local was specified) - if download size exceeds 2.5 MB
    the user is asked for confirmation
  • download rewritten (fixes mint-apt-download.py  #79)
    • now supports version and release declaration,
    • now supports multiple packages in the argument,
    • only creates a .tar.gz if at least 2 packages were downloaded,
    • no longer risks overwriting files in the home folder,
    • only refreshes the cache if older than 24h, and
    • has improved error checking, handling and messaging, including
      handling of broken dependencies
  • edit-sources is now using nano directly instead of binary apt since
    the latter cannot open symlinked source files
  • recommends rewritten, now defaults to non-recursive mode and has a
    -R / --recursive parameter for recursive mode (fixes mint-apt-recommends.py bug and suggestion #86)
  • search gained an optional --apt parameter to use apt instead of
    aptitude for the search
  • version is now running dpkg-query directly instead of going through
    an external script
  • help output reformatted for easier readability
  • binary apt is used for most commands, where available

New Commands:

  • auto-clean & auto-remove aliases added for binary apt compatibility
  • add-key: download and add key id from keyserver or from file
  • listi: short for list --installed
  • listu: short for list --upgradable
  • purgeall: short for purge --autoremove
  • purge-residual: purge residual configuration
  • showsrc: show source records (fixes apt not supporting showsrc command  #78)
  • --version: binary apt version passthrough
  • unmarkauto: alias for markmanual

Removed Commands:

  • stats
  • sources (just the alias, too easy to confuse with the source command)

Other Fixes and Changes:

  • options beginning with a dash can now be entered before the command (fixes apt argument order #77)
  • proper handling of quotes and escaped characters in parameters
  • bash completion rewritten, now supports all commands and most options
  • apt no longer asks for sudo privileges if a valid simulation argument
    was used
  • highlighting limited to aptitude search, now supports multiple search
    terms and handles parameters
  • Sorting and highlighting is now done internally
  • removed the no longer needed highlight-mint script
  • signals like Ctrl+C are handled, with signals that pause execution
    leading to termination to prevent lingering dpkg lock
  • usage text corrected and amended
  • added ./test script to the source as with other Mint packages
  • added python3-apt dependency
  • likely more

Depends on:
linuxmint/mintcommon#31

@clefebvre

Copy link
Copy Markdown
Member

Hi @gm10

Sorry for the delay, it's a pity you mixed different things in the same PR.

I'll pick your fix for apt download and send an update to 19.

The rest will be considered for 19.1.

PS: We want to stay with aptitude for "search". The search feature in /usr/bin/apt isn't as useful (you can't grep it easily, there's no state search... for instance "apt search ~c" etc..).

@gm10

gm10 commented Oct 22, 2018 •

Copy link
Copy Markdown
Contributor Author

Sorry for the delay, it's a pity you mixed different things in the same PR.

Yes, sorry @clefebvre, I know this one's a mess, but it was hard separating them without merge conflicts down the line, so this basically just became a big idea dump. I tried at least keeping the individual commits clean so you can pick your poison. I can of course provide a "clean" PR if you do. update: there's really no way to cherry pick from this properly anymore, most of the changes go together, so I condensed it all down to a single, beautiful commit. Vive la résistance ! ;)

Re search, I see where you're coming from but personally I'd think that most users won't expect to be able to use aptitude syntax with apt, and for a pure keyword search the apt version is stronger for it defaults to also searching the full description and includes the short description in the output. But we can of course agree to disagree. update: search defaults to aptitude again but the --apt parameter gives access to binary apt search.

@gm10

gm10 commented Dec 13, 2018 •

Copy link
Copy Markdown
Contributor Author

Reset, rewind, and the longest commit message ever. Cherry-picking season is over.

@muzena

muzena commented Dec 13, 2018

Copy link
Copy Markdown

@gm10

I'm using it to add better changelog support for mintupdate as well

Can you fix/or do something, previously it work mintupdate changelog only for launchapad.net PPA repos, now sometimes work sometimes don't work.
For repos outside launchpad mintupdate changelog don't work.

@gm10

gm10 commented Dec 13, 2018 •

Copy link
Copy Markdown
Contributor Author

@muzena mintupdate should still work correctly for PPAs (only shows the latest change though if I recall correctly), but you'd best discuss that in a mintupdate issue report.

Integrating my own changelog module here into official mintupdate won't happen before LM19.2, if at all (it has not been discussed and is not my decision to make). Again, wrong place to discuss this.

@gm10 gm10 changed the title apt: assorted fixes Complete overhaul of apt and related scripts Feb 9, 2019
@muzena

muzena commented Feb 27, 2019

Copy link
Copy Markdown

@gm10
Today I noticed that after these changes can't open from synaptic repositories.
Synaptic > Settings > Repositories

@gm10

gm10 commented Feb 27, 2019

Copy link
Copy Markdown
Contributor Author

@muzena hello again, but I suspect you are still in the very wrong place. What changes are you talking about? Can't be the ones in this pull request right here, are they? ;)

@muzena

muzena commented Feb 27, 2019 •

Copy link
Copy Markdown

@gm10
Since Gwendal LE BIHAN nightly PPA do not work anymore, I made my own Cinnamon GIT PPA.
This PPA is syncing every 5h and if changes in git made it automatically generates deb packages.

I don't know some changes in mintsources, mint-common, mintsystem or some other package.

@muzena

muzena commented Feb 27, 2019

Copy link
Copy Markdown

This is error from terminal when I click on:
Synaptic > Settings > Repositories

Traceback (most recent call last):
File "/usr/lib/linuxmint/mintSources/mintSources.py", line 1735, in
Application().run()
File "/usr/lib/linuxmint/mintSources/mintSources.py", line 801, in init
self.apt = mintcommon.APT(self._main_window)
AttributeError: module 'mintcommon' has no attribute 'APT'

@gm10

gm10 commented Feb 27, 2019 •

Copy link
Copy Markdown
Contributor Author

@muzena we're not guaranteeing that non-release versions do work. We're currently making changes to a large number of repositories. Your problem is you do not have the latest version of all of them. But even so we're not guaranteeing it will always work. Running "nightlies" is at your own risk.

Either way, this is really entirely unrelated to both mintsystem and this PR, so I respectfully ask to create your own issue next time in the appropriate repository (but not for something like this, it's a self-inflicted problem).

Modified and Fixed Commands:
- add-repository works again
- changelog command can now retrieve full changelogs for almost any
  package and retrieves changelogs for installed packages locally
  (unless --no-local was specified) - if download size exceeds 2.5 MB
  the user is asked for confirmation
- download rewritten:
  - now supports version and release declaration,
  - now supports multiple packages in the argument,
  - only creates a .tar.gz if at 2 packages were downloaded,
  - no longer risks overwriting files in the home folder,
  - only refreshes the cache if older than 24h, and
  - has improved error checking, handling and messaging, including
    handling of broken dependencies
- edit-sources is now using nano directly instead of binary apt since
  the latter cannot open symlinked source files
- recommends rewritten, now defaults to non-recursive mode and has a
  -R / --recursive parameter for recursive mode
- search gained an optional --apt parameter to use apt instead of
  aptitude for the search
- version is now running dpkg-query directly instead of going through
  an external script
- help output reformatted for easier readability
- binary apt is now used for most commands, where available

New Commands:
- auto-clean & auto-remove aliases added for binary apt compatibility
- add-key: download and add key id from keyserver or from file
- listi: short for list --installed
- listu: short for list --upgradable
- purgeall: short for purge --autoremove
- purge-residual: purge residual configuration
- showsrc: show source records
- --version: binary apt version passthrough
- unmarkauto: alias  for markmanual

Removed Commands:
- stats
- sources (just the alias, too easy to confuse with the source command)

Other Fixes and Changes:
- options beginning with a dash can now be entered before the command
- proper handling of quotes and escaped characters in parameters
- bash completion rewritten, now supports all commands and most options
- apt no longer asks for sudo privileges if a valid simulation argument
  was used
- highlighting limited to aptitude search, now supports multiple search
  terms and handles parameters
- Sorting and highlighting is now done internally
- removed the no longer needed highlight-mint script
- signals like Ctrl+C are handled, with signals that pause execution
  leading to termination to prevent lingering dpkg lock
- usage text corrected and amended
- added python3-apt dependency
- added ./test script to the source as with other Mint packages
- likely more
@gm10 gm10 closed this Apr 9, 2019
@gm10
gm10 deleted the apt-assorted-fixes branch April 9, 2019 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mint-apt-recommends.py bug and suggestion mint-apt-download.py apt not supporting showsrc command apt argument order

4 participants