dCore Import Debian Packages to Mountable SCE extensions > dCore X86
how does sce-update behaves if an sce was imported with -R?
Jason W:
I will ponder a way for sce-update to recognize if an SCE was imported with the -R and/or -S option.
nitram:
Hi netnomad. Last check all sce-import options are in --help, the -R option was added some time ago. The SCE scripts are in /usr/bin, let me know if you see a case option not listed in --help.
Just learning and having fun, if anything is inaccurate please forgive :)
Seems importupdatecheck is only aware whether Recommended or Suggested packages were installed, not whether the -RS flags were used [1].
--- Code: ---## Determine if SCE exists in SCE dir, SCE/update dir, or is mounted and then mount.
if [ -f "$SCEDIR"/update/"$SCE".sce ]; then
[ -d /tmp/sceupdatetest ] || mkdir /tmp/sceupdatetest
sudo busybox mount "$SCEDIR"/update/"$SCE".sce /tmp/sceupdatetest
DATADIR=/tmp/sceupdatetest/usr/local/sce/"$SCE"
FILE=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE".md5sum
FILEDATA=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
elif sudo busybox mount | grep "/tmp/tcloop/$SCE " > /dev/null 2>&1; then
DATADIR=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"
FILE=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"/"$SCE".md5sum
FILEDATA=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
elif [ -f "$SCEDIR"/"$SCE".sce ]; then
DATADIR=/tmp/sceupdatetest/usr/local/sce/"$SCE"
[ -d /tmp/sceupdatetest ] || mkdir /tmp/sceupdatetest
sudo busybox mount "$SCEDIR"/"$SCE".sce /tmp/sceupdatetest
FILE=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE".md5sum
FILEDATA=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
fi
--- End code ---
Adding this just before mksquashfs command towards the bottom of deb2sce:
--- Code: ---else
touch ""$TARGET"/usr/local/tce.installed/"$TARGET"_import_data"
echo "==== "$TARGET" ====" > "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
echo "Import date: `date`" >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
if [ -f /tmp/.recommends ]; then
echo "Imported with -R option." >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
fi
if [ -f /tmp/.suggests ]; then
echo "Imported with -S option." >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
fi
mksquashfs "$TARGET" "$TCEDIR"/sce/"$TARGET".sce -noappend
--- End code ---
...and running sce-import -RS nano produces a usr/local/tce.installed/nano_import_data file:
--- Code: ---==== nano ====
Import date: Wed Sep 21 06:39:57 UTC 2016
Imported with -R option.
Imported with -S option.
--- End code ---
Unsure whether /tce.installed/ is appropriate for such a file, probably superfluous anyway. Something like this or simpler could be used to read case options for an update re-import.
[1] Importing nano with -RS flags, there were no Recommended packages. So the SCE contains only a /tmp/tcloop/usr/local/sce/$SCE/suggests file. The absent recommends file, therefore, misleads both the user and importupdatecheck into thinking the -R option was not used during the initial import, even though it was. Maybe future bug if Debian/Ubuntu add Suggested and Recommended packages between update checks, not sure they do that.
netnomad:
hi nitram,
it was my fault... i tried sce-update -h, and looked there for the -R option, although it makes not very much sense ;-)
... and i missed to look in the sce-import options.
thank you for your reply.
Jason W:
We can definitely make /usr/local/sce/"$SCE"/recommends and /usr/local/sce/"$SCE"/suggests get created by the use of the -R or -S flag rather than the existence of extra recommended or suggested packages, that does make sense. I like to have a file name like recommends or a one word entry in a file that is easy to grep for in the scripted routines. But we also could create a human readable file that has the information like in the $target_import_data example above, that can include the flags the SCE was imported with and date so the user can refer to it. And then a command like "sce-info" to basically echo that file.
nitram:
--- Quote from: Jason W on September 21, 2016, 04:03:41 PM ---We can definitely make /usr/local/sce/"$SCE"/recommends and /usr/local/sce/"$SCE"/suggests get created by the use of the -R or -S flag rather than the existence of extra recommended or suggested packages, that does make sense.
--- End quote ---
Yes please, may prevent future bugs.
I created a function to be used just before mksquashfs in deb2sce to create /tce.installed/SCE_import_data file like:
--- Code: ---nano.sce
Thu Sep 22 16:40:03 UTC 2016
Dependency import using:
xorg-all
Used -R option, added:
0 packages
Used -S option, added:
spell
Total import 9 packages (19 - 10 dependency provided):
dictionaries-common
emacsen-common
iamerican
ienglish-common
ispell
libtext-iconv-perl
nano
perlapi-5.20.0
spell
--- End code ---
Archives some useful information during import. Not sure if necessary or just bloat. May help with troubleshooting in some instances. Personally would not use an sce-info script. Most dCore users would know where to find this tce.installed data file or could be directed by forum members if it helps with import/update troubleshooting.
Just let me know what you all think and i can submit a script update...or not. Thanks.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version