Bis Drush 8 gibt es das drush Kommando pm-updatestatus
:
$ drush pm-updatestatus [...] Name Installed Version Proposed version Message Admin Toolbar (admin_toolbar) 8.x-1.21 8.x-1.24 Update available Hacked! (hacked) 8.x-2.0-beta1 8.x-2.0-beta2 Update available Pathologic (pathologic) 8.x-1.x-dev 8.x-1.0-alpha1 Update available
Handelt es sich um ein Security-Update wird das mit SECURITY UPDATE available markiert.
Wenn die Ausgabe in einem Skript o.ä. weiterverarbeitet werden soll, bietet sich das CSV-Format an:
$ drush pm-updatestatus --format=csv [...] admin_toolbar,8.x-1.21,8.x-1.24,Update available hacked,8.x-2.0-beta1,8.x-2.0-beta2,Update available pathologic,8.x-1.x-dev,8.x-1.0-alpha1,Update available
Drush 9 unterstützt pm-updatestatus
nicht mehr - stattdessen gibt es drush pm:security
und composer show --outdated
.
drush pm:security
Via drush bekomme ich nur noch Security Updates (keine Ahnung wieso das so entschieden wurde):
$ drush pm:security [...] +-----------------------------+-------------------+-------------------+ | Name | Installed Version | Suggested version | +-----------------------------+-------------------+-------------------+ | drupal/eu_cookie_compliance | 1.0.0 | 1.1 | +-----------------------------+-------------------+-------------------+
Einfacher zu parsen als CSV:
$ drush pm:security --format=csv Name,"Installed Version","Suggested version" drupal/eu_cookie_compliance,1.0.0,1.1
Oder als JSON:
$ drush pm:security --format=json [...] { "drupal/eu_cookie_compliance": { "name": "drupal/eu_cookie_compliance", "version": "1.0.0", "min-version": "1.1" } }
Die Versions-Nummer sind anders als von pm-updatestatus gewöhnt:
- kein Prefix '8.x-'
- die installierte hat am Ende noch ein '.0' angehängt
- dafür erhalte ich aber wirklich nur das Security-Update: im Beispiel hat eu_cookie_compliance als Security-Update die 8.x-1.1, es gibt aber auch 8.x-1.2. Das erfahre ich dann unten via
composer show --outdated
.
composer show --outdated
Um alle verfügbaren Updates zu erhalten muss ich auf composer zurückgreifen:
$ composer show --outdated drupal/* drupal/eu_cookie_compliance 1.0.0 1.2.0 This module aims at making [..] drupal/paragraphs 1.x-dev 2ea25f1 1.x-dev ae73560 Enables the creation of Paragraphs [..]
Ohne die Angabe drupal/*
erhalte ich auch alle vendor-Updates, hier interessieren aber nur Drupal-Module und -Core.
Als JSON:
$ composer show --outdated drupal/* --format=json { "installed": [ { "name": "drupal/eu_cookie_compliance", "version": "1.0.0", "latest": "1.2.0", "latest-status": "semver-safe-update", "description": "This module aims at making the website compliant with the new EU cookie regulation" }, { "name": "drupal/paragraphs", "version": "1.x-dev 2ea25f1", "latest": "1.x-dev ae73560", "latest-status": "semver-safe-update", "description": "Enables the creation of Paragraphs entities." } ] }
Anmerkungen:
- Die Versions-Nummer sind wie bei
drush pm:security
ohne vorangestelltes '8.x-' - Im Gegensatz zur Drupal-UI werden hier auch mit composer installierte dev-Versionen angezeigt!
- Die Hilfe
composer help show
sagt:-i, --installed List installed packages only (enabled by default, only present for BC).
was für mich so klingt als ob nur aktivierte Module angezeigt werden - es werden aber auch Updates für nicht-aktivierte Module aufgelistet.
Neuen Kommentar hinzufügen