Skip to content

Commit

Permalink
replace function used to remove directories with rm from FreeBSD (#374)
Browse files Browse the repository at this point in the history
* replace rm with embedded FreeBSD rm

The FreeBSD version from here seems like it's more updated.

* rm.c: remove unused functions

* remove support for rm external binary

* update ChangeLog

* update pot and po

 Thanks to @DiegoMagdaleno and @dcantrell

---------

Co-authored-by: Diego Magdaleno <diegomagdaleno@protonmail.com>
  • Loading branch information
andy5995 and DiegoMagdaleno authored Jan 27, 2023
1 parent dd578e4 commit 63ce274
Show file tree
Hide file tree
Showing 30 changed files with 680 additions and 1,354 deletions.
1 change: 0 additions & 1 deletion .github/scripts/all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ if [ "${GITHUB_REF_TYPE}" != "tag" ]; then
else
meson configure -Dbuildtype=release -Dstrip=true -Dprefix=/usr
DESTDIR=AppDir ninja install
cp /usr/bin/rm AppDir/usr/bin
cd -
wget -nv https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage
chmod +x linuxdeploy-${ARCH}.AppImage
Expand Down
9 changes: 5 additions & 4 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
=== rmw ChangeLog ===
2022-01-27

* replace function used to remove directories with rm from FreeBSD;
Thanks to @DiegoMagdaleno and @dcantrell

2022-12-24

* bugfix: buffer underflow when calling trim_char() with empty
Expand All @@ -9,10 +14,6 @@

- When purging, '-ff' is no longer needed to confirm removal of
non-writable expired directories and files
* When purging, the 'rm' binary native to the user's
system will now be used.
+ When purging, if the user's native 'rm' has the '--one-file-system'
argument available, it will be automatically used when calling 'rm'.

2022-02-08

Expand Down
12 changes: 2 additions & 10 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ project(
meson_version : '>= 0.59.0',
default_options: [
'warning_level=3',
'b_sanitize=address,undefined'
'b_sanitize=address,undefined',
'b_lundef=false'
]
)

Expand Down Expand Up @@ -46,15 +47,6 @@ conf.set_quoted('PACKAGE_STRING', meson.project_name())
conf.set_quoted('PACKAGE_URL', 'https://remove-to-waste.info/')
conf.set_quoted('PACKAGE_BUGREPORT', 'https://github.com/theimpossibleastronaut/rmw/issues')

foo_file = 'foo_rmw.txt'
configure_file(output: foo_file, configuration: configuration_data())
rm_cmd = find_program('rm', required: true)
conf.set_quoted('RM_FULL_PATH', rm_cmd.full_path())
r = run_command(rm_cmd, '--one-file-system', join_paths(meson.project_build_root(), foo_file), check: false)
if r.returncode() == 0
conf.set('RM_HAS_ONE_FILE_SYSTEM_ARG', 1)
endif

check_headers = [
['ncursesw/menu.h', 'HAVE_NCURSESW_MENU_H'],
['ncurses/menu.h', 'HAVE_NCURSES_MENU_H'],
Expand Down
58 changes: 29 additions & 29 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: rmw 0.4.05-dev\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-12 14:59-0500\n"
"POT-Creation-Date: 2023-01-27 10:24-0600\n"
"PO-Revision-Date: 2022-10-14 23:11+0200\n"
"Last-Translator: Eric Haberstroh <gpg@erixpage.de>\n"
"Language-Team: German\n"
Expand Down Expand Up @@ -72,7 +72,7 @@ msgstr ""
"# '-f' verwenden wollen, kommentieren Sie die folgende Zeile aus:\n"
"#\n"

#: src/main.c:212
#: src/main.c:214
msgid ""
"\n"
"Your single slash has been ignored. You walk to the market\n"
Expand Down Expand Up @@ -216,26 +216,26 @@ msgid "# rmw default waste directory, separate from the desktop trash\n"
msgstr ""
"# rmw Standard Mülleimer-Verzeichnis, unabhängig vom Schreibtisch-Mülleimer\n"

#: src/purging_rmw.c:360
#: src/purging_rmw.c:336
#, c-format
msgid "%d item purged"
msgid_plural "%d items purged"
msgstr[0] "%d Datei gelöscht"
msgstr[1] "%d Dateien gelöscht"

#: src/main.c:348
#: src/main.c:350
#, c-format
msgid "%d item was removed to the waste folder"
msgid_plural "%d items were removed to the waste folder"
msgstr[0] "%d Datei wurde in den Papierkorb verschoben"
msgstr[1] "%d Dateien wurden in den Papierkorb verschoben"

#: src/main.c:246
#: src/main.c:248
#, c-format
msgid "%s resides within a waste folder and has been ignored\n"
msgstr "%s existiert in einem Mülleimer Ordner und wird ignoriert\n"

#: src/purging_rmw.c:348
#: src/purging_rmw.c:324
#, c-format
msgid "'%s' will be purged in %.2lf days\n"
msgstr "'%s' wird in %.2lf Tag(en) gelöscht\n"
Expand All @@ -251,29 +251,29 @@ msgid "-r, -R, --recursive: option not required (enabled by default)\n"
msgstr ""
"-r, -R, --recursive: Parameter nicht benötigt (standardmäßig aktiviert)\n"

#: src/restore_rmw.c:397
#: src/restore_rmw.c:399
msgid "<CURSOR-RIGHT / CURSOR-LEFT> - switch waste folders"
msgstr "<PFEIL-RECHTS / PFEIL-LINKS> - zwischen Papierkörben wechseln"

#: src/restore_rmw.c:400
#: src/restore_rmw.c:402
msgid "<ESC> - quit"
msgstr "<ESC> - beenden"

#: src/restore_rmw.c:398
#: src/restore_rmw.c:400
msgid ""
"<SPACE> - select or unselect an item. / <ENTER> - restore selected items"
msgstr ""
"<LEERTASTE> - Eintrag auswählen oder Auswahl aufheben. / <ENTER> - "
"ausgewählte Einträge wiederherstellen"

#: src/restore_rmw.c:391
#: src/restore_rmw.c:393
#, c-format
msgid "== contains %d file =="
msgid_plural "== contains %d files =="
msgstr[0] "== enthält %d Datei =="
msgstr[1] "== enthält %d Dateien =="

#: src/purging_rmw.c:282
#: src/purging_rmw.c:257
msgid "Action cancelled."
msgstr "Ausführung abgebrochen."

Expand All @@ -285,7 +285,7 @@ msgstr "Argumente von --purge müssen Zahlen sein"
msgid "Continue? (y/n): "
msgstr "Weitermachen? (y/n): "

#: src/purging_rmw.c:413
#: src/purging_rmw.c:389
#, c-format
msgid "Created %s\n"
msgstr "%s angelegt\n"
Expand All @@ -295,11 +295,11 @@ msgstr "%s angelegt\n"
msgid "Created directory %s\n"
msgstr "Verzeichnis %s angelegt\n"

#: src/main.c:478
#: src/main.c:480
msgid "Creating default configuration file:"
msgstr "Erzeuge Standard-Konfigurationsdatei:"

#: src/restore_rmw.c:135
#: src/restore_rmw.c:137
#, c-format
msgid "Duplicate filename at destination - appending time string...\n"
msgstr "Doppelte Dateiname im Zielverzeichnis, hänge Zeitstempel an...\n"
Expand All @@ -309,7 +309,7 @@ msgstr "Doppelte Dateiname im Zielverzeichnis, hänge Zeitstempel an...\n"
msgid "File not found: '%s'\n"
msgstr "Datei nicht gefunden: '%s'\n"

#: src/main.c:657
#: src/main.c:659
#, c-format
msgid ""
"Insufficient command line arguments given;\n"
Expand All @@ -318,23 +318,23 @@ msgstr ""
"Fehlende Kommandozeilenoptionen \n"
"Gib '%s -h' ein, um mehr Informationen zu erhalten\n"

#: src/main.c:337
#: src/main.c:339
#, c-format
msgid "No suitable filesystem found for \"%s\"\n"
msgstr "Kein passendes Dateisystem für \"%s\" gefunden\n"

#: src/purging_rmw.c:289
#: src/purging_rmw.c:264
#, c-format
msgid "Purging all files in waste folders ...\n"
msgstr "Lösche alle Dateien aus Papierkörben ...\n"

#: src/purging_rmw.c:292
#: src/purging_rmw.c:267
#, c-format
msgid "Purging files based on number of days in the waste folders (%u) ...\n"
msgstr ""
"Lösche Dateien auf Grundlage der Verweildauer in den Papierkörben (%u) ...\n"

#: src/restore_rmw.c:308
#: src/restore_rmw.c:310
#, c-format
msgid "Reading %s...\n"
msgstr "Lese %s...\n"
Expand Down Expand Up @@ -374,7 +374,7 @@ msgstr ""
"DAS PROGRAMM SICH ALS FEHLERHAFT HERAUSSTELLEN, ÜBERNEHMEN SIE DIE KOSTEN\n"
"FÜR ALLE NOTWENDIGEN WARTUNGSARBEITEN, REPARATUREN ODER VERBESSERUNGEN.\n"

#: src/purging_rmw.c:279
#: src/purging_rmw.c:254
msgid "The contents of all waste folders will be deleted -"
msgstr "Der Inhalt aller Mülleimer wird gelöscht -"

Expand All @@ -393,12 +393,12 @@ msgstr "Benutze '%s --help' um weitere Hilfe zu erhalten.\n"
msgid "Try '%s ./%s' to remove the file '%s'.\n"
msgstr "Verwende '%s ./%s' um die Datei '%s' zu entferne.\n"

#: src/main.c:558
#: src/main.c:560
#, c-format
msgid "Unable to continue. Exiting...\n"
msgstr "Es kann nicht weitergemacht werden. Abbruch...\n"

#: src/main.c:487
#: src/main.c:489
msgid "Unable to read or write a configuration file."
msgstr "Die Konfigurationsdatei kann nicht gelesen oder geschrieben werden."

Expand All @@ -425,7 +425,7 @@ msgstr ""
" oder: %s -u\n"
" oder: %s -z DATEI...\n"

#: src/restore_rmw.c:375
#: src/restore_rmw.c:377
#, c-format
msgid "Your terminal only has %d lines. A minimum of %d lines is required.\n"
msgstr ""
Expand Down Expand Up @@ -466,12 +466,12 @@ msgstr ""
"Wenn Sie weitere Hilfe brauchen oder einen Fehler melden wollen,\n"
"besuchen die rmw-Webseite unter\n"

#: src/main.c:583
#: src/main.c:585
#, c-format
msgid "purge has been skipped: use -f or --force\n"
msgstr "Papierkorbleerung wurde übersprungen: verwende -f oder --force\n"

#: src/purging_rmw.c:270
#: src/purging_rmw.c:248
#, c-format
msgid ""
"purging is disabled ('%s' is set to '0')\n"
Expand Down Expand Up @@ -511,7 +511,7 @@ msgstr ""
"weiterverbreiten; siehe <http://www.gnu.org/licenses/gpl.html>\n"
"für Details.\n"

#: src/main.c:553
#: src/main.c:555
#, c-format
msgid ""
"unable to create config and data directory\n"
Expand All @@ -532,7 +532,7 @@ msgstr "beim Versuch Speicher zu beziehen -- %s:L%d\n"
msgid "while closing %s\n"
msgstr "beim Schließen von %s\n"

#: src/purging_rmw.c:419
#: src/purging_rmw.c:395
#, c-format
msgid "while creating %s\n"
msgstr "beim Anlegen von %s\n"
Expand All @@ -542,7 +542,7 @@ msgstr "beim Anlegen von %s\n"
msgid "while creating %s (%s)\n"
msgstr "beim Anlegen von %s (%s)\n"

#: src/main.c:538
#: src/main.c:540
msgid "while getting the path to your home directory\n"
msgstr "beim Ermitteln des Pfades zu Ihrem Home-Verzeichnises.\n"

Expand All @@ -561,7 +561,7 @@ msgstr "beim Öffnen %s -- %s:L%d\n"
msgid "while removing %s\n"
msgstr "beim Löschen von %s\n"

#: src/restore_rmw.c:178
#: src/restore_rmw.c:180
#, c-format
msgid "while removing .trashinfo file: '%s'\n"
msgstr "beim Löschen der .trashinfo-Datei '%s' \n"
Expand Down
Loading

0 comments on commit 63ce274

Please sign in to comment.